Carlos E. R. wrote:
Fetchmail couldn't know that this mail is to be handled as spam. You have to tell fetchmail, that the errorcode 550 from the mta is spam (See Option "antispam" and set it to "antispam 550"). And of course see the section in "man fetchmail".
Notice that the man page doesn't say that using the nobounce option implies not flushing the bounced mail. That behaviour is not documented. If I remove the nobounce option, then it is flushed, as it should be.
The --nobounce option suppresses the normal action of bouncing errors back to the sender in an RFC1894-confor mant error message. If nobounce is on, the message will go to the postmaster instead. ... set no bouncemail Direct error mail to postmaster rather than sender ... If fetchmail cannot match any mailserver usernames or localdomain addresses, the mail will be bounced. Normally it will be bounced to the sender, but if `nobounce' is on it will go to the postmaster (which in turn defaults to being the calling user).
Ok, a few lines from fetchmail's manpage: ... Return codes which fetchmail treats as antispam responses and discards the message can be set with the `antispam' option. This is one of the only three circumstance under which fetchmail ever discards mail (the others are the 552 and 553 errors described below, and the suppression of multidropped messages with a message-ID already seen). ... In short, only errors 552 and 553 without the antispam-option lets fetchmail delete the mail from the server. And of course double msg-ids. In your case the best choice will be "antispam 550" so the mail will be deleted directly from the server, and if you want to supress bounce-mails set "spambounce" to no. But maybe i had misunderstood you.
Which leaves me with another problem: how to tell postfix NOT to send emails comming from fetchmail-daemon,
Aparently this could be done with:
/^From:.*fetchmail-daemon\@nimrodel\.valinor HOLD
in the /etc/postfix/header_checks file. But it doesn't work.
Is HOLD really what you want? Turn on verbose logging in Postfix (master.cf) and view the logs. -- Andreas