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 have a postfix + dovecot with a spamassassin doing some content filtering on the postfix side. The problem is that with a recent update the originally available sendmail binary was replaced with the sendmail.postfix binary. Which seems to work differently with recipient information.

Here are some information about the configuration:

master.cf

<external ip>:submission         inet  n      -      -      -      -   smtpd
    -o content_filter=spamassassin
    -o cleanup_service_name=pre-cleanup
127.0.0.1:smtp                   inet  n      -      -      -      -   smtpd
[...]
spamassassin    unix        -       n       n       -       -       pipe
    flags=Rq user=spamd argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}

And the slightly anonymized log output which shows the actual problem:

Feb  7 02:47:04 comu postfix/smtpd[25393]: connect from unknown[<my ip>]
Feb  7 02:47:04 comu postfix/cleanup[25398]: C0A192C5816B: message-id=<20130207014704.C0A192C5816B@smtp.domain>
Feb  7 02:47:04 comu postfix/qmgr[25384]: C0A192C5816B: from=<postmaster@domain>, size=259, nrcpt=1 (queue active)
Feb  7 02:47:04 comu dovecot: lmtp(25400): Connect from local
Feb  7 02:47:04 comu dovecot: auth: mysql: Connected to 127.0.0.1 (postfix)
Feb  7 02:47:04 comu dovecot: lmtp(25400): Disconnect from local: Client quit
Feb  7 02:47:04 comu postfix/lmtp[25399]: C0A192C5816B: to=<postmaster@domain>, orig_to=<admin@domain>, relay=smtp.domain[private/dovecot-lmtp], delay=0.04, delays=0.01/0.01/0/0.02, dsn=2.1.5, status=deliverable (250 2.1.5 OK)
Feb  7 02:47:04 comu postfix/qmgr[25384]: C0A192C5816B: removed
Feb  7 02:47:07 comu postfix/smtpd[25393]: C6E932C5816B: client=unknown[<my ip>]
Feb  7 02:47:07 comu postfix/cleanup[25403]: C6E932C5816B: message-id=<201302070147.r171l1Ok020056@silverline.local>
Feb  7 02:47:07 comu postfix/qmgr[25384]: C6E932C5816B: from=<lhw@silverline.local>, size=697, nrcpt=1 (queue active)
Feb  7 02:47:07 comu postfix/smtpd[25393]: disconnect from unknown[<my ip>]
Feb  7 02:47:08 comu postfix/pipe[25404]: C6E932C5816B: to=<admin@domain>, relay=spamassassin, delay=3.5, delays=3.2/0.02/0/0.34, dsn=2.0.0, status=sent (delivered via spamassassin service)
Feb  7 02:47:08 comu postfix/pickup[25383]: 3F49C2C58395: uid=505 from=<lhw@silverline.local>
Feb  7 02:47:08 comu postfix/qmgr[25384]: C6E932C5816B: removed
Feb  7 02:47:08 comu postfix/cleanup[25403]: 3F49C2C58395: message-id=<201302070147.r171l1Ok020056@silverline.local>
Feb  7 02:47:08 comu postfix/qmgr[25384]: 3F49C2C58395: from=<lhw@silverline.local>, size=1340, nrcpt=1 (queue active)
Feb  7 02:47:08 comu dovecot: lmtp(25400): Connect from local
Feb  7 02:47:08 comu postfix/lmtp[25399]: 3F49C2C58395: to=<admin@domain>, relay=smtp.domain[private/dovecot-lmtp], delay=0.08, delays=0.06/0/0/0.01, dsn=5.1.1, status=bounced (host smtp.domain[private/dovecot-lmtp] said: 550 5.1.1 <admin@domain> User doesn't exist: admin@domain (in reply to RCPT TO command))
Feb  7 02:47:08 comu dovecot: lmtp(25400): Disconnect from local: Client quit
Feb  7 02:47:08 comu postfix/cleanup[25398]: 45B2F2C5816C: message-id=<20130207014708.45B2F2C5816C@smtp.domain>
Feb  7 02:47:08 comu postfix/qmgr[25384]: 45B2F2C5816C: from=<>, size=3192, nrcpt=1 (queue active)
Feb  7 02:47:08 comu postfix/bounce[25408]: 3F49C2C58395: sender non-delivery notification: 45B2F2C5816C
Feb  7 02:47:08 comu postfix/qmgr[25384]: 3F49C2C58395: removed
Feb  7 02:47:08 comu postfix/smtp[25390]: 45B2F2C5816C: to=<lhw@silverline.local>, relay=none, delay=0.13, delays=0.01/0/0.12/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=silverline.local type=AAAA: Host not found)
Feb  7 02:47:08 comu postfix/qmgr[25384]: 45B2F2C5816C: removed

When the E-Mail is first received the original recipient(postmaster@domain) is resolved to the actual recipient(admin@domain) and the existence of that user is checked with dovecot. Which is fine and returns a success. The E-Mail is then send through the content-filter which requeues the E-Mail with postfix via the local port. But instead of using the actual recipient it's now the original recipient again which of course is not found in the dovecot database.

This error did not occur with the original sendmail binary which probably was from the sendmail project. I tried various flags with the pipe in master.cf without any positive results. I would greatly appreciate your help.

share|improve this question

1 Answer 1

I think the problem is that normal cleanup daemon does not run after mail is injected back by your filter. pre-cleanup does not usually make address rewriting and virtual aliasing.

Check if you have -o cleanup_service_name=pre-cleanup on SMTP listener that receives filtered messages from the content filter (usually 10026:) and if so delete it.

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.