]> git.wh0rd.org Git - home.git/commitdiff
getmail: add mail fetcher
authorMike Frysinger <vapier@gentoo.org>
Thu, 29 Dec 2016 23:17:56 +0000 (18:17 -0500)
committerMike Frysinger <vapier@gentoo.org>
Thu, 29 Dec 2016 23:17:56 +0000 (18:17 -0500)
.config/getmail/.gitignore [new file with mode: 0644]
.config/getmail/gmail [new file with mode: 0755]
.config/getmail/gmail.rc [new file with mode: 0644]

diff --git a/.config/getmail/.gitignore b/.config/getmail/.gitignore
new file mode 100644 (file)
index 0000000..949fc73
--- /dev/null
@@ -0,0 +1 @@
+/oldmail-*
diff --git a/.config/getmail/gmail b/.config/getmail/gmail
new file mode 100755 (executable)
index 0000000..c29900f
--- /dev/null
@@ -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 (file)
index 0000000..92cb710
--- /dev/null
@@ -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