procmail
[Top] [All Lists]

Re: mail separation - From and Content-Length

1997-08-29 10:54:23
"Gjermund S\xF8rseth" <gjermund(_at_)nextel(_dot_)no> writes:
I'd very much like to use procmail as my local-delivery agent.

Wise choice.


The problem is the way procmail appends new messages to the mailbox. Any
...
<moaning about Berkeley mbox format deleted>


 "Allways compute and insert a Content-Length header, discard or rewrite
  any content-length headers that were allready present"

I'm looking into sendmail now to se if I can make it allways insert 
"Content-Length: 0000000" since procmail without the -Y option actually
does rewrite this header inserting the correct length without messing up
the message body with ">"'s.

This is probably the best way to do it: use the header rewriting tool
(sendmail) to generate the needed header, and let procmail do its job
without having to modify the message length.  Assuming you have a
relatively recent sendmail, the following sendmail.cf line should do
the trick:

        # Condition the addition of the line on the presence of the '5'
        # flag, which should only be on the local mailer.
        H?5?Content-Length: 000000000


Or maybe I can use the formail program to add this header and then pipe
the message into procmail.

That would be less efficient.  Sendmail has already ripped the header up,
so it's not going to slow it down noticibly more to add another line.


But procmail should really be able to do this by itself!

Why add quite a bit of complexity to procmail when there's already an
efficient way to do it?

Philip Guenther

<Prev in Thread] Current Thread [Next in Thread>