Bug 79131 - procmail is not writing in mbox format
Summary: procmail is not writing in mbox format
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: procmail
Version: 8.0
Hardware: i686
OS: Linux
Target Milestone: ---
Assignee: Martin Stransky
QA Contact: Brock Organ
Depends On:
TreeView+ depends on / blocked
Reported: 2002-12-06 02:46 UTC by nessus
Modified: 2007-04-18 16:48 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2005-01-05 16:04:15 UTC

Attachments (Terms of Use)

Description nessus 2002-12-06 02:46:11 UTC
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):

How reproducible:

Steps to Reproduce:
1.Make a ".procmail" file that looks like so:
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:

Comment 1 Michael Lee Yohe 2002-12-06 05:35:27 UTC

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)
*! ^(To|Cc).*(michael|mlyohe|myohe)

Works without a hitch.  Are you sure that the format of your procmail
configuration file is correct?

Comment 2 Jens Petersen 2002-12-06 06:11:28 UTC
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?

Comment 3 nessus 2002-12-06 08:00:13 UTC
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

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.

Comment 4 Jens Petersen 2004-01-07 03:43:48 UTC
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?

Comment 5 Jens Petersen 2004-01-07 03:45:36 UTC
Also could you please check this still occurs with the current
release of RHL and/or Fedora Core?

Comment 6 Martin Stransky 2005-01-05 16:04:15 UTC
Fetchmail and procmail work in FC3 properly.

Note You need to log in before you can comment on or make changes to this bug.