From fe1ca378b883678fb3eff17cbdfaa72e6f9f3433 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 29 Dec 2016 18:17:56 -0500 Subject: [PATCH] getmail: add mail fetcher --- .config/getmail/.gitignore | 1 + .config/getmail/gmail | 8 ++++++++ .config/getmail/gmail.rc | 30 ++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 .config/getmail/.gitignore create mode 100755 .config/getmail/gmail create mode 100644 .config/getmail/gmail.rc diff --git a/.config/getmail/.gitignore b/.config/getmail/.gitignore new file mode 100644 index 0000000..949fc73 --- /dev/null +++ b/.config/getmail/.gitignore @@ -0,0 +1 @@ +/oldmail-* diff --git a/.config/getmail/gmail b/.config/getmail/gmail new file mode 100755 index 0000000..c29900f --- /dev/null +++ b/.config/getmail/gmail @@ -0,0 +1,8 @@ +#!/bin/sh +[ "${FLOCKER}" != "$0" ] && exec env FLOCKER="$0" flock -en "$0" "$0" "$@" || : +cd ~/.config/getmail || exit 1 +if [ $(stat -c %s log) -gt $(( 1024 * 1024 * 3 )) ] ; then + tail -n 1000 log > log.new + mv log.new log +fi +getmail -q -g ~/.config/getmail -r gmail.rc & diff --git a/.config/getmail/gmail.rc b/.config/getmail/gmail.rc new file mode 100644 index 0000000..92cb710 --- /dev/null +++ b/.config/getmail/gmail.rc @@ -0,0 +1,30 @@ +# http://pyropus.ca/software/getmail/configuration.html#conf-retriever +[retriever] +type = SimpleIMAPSSLRetriever +server = imap.gmail.com +mailboxes = ('Inbox',) + +# http://pyropus.ca/software/getmail/configuration.html#conf-destination +[destination] +#type = Maildir +#path = ~/.mail/inbox/ + +#type = MDA_external +#path = /usr/bin/maildrop +#arguments = ("-f", "%(sender)", "~/.config/mail/maildrop.rc") + +type = MDA_external +path = /usr/libexec/dovecot/dovecot-lda +arguments = ("-f", "%(sender)", "-c", "~/.config/mail/dovecot-lda.conf") + +# http://pyropus.ca/software/getmail/configuration.html#conf-options +[options] +verbose = 1 +message_log = ~/.config/getmail/log + +delete = true +read_all = false + +# do not alter messages +delivered_to = false +received = false -- 2.39.2