From Bugzilla Helper: User-Agent: Mozilla/5.0 Galeon/1.2.6 (X11; Linux i686; U;) Gecko/20020830 Description of problem: procmail is not writing to mail files in mbox format. I.e., it is not including the Unix "From" line. This is bad because it corrupts the mail file, and makes the file unreadable by the numerous mail agents that expect to see such file in mbox format. Version-Release number of selected component (if applicable): procmail-3.22-7 How reproducible: Always Steps to Reproduce: 1.Make a ".procmail" file that looks like so: :0: MyMail 2.Configure your mail system to feed your incoming mail into procmail. 3.Send yourself several pieces of email. 4.Run "mail -f ~/MyMail" to see that mail file is not correct. Actual Results: /bin/mail cannot recognize the email messages in "MyMail" because "MyMail" is not in the correct format. Expected Results: /bin/mail should be able to recognize the email messages. Additional info:
WORKSFORME I have no problem using 3.22-7 (included with Red Hat Linux 8.0). For instance: # 21oct00 *** Junk all email NOT to my direct identity (or carboned to) :0 *! ^(To|Cc).*(michael|mlyohe|myohe) $JUNKEMAIL Works without a hitch. Are you sure that the format of your procmail configuration file is correct?
Works for me too. Wonder what the problem is? Could you attach a sample test folder with a couple of test mails in it, please?
Okay, I've figured out precisely what is going on. I'm trying to use fetchmail with procmail as the mda. (I can't use sendmail as the mda because I'm using a masquerading sendmail config on our workstations that makes all outgoing mail seem as if it came from our mail hub, and sends all local mail to the mail hub. With such a config, if I use sendmail as the fetchmail mda, a mail loop results.) Unfortunately, when fetchmail feeds email to procmail, it does not see fit to feed procmail the Unix "From " line. And the when procmail accepts mail that is in such a state, procmail does not see fit to add the Unix "From " line before writing this mail to a mailbox file. This results in a corrupted mailbox. As it turns out, however, you can force procmail to write such a line by using the the "-f {fromwhom}" option, but this isn't quite right because then the date in the "From " line ends up being the time that fetchmail was run, and not the time that the mail was actually received. So, it seems to as if there are several bugs: (1) Fetchmail should have an option so that when it feeds an email to procmail, it includes the "From " line. (2) procmail should not corrupt a mailbox file just because it was fed an email message without a "From " line. It should always add one of some sort (even it it has to be "From no-one@nowhere") so that the mailbox file will at least still be a vaild mailbox file once procmail has had its way with it. (3) If nothing else, the documentation for fetchmail and procmail should mention this issue and tell how to best solve it.
First of all I think it should be possible to configure sendmail on your system in such a way as to avoid a mail loop for local delivery with fetchmail. What is the exact argument you're passing as the mda to fetchmail? [fetchmail.1 suggests "/usr/bin/procmail -d %T".] Isn't the "From " normally added by sendmail, when using it as the mda? And the right date is attached in this case? Regarding you suggestions: (1) I don't think that fetchmail knows what type the mda is, it just sends the message to it blindly I guess. (2) This is pretty much what the "-f -" option is for. This kind of change should be made upstream I believe. Ie try asking on the procmail list about it. (3) I am happy to accept a patch for this. Where do you think this should be documented?
Also could you please check this still occurs with the current release of RHL and/or Fedora Core?
Fetchmail and procmail work in FC3 properly.