Smokes your problems, coughs fresh air.

Tag: fetchmail

Configuring fetchmail to deliver to Zimbra with custom header added

I needed to fetch mail from a POP3 account and deliver it to a Zimbra account. Because I’m doing this for multiple POP3 accounts, I want to add a header which I can use in Zimbra to filter. This is what we made:

poll server user "user" pass "secret" mda "formail -A 'X-Zimbra-To: user@domain.org'| /opt/zimbra/postfix/sbin/sendmail -i -t service@sicirec.org"

The -i tells sendmail to ignore a single dot on a line, because that would normally mean end of mail. The -t is “to” (not the header “To:“).

It is a bit unclear why postfix delivers locally to Zimbra, since doing mail user@ourdomain.org routes through an external SMTP server, which is configured in Zimbra to be used as MTA for outgoing mail. It is configured as ‘webmail MTA’.

Using Fetchmail to deliver to another SMTP host and user

If you want to fetch mail from several accounts and relay them to another SMTP host and user, you can use fetchmail. Define a .fetchmailrc like this:

defaults proto POP3 no keep fetchall smtphost smtp.example.net ssl
set no bouncemail
set no spambounce
set logfile /home/mailchecker/.fetchmail.log
 
poll mail.initfour.nl user "test" pass "test" smtpname user@domain.org
# more accounts to poll... 

© 2024 BigSmoke

Theme by Anders NorenUp ↑