--- /dev/null
+#!/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 &
--- /dev/null
+# 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