fetchmail

This is an old version of the document!


Fetchmail

POP3 & IMAP with fetchmail

Importing emails from a POP3 or IMAP mailbox can also be done using fetchmail.

In der Standard-Konfiguration liefert fetchmail die abgeholten E-Mails per SMTP an localhost aus. Fetchmail kann aber so konfiguriert werden, daß die E-Mails direkt an ein beliebiges Programm übergeben werden. Mit Hilfe dieser Konfiguration kann die E-Mail dann in eine Mailbox im Maildir-Format ausgeliefert werden.

From here, the email is imported into Benno.

Configuration of fetchmail and procmail

Fetchmail is called using the following configuration file and delivers the emails to a Maildir via procmail.

# /etc/benno/fetchmailrc
#
set invisible poll pop3server.lw-systems.net user "bennoarchive" password "secret" fetchall mda "/usr/bin/procmail -m /etc/benno/procmailrc"

The path to the Maildir directory is defined in the procmailrc file

# /etc/benno/procmailrc # MAILDIR=/srv/benno/ :0 inbox/

Die E-Mails werden jetzt in das Verzeichnis /srv/benno/inbox/new ausgeliefert. Nach Auslieferung werden alle E-Mails von hier in das Inbox-Verzeichnis gelinkt. Dieses sollte direkt im Aufruf-Script von fetchmail durchgeführt werden.

Calling fetchmail

The script benno-fetchmail must be called as user "benno".

#!/bin/sh
#
# Script: /usr/local/sbin/benno-fetchmail
#
/usr/bin/fetchmail -f /etc/benno/fetchmailrc
 
for MAILFILE in `ls -1 /srv/benno/inbox/new`; do
  /bin/ln "/srv/benno/inbox/new/${MAILFILE}" "/srv/benno/inbox/${MAILFILE}.eml" && /bin/rm "/srv/benno/inbox/new/${MAILFILE}"
done
fetchmail.1478588116.txt.gz · Zuletzt geändert: 2017/01/18 10:21 (Externe Bearbeitung)