From: Mike Frysinger Date: Thu, 29 Dec 2016 23:17:56 +0000 (-0500) Subject: getmail: add mail fetcher X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=fe1ca378b883678fb3eff17cbdfaa72e6f9f3433;p=home.git getmail: add mail fetcher --- 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