Christian Ludwig:
> Hello,
>
> I want to process all mails through a script. Therefore I have set up a
> pipe transport in master.cf, which looks like
>
> |dfix unix - n n - - pipe
> | flags=q user=user argv=fix-disclaimer.pl -f ${sender} ${recipient}
> |[...]
> |:smtp inet n - n - 10 smtpd
> | -o content_filter=dfix:dummy
>
> The mail I receive on STDIN in the script has the following headers
>
> |Received: by mailserver.somewhere.com (Postfix, from userid 5000)
> |.id 1EFB8D0077; Thu, 12 Mar 2009 15:43:49 +0100 (CET)
> |[... More Received: lines ...]
> |Content-Type: multipart/alternative;
> !Message-Id: <[email protected]>
> !Date: Thu, 12 Mar 2009 15:43:49 +0100 (CET)
> !From: [email protected] (T/bone)
> !To: undisclosed-recipients:;
> !
> |boundary="----_=_NextPart_001_01C9A2F0.A8C3BC75"
> |Subject: Another test
> |Date: Thu, 12 Mar 2009 09:58:07 +0100
> |Message-ID: <[email protected]>
> |From: Somebody <[email protected]>
> |To: <[email protected]>
> |[...]
>
> Looks like postfix added five lines of additional headers between
> "Content-Type" and "boundary". And yes, the last added line is an empty
> one. The rest of the mail is OK. My script deletes these lines now, but
> when I reinject the mail using "/usr/sbin/sendmail -G -i $@" I get these
> lines at exactly that location again on the next hop.
>
> Does anybody know how I can configure the pipe transport and the
> sendmail command to not add these headers?
Your original message looks like this:
> |Content-Type: multipart/alternative;
> |boundary="----_=_NextPart_001_01C9A2F0.A8C3BC75"
> |Subject: Another test
> |Date: Thu, 12 Mar 2009 09:58:07 +0100
> |Message-ID: <[email protected]>
> |From: Somebody <[email protected]>
> |To: <[email protected]>
This is not a correctly formed message header. In particular,
the Content-Type: header is broken.
See RFC 5322 for creating multi-line message headers. Don't
write mail software without reading basic standards, please.
Wietse