Bug 79131 - procmail is not writing in mbox format
procmail is not writing in mbox format
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: procmail (Show other bugs)
8.0
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Martin Stransky
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-12-05 21:46 EST by nessus
Modified: 2007-04-18 12:48 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-01-05 11:04:15 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description nessus 2002-12-05 21:46:11 EST
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:
Comment 1 Michael Lee Yohe 2002-12-06 00:35:27 EST
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?
Comment 2 Jens Petersen 2002-12-06 01:11:28 EST
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 03:00:13 EST
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.
Comment 4 Jens Petersen 2004-01-06 22:43:48 EST
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-06 22:45:36 EST
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 11:04:15 EST
Fetchmail and procmail work in FC3 properly.

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