Slava Shklyar wrote:

I think when Procmail cannot chdir to /home/fetcher/Mail it tries to deliver a mail to the default distention
and if success, returns EX_OK to the Fetchmail, thus message is flushed.


Thank you! That's exactly the thing!

My conclusion: Use fetchmail with care. Or to be precise, use the -m option, which tells fetchmail exactly what MTA (Mail Transfer agent) you want (sendmail, qmail-inject, procmail etc.). Otherwise you can't be sure where your mail goes.

So, here's the problem: Suppose that you have an SMTP daemon live on your system. You run fecthmail, and all goes nicely -- the mail ends up where mail usually ends up for you. You're happy and think all is fine, and start using fetchmail on a regular basis.

One day you take the daemons off for some reason, and fetchmail goes on running. Suddenly it can't contact the local 25 port, so it goes for procmail. If you happened to have a .procmailrc, it will be obeyed. It may do things you didn't intend for fetched mails. If you didn't have any .procmailrc file, the mail will end up somewhere else (in /var/spool/mail it was on my computer). Procmail exits signalling that all is fine, and your message is deleted from the POP server.

If you're lucky, the mail ended up where you look for it anyhow. If not, it's somewhere in the disk, but not where you expect it to be, so effectively it's silently lost.

The solution is, as I said above, to tell fetchmail explicitly who takes the mail. Just to close this issue, I wrote a small Perl script which accepts all data, and exits on code 1. I used this to simulate an MTA that fails. And indeed, the message wasn't deleted from the POP server. See transcript below.

Summary: The fetchmail's mail delivery may be bullet-proof, but definitely not Herschale-proof.

Eli

[EMAIL PROTECTED] fetcher]$ cat ./myMDA
#!/usr/bin/perl
@A=<>;
exit(1);

[EMAIL PROTECTED] fetcher]$ fetchmail -v -m ./myMDA
fetchmail: 5.9.0 querying mail.netvision.net.il (protocol POP3) at Fri 06 Feb 2004 02:13:36 PM IST
fetchmail: POP3< +OK POP3 service
fetchmail: POP3> USER my_user_name
fetchmail: POP3< +OK password required for user my_user_name
fetchmail: POP3> PASS *
fetchmail: POP3< +OK Maildrop ready
fetchmail: POP3> STAT
fetchmail: POP3< +OK 1 1380
fetchmail: POP3> LAST
fetchmail: POP3< +OK 0
1 message for my_user_name at mail.netvision.net.il (1380 octets).
fetchmail: POP3> LIST
fetchmail: POP3< +OK scan listing follows
fetchmail: POP3< 1 1380
fetchmail: POP3< .
fetchmail: POP3> TOP 1 99999999
fetchmail: POP3< +OK
reading message 1 of 1 (1380 octets)
#*****fetchmail: MDA returned nonzero status 256
not flushed
fetchmail: POP3> QUIT
fetchmail: POP3< +OK
fetchmail: normal termination, status 0


--
Web: http://www.billauer.co.il



--------------------------------------------------------------------------
Haifa Linux Club Mailing List (http://www.haifux.org)
To unsub send an empty message to [EMAIL PROTECTED]




Reply via email to