Discussion:
[SLE] Fetchmail: do not use "no bouncemail"
Carlos E. R.
2003-09-06 14:15:57 UTC
Permalink
Hi,

I put "set no spambounce" in my "fetchmailrc" file, in order to avoid
bouncing mails each time I rejected a mail because it contained a .pif
file (as comented in another thread). That worked, the bounce is directed
instead to the local postmaster (ie, me), but it has an unforeseen side
effect: that the rejected mail itself is not flushed from the server:

Sep 6 11:19:35 nimrodel fetchmail[4044]: SMTP>. (EOM)
Sep 6 11:19:36 nimrodel fetchmail[4044]: SMTP< 550 Error: "*** DOS/WIN executables rejected ***"
Sep 6 11:19:36 nimrodel fetchmail[4044]: SMTP error: 550 Error: "*** DOS/WIN executables rejected ***"
...
Sep 6 11:19:36 nimrodel fetchmail[4044]: SMTP> QUIT
Sep 6 11:19:36 nimrodel fetchmail[4044]: SMTP< 221 Bye
Sep 6 11:19:36 nimrodel fetchmail[4044]: SMTP> RSET
Sep 6 11:19:36 nimrodel fetchmail[4044]: SMTP< 250 Ok
Sep 6 11:19:36 nimrodel fetchmail[4044]: not flushed <-----
Sep 6 11:19:36 nimrodel fetchmail[4044]: POP3> RETR 10
Sep 6 11:19:37 nimrodel fetchmail[4044]: POP3< +OK 101580 bytes


If I remove the "set no spambounce" line I have:


Sep 5 19:14:13 nimrodel fetchmail[3932]: SMTP< 550 Error: "*** DOS/WIN executables rejected ***"
Sep 5 19:14:13 nimrodel fetchmail[3932]: SMTP error: 550 Error: "*** DOS/WIN executables rejected ***"
...
Sep 5 19:14:13 nimrodel fetchmail[3932]: SMTP>. (EOM)
Sep 5 19:14:13 nimrodel fetchmail[3932]: SMTP< 250 Ok: queued as D408A29F3A
Sep 5 19:14:13 nimrodel fetchmail[3932]: SMTP> QUIT
Sep 5 19:14:13 nimrodel fetchmail[3932]: SMTP< 221 Bye
Sep 5 19:14:13 nimrodel fetchmail[3932]: SMTP listener refused delivery
Sep 5 19:14:13 nimrodel fetchmail[3932]: SMTP> RSET
Sep 5 19:14:13 nimrodel fetchmail[3932]: SMTP< 250 Ok
Sep 5 19:14:13 nimrodel fetchmail[3932]: flushed
Sep 5 19:14:13 nimrodel fetchmail[3932]: POP3> DELE 17 <------
Sep 5 19:14:14 nimrodel fetchmail[3932]: POP3< +OK message marked for deletion
Sep 5 19:14:14 nimrodel fetchmail[3932]: POP3> RETR 18
Sep 5 19:14:14 nimrodel fetchmail[3932]: POP3< +OK 100351 bytes


So I have to accept that fetchmail tries to send it's bouncemail. If not,
it will leave rejected mail in the POP server, undeleted, and fetched and
rejected again every cicle (I have "fetchall" activated for other reasons)
o or left unremoved for ever; that lead me to think I was getting 50 of
those per hour :-(

Which leaves me with another problem: how to tell postfix NOT to send
emails comming from fetchmail-daemon, because as I don't have a real
domain they get rejected at the other end, of course. And they are
useless, those people did not send those email with .pif files.
--
Cheers,
Carlos Robinson
--
Check the headers for your unsubscription address
For additional commands send e-mail to suse-linux-e-***@suse.com
Also check the archives at http://lists.suse.com
Please read the FAQs: suse-linux-e-***@suse.com
Andreas Winkelmann
2003-09-07 18:41:09 UTC
Permalink
Post by Carlos E. R.
I put "set no spambounce" in my "fetchmailrc" file, in order to avoid
bouncing mails each time I rejected a mail because it contained a .pif
file (as comented in another thread). That worked, the bounce is directed
instead to the local postmaster (ie, me), but it has an unforeseen side
Sep 6 11:19:35 nimrodel fetchmail[4044]: SMTP>. (EOM)
Sep 6 11:19:36 nimrodel fetchmail[4044]: SMTP< 550 Error: "*** DOS/WIN executables rejected ***"
Sep 6 11:19:36 nimrodel fetchmail[4044]: SMTP error: 550 Error: "*** DOS/WIN executables rejected ***"
...
Sep 6 11:19:36 nimrodel fetchmail[4044]: SMTP> QUIT
Sep 6 11:19:36 nimrodel fetchmail[4044]: SMTP< 221 Bye
Sep 6 11:19:36 nimrodel fetchmail[4044]: SMTP> RSET
Sep 6 11:19:36 nimrodel fetchmail[4044]: SMTP< 250 Ok
Sep 6 11:19:36 nimrodel fetchmail[4044]: not flushed <-----
Sep 6 11:19:36 nimrodel fetchmail[4044]: POP3> RETR 10
Sep 6 11:19:37 nimrodel fetchmail[4044]: POP3< +OK 101580 bytes
Sep 5 19:14:13 nimrodel fetchmail[3932]: SMTP< 550 Error: "*** DOS/WIN executables rejected ***"
Sep 5 19:14:13 nimrodel fetchmail[3932]: SMTP error: 550 Error: "*** DOS/WIN executables rejected ***"
...
Sep 5 19:14:13 nimrodel fetchmail[3932]: SMTP>. (EOM)
Sep 5 19:14:13 nimrodel fetchmail[3932]: SMTP< 250 Ok: queued as D408A29F3A
Sep 5 19:14:13 nimrodel fetchmail[3932]: SMTP> QUIT
Sep 5 19:14:13 nimrodel fetchmail[3932]: SMTP< 221 Bye
Sep 5 19:14:13 nimrodel fetchmail[3932]: SMTP listener refused delivery
Sep 5 19:14:13 nimrodel fetchmail[3932]: SMTP> RSET
Sep 5 19:14:13 nimrodel fetchmail[3932]: SMTP< 250 Ok
Sep 5 19:14:13 nimrodel fetchmail[3932]: flushed
Sep 5 19:14:13 nimrodel fetchmail[3932]: POP3> DELE 17 <------
Sep 5 19:14:14 nimrodel fetchmail[3932]: POP3< +OK message marked for deletion
Sep 5 19:14:14 nimrodel fetchmail[3932]: POP3> RETR 18
Sep 5 19:14:14 nimrodel fetchmail[3932]: POP3< +OK 100351 bytes
So I have to accept that fetchmail tries to send it's bouncemail. If not,
it will leave rejected mail in the POP server, undeleted, and fetched and
rejected again every cicle (I have "fetchall" activated for other reasons)
o or left unremoved for ever; that lead me to think I was getting 50 of
those per hour :-(
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".
Post by Carlos E. R.
Which leaves me with another problem: how to tell postfix NOT to send
emails comming from fetchmail-daemon, because as I don't have a real
domain they get rejected at the other end, of course. And they are
useless, those people did not send those email with .pif files.
--
Andreas
--
Check the headers for your unsubscription address
For additional commands send e-mail to suse-linux-e-***@suse.com
Also check the archives at http://lists.suse.com
Please read the FAQs: suse-linux-e-***@suse.com
Carlos E. R.
2003-09-07 23:46:23 UTC
Permalink
Post by Andreas Winkelmann
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).
Post by Andreas Winkelmann
Post by Carlos E. R.
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.
--
Cheers,
Carlos Robinson
--
Check the headers for your unsubscription address
For additional commands send e-mail to suse-linux-e-***@suse.com
Also check the archives at http://lists.suse.com
Please read the FAQs: suse-linux-e-***@suse.com
Andreas Winkelmann
2003-09-08 13:23:06 UTC
Permalink
Post by Carlos E. R.
Post by Andreas Winkelmann
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.
Post by Carlos E. R.
Post by Andreas Winkelmann
Post by Carlos E. R.
Which leaves me with another problem: how to tell postfix NOT to send
emails comming from fetchmail-daemon,
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
--
Check the headers for your unsubscription address
For additional commands send e-mail to suse-linux-e-***@suse.com
Also check the archives at http://lists.suse.com
Please read the FAQs: suse-linux-e-***@suse.com
Carlos E. R.
2003-09-08 14:56:43 UTC
Permalink
Post by Andreas Winkelmann
...
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.
Notice that the 550 response also causes mail to be deleted from the
server (verified by experiment); in theory, it has ben downloaded and
bounced back, so it can be deleted. That works.

What it happens is that if I set the nobounce option, the bounce mail goes
instead to me (good), but it also means that the original mail is not
deleted from the server.

What I'm saying is that the behaviour of deleting or not deleting changes
if I use the nobouncemail option, and that is not documented.
Post by Andreas Winkelmann
But maybe i had misunderstood you.
I could treat it as spam - which it is, in this case - but it could be a
legitimate mail containing an atachement which I reject automatically. I
don't think that treating all rejects as spam is correct.
Post by Andreas Winkelmann
Post by Carlos E. R.
Post by Carlos E. R.
Which leaves me with another problem: how to tell postfix NOT to send
emails comming from fetchmail-daemon,
There was a missing "/" at the end (valinor/). It is working now.
Post by Andreas Winkelmann
Post by Carlos E. R.
in the /etc/postfix/header_checks file. But it doesn't work.
Is HOLD really what you want?
Not really. I want it redirected for manual inspection and deletion. I'm
thinking of using "reject", which probably would send them back to the
user "fetchmail-daemon", which is the postmaster... I will try that right
away [...] No, it is worse:

Sep 8 16:50:46 nimrodel postfix/cleanup[8423]: DBF2ACAF86: reject: header
From: FETCHMAIL-***@nimrodel.valinor from localhost[127.0.0.1];
from=<FETCHMAIL-***@nimrodel.valinor> to=<***@idsa.fr> proto=ESMTP
helo=<localhost>: Message content rejected
Sep 8 16:50:47 nimrodel amavis[8416]: Rejected by MTA: 550 End data with
<CR><LF>.<CR><LF> Error: Message content rejected
Post by Andreas Winkelmann
Turn on verbose logging in Postfix (master.cf) and view the logs.
It is an idea...
--
Cheers,
Carlos Robinson
--
Check the headers for your unsubscription address
For additional commands send e-mail to suse-linux-e-***@suse.com
Also check the archives at http://lists.suse.com
Please read the FAQs: suse-linux-e-***@suse.com
Andreas Winkelmann
2003-09-08 18:24:31 UTC
Permalink
Post by Carlos E. R.
Post by Andreas Winkelmann
...
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.
Notice that the 550 response also causes mail to be deleted from the
server (verified by experiment); in theory, it has ben downloaded and
bounced back, so it can be deleted. That works.
What it happens is that if I set the nobounce option, the bounce mail goes
instead to me (good), but it also means that the original mail is not
deleted from the server.
What I'm saying is that the behaviour of deleting or not deleting changes
if I use the nobouncemail option, and that is not documented.
Yeah, you're right, i found it in the source.

...
/* handle SMTP errors based on the content of SMTP_response */
/* return of PS_REFUSED deletes mail from the server; PS_TRANSIENT keeps
it */
...
return(run.bouncemail ? PS_REFUSED : PS_TRANSIENT);
...

This means if run.bouncemail is true, the function returns PS_REFUSED.
If run.bouncemail is false return with PS_TRANSIENT.
Post by Carlos E. R.
Post by Andreas Winkelmann
But maybe i had misunderstood you.
I could treat it as spam - which it is, in this case - but it could be a
legitimate mail containing an atachement which I reject automatically. I
don't think that treating all rejects as spam is correct.
I don't know if it is only undocumented or is a bug. Maybe you want to
change it and recompile fetchmail.
Post by Carlos E. R.
Post by Andreas Winkelmann
Post by Carlos E. R.
Post by Carlos E. R.
Which leaves me with another problem: how to tell postfix NOT to send
emails comming from fetchmail-daemon,
There was a missing "/" at the end (valinor/). It is working now.
Post by Andreas Winkelmann
Post by Carlos E. R.
in the /etc/postfix/header_checks file. But it doesn't work.
Is HOLD really what you want?
Not really. I want it redirected for manual inspection and deletion. I'm
thinking of using "reject", which probably would send them back to the
user "fetchmail-daemon", which is the postmaster... I will try that right
Sep 8 16:50:46 nimrodel postfix/cleanup[8423]: DBF2ACAF86: reject: header
helo=<localhost>: Message content rejected
Sep 8 16:50:47 nimrodel amavis[8416]: Rejected by MTA: 550 End data with
<CR><LF>.<CR><LF> Error: Message content rejected
REDIRECT is supported in an actual snapshot from Postfix, not in a
release. And of course not in the suse-postfix.
--
Andreas
--
Check the headers for your unsubscription address
For additional commands send e-mail to suse-linux-e-***@suse.com
Also check the archives at http://lists.suse.com
Please read the FAQs: suse-linux-e-***@suse.com
Carlos E. R.
2003-09-08 22:33:42 UTC
Permalink
Post by Andreas Winkelmann
Post by Carlos E. R.
I could treat it as spam - which it is, in this case - but it could be a
legitimate mail containing an atachement which I reject automatically. I
don't think that treating all rejects as spam is correct.
I don't know if it is only undocumented or is a bug. Maybe you want to
change it and recompile fetchmail.
Mmm... it is an idea, it would solve my problem... I'll only have to
remember when I update the system one day :-)
Post by Andreas Winkelmann
Post by Carlos E. R.
Sep 8 16:50:47 nimrodel amavis[8416]: Rejected by MTA: 550 End data with
<CR><LF>.<CR><LF> Error: Message content rejected
REDIRECT is supported in an actual snapshot from Postfix, not in a
release. And of course not in the suse-postfix.
Argh. Pity.

Then I'll have to touch fetchmail.
--
Cheers,
Carlos Robinson
--
Check the headers for your unsubscription address
For additional commands send e-mail to suse-linux-e-***@suse.com
Also check the archives at http://lists.suse.com
Please read the FAQs: suse-linux-e-***@suse.com
Loading...