Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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=<20130722080015.979BD1E447E@realdomain.tld>
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=<me@emailhandledbygoogle.com>, 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=<20130722080016.372F91E4483@realdomain.tld>
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 fail2ban@realdomain.tld...

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.

share|improve this question
    
Are you using procmail? –  ALex_hha Jul 22 '13 at 19:08
    
Yes I use procmail, but I think this program is only called for local delivery (like for the bounce message which was sent to munin@thehostname). But for the email I'm talking about qmgr gave it to smtp, not to local process. –  Fox Jul 22 '13 at 19:12
    
I just edited my post to add more information. –  Fox Jul 22 '13 at 20:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.