I use munin, the monitoring program, to alert me by email when something goes wrong on my server.
It sends emails as
Normally, when an email like this is to be delivered on the Internet, when
postfix/cleanup is called, it asks
trivial-rewrite to do a rewrite, which should append
realdomain.tld to incomplete sender address.
It seams it does not, because my Postfix SMTP client then tries to send the email containing the
From: munin@thehostname header, which Google doesn't really like:
Jul 22 10:00:15 thehostname postfix/pickup: 979BD1E447E: uid=110 from=<munin@thehostname> Jul 22 10:00:15 thehostname postfix/cleanup: 979BD1E447E: message-id=<20130722080015.979BD1E447E@realdomain.tld> Jul 22 10:00:15 thehostname postfix/qmgr: 979BD1E447E: from=<munin@thehostname>, size=454, nrcpt=1 (queue active) Jul 22 10:00:16 thehostname postfix/smtp: 979BD1E447E: to=<firstname.lastname@example.org>, relay=ASPMX.L.GOOGLE.COM[22.214.171.124]:25, delay=0.49, delays=0.07/0/0.12/0.3, dsn=5.7.1, status=bounced (host ASPMX.L.GOOGLE.COM[126.96.36.199] said: 550-5.7.1 [188.8.131.52 1] Our system has detected an unusual rate of 550-5.7.1 unsolicited mail originating from your IP address. To protect our 550-5.7.1 users from spam, mail sent from your IP address has been blocked. 550-5.7.1 Please visit http://www.google.com/mail/help/bulk_mail.html to review 550 5.7.1 our Bulk Email Senders Guidelines. x12si10440172wia.27 - gsmtp (in reply to end of DATA command)) Jul 22 10:00:16 thehostname postfix/cleanup: 372F91E4483: message-id=<20130722080016.372F91E4483@realdomain.tld> Jul 22 10:00:16 thehostname postfix/qmgr: 372F91E4483: from=<>, size=3167, nrcpt=1 (queue active) Jul 22 10:00:16 thehostname postfix/bounce: 979BD1E447E: sender non-delivery notification: 372F91E4483 Jul 22 10:00:16 thehostname postfix/qmgr: 979BD1E447E: removed Jul 22 10:00:16 thehostname postfix/local: 372F91E4483: to=<munin@thehostname>, relay=local, delay=0.13, delays=0.05/0.01/0/0.06, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION") Jul 22 10:00:16 thehostname postfix/qmgr: 372F91E4483: removed
I don't know why the trivial-rewrite doesn't work as expected for the
munin user and why doesn't it get a proper sender address before the email is sent on the internet.
Other programs like
fail2ban succeed to send emails and are rewrote to
Here is the interesting part of my configuration:
myhostname = realdomain.tld mydomain = thehostname mydestination = localhost.localdomain, localhost, $mydomain, $myhostname myorigin = $myhostname mynetworks = relayhost =
I think there must be something I don't understand in the rewrite process!
I found this on an article talking about postfix addresses rewriting.
Rewrite user to user@$myorigin
This feature is controlled by the boolean append_at_myorigin parameter (default: yes). The purpose is to get consistent treatment of user on every machine in $myorigin.
I haven't changed the append_at_myorigin parameter, which should be set "yes". $myorigin is set to realdomain.tld, but the rewriting goes wrong and choose $mydomain instead.