Last active
June 14, 2024 11:50
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
main: | |
build: . | |
restart: always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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