I've created this simple_filter:
http://www.postfix.org/FILTER_README.html#simple_filter
This is email, being sent via sendmail command, after it has been filtered:
----------------------------------------------------------------------------
Received: from [192.168.0.3] (unknown [192.168.0.3])
(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
(No client certificate requested)
by khole.example1.com (Postfix) with ESMTPSA id 5EDEC11425
for <[email protected]>; Sun, 23 Aug 2009 18:15:02 +0200 (CEST)
Message-ID: <[email protected]>
Date: Sun, 23 Aug 2009 18:14:57 +0200
From: Root <[email protected]>
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
MIME-Version: 1.0
To: [email protected]
Subject: Is it in?
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
I think it should not be.
----------------------------------------------------------------------------
Filter is using this command:
/usr/local/sbin/sendmail -G -i -f [email protected] [email protected]
<msg-headers+body-from-above>
I have 2 problems
Above command, if used as a root user results in MODIFIED headers+body
msg-headers+body MUST be exactly same, after it pass through filter
and STAY that way, until it leaves my server.
As first 2 lines below shows, another Received: header, has been
added, as soon as it passes through sendmail
----------------------------------------------------------------------------
Received: by khole.example1.com (Postfix, from userid 1003)
id 1CCB111428; Mon, 23 Aug 2009 19:32:15 +0200 (CEST)
Received: from [192.168.0.3] (unknown [192.168.0.3])
(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
(No client certificate requested)
by khole.example1.com (Postfix) with ESMTPSA id 5EDEC11425
for <[email protected]>; Sun, 23 Aug 2009 18:15:02 +0200 (CEST)
Message-ID: <[email protected]>
Date: Sun, 23 Aug 2009 18:14:57 +0200
From: Root <[email protected]>
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
MIME-Version: 1.0
To: [email protected]
Subject: Is it in?
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
I think it should not be.
----------------------------------------------------------------------------
Second problem:
If msg-headers+body from begening of this post, is being sent as:
/usr/local/sbin/sendmail -G -i -f [email protected] [email protected]
<msg-headers+body>
AS user that is NOT root, which is filter user:
/etc/postfix/master.cf:
# =============================================================
# service type private unpriv chroot wakeup maxproc command
# (yes) (yes) (yes) (never) (100)
# =============================================================
filter unix - n n - 10 pipe
#flags=Rq
user=filter
null_sender=
argv=.....
Message is THIS:
from (unknown sender)
to (no subject)
----------------
Received: by khole.example1.com (Postfix, from userid 1003)
id 27A1711429; Mon, 23 Aug 2009 19:29:36 +0200 (CEST)
----------------
Everything is being stripped!!!
Thank in advance! ;)