I use munin, the monitoring program, to alert me by email when something goes wrong on my server.
It sends emails as munin
.
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[3167]: 979BD1E447E: uid=110 from=<munin@thehostname>
Jul 22 10:00:15 thehostname postfix/cleanup[9609]: 979BD1E447E: message-id=<[email protected]>
Jul 22 10:00:15 thehostname postfix/qmgr[3276]: 979BD1E447E: from=<munin@thehostname>, size=454, nrcpt=1 (queue active)
Jul 22 10:00:16 thehostname postfix/smtp[9611]: 979BD1E447E: to=<[email protected]>, relay=ASPMX.L.GOOGLE.COM[173.194.67.27]:25, delay=0.49, delays=0.07/0/0.12/0.3, dsn=5.7.1, status=bounced (host ASPMX.L.GOOGLE.COM[173.194.67.27] said: 550-5.7.1 [9.8.7.6 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[9609]: 372F91E4483: message-id=<[email protected]>
Jul 22 10:00:16 thehostname postfix/qmgr[3276]: 372F91E4483: from=<>, size=3167, nrcpt=1 (queue active)
Jul 22 10:00:16 thehostname postfix/bounce[9614]: 979BD1E447E: sender non-delivery notification: 372F91E4483
Jul 22 10:00:16 thehostname postfix/qmgr[3276]: 979BD1E447E: removed
Jul 22 10:00:16 thehostname postfix/local[9617]: 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[3276]: 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 [email protected]
...
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!
EDIT
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.
From the first log line
we can conclude that munin daemon set sender as
munin@thehostname
notmunin
only (without domain part) as your assumption.As a proof, I send email via sendmail CLI
Above command will add queue in
queue_directory
/maildrop. Run postcat command to view the queue contentIn this case the sender was only
myuser
without domain part. Here entry of maillog when sending.So, trivial rewrite has nothing to do in your case. Your email has proper sender address, so it hadn't rewritten.
Solution?
As alternative, set smtp_generic_maps to providing the rewrite for your munin.