Skip to content

Instantly share code, notes, and snippets.

@piggynl
Last active June 14, 2024 11:50
Show Gist options
  • Save piggynl/3f09b4c3736103364826c5755c0b7aa0 to your computer and use it in GitHub Desktop.
Save piggynl/3f09b4c3736103364826c5755c0b7aa0 to your computer and use it in GitHub Desktop.
Periodically move unseen junk emails to inbox. This is to against Outlook's overly aggressive spam detection.
-- Ignore this file.
-- https://stackoverflow.com/questions/19896900/how-to-change-the-name-of-a-gist-in-github/19904644#19904644
-- https://stackoverflow.com/questions/17665267/how-do-you-control-the-order-in-which-files-appear-in-a-github-gist/17668995#17668995
services:
main:
build: .
restart: always
FROM debian:bookworm-slim
RUN apt-get update && \
apt-get install -y imapfilter ca-certificates
WORKDIR /app
COPY ./imapfilter.lua ./run.sh /app/
CMD ["/usr/bin/bash", "/app/run.sh"]
a = IMAP {
server = "outlook.office365.com",
username = "LOGIN@outlook.com",
password = "APP_PASSWORD", -- refer to https://support.microsoft.com/en-us/account-billing/how-to-get-and-use-app-passwords-5896ed9b-4263-e681-128a-a6f2979a7944
}
a['Junk']:check_status()
r = a['Junk']:is_unseen()
r:move_messages(a['Inbox'])
while true; do
imapfilter -c ./imapfilter.lua
sleep 3600
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment