On 11/03/2011 17:09, Victor Duchovni wrote:
> On Fri, Mar 11, 2011 at 04:58:15PM +0100, Giovanni Mancuso wrote:
>
>> I have my postfix configured as MX record of my domain with particular
>> smtpd_recipents_restriction, ecc...
>> If my postfix receives a mail that has X-MyCustomHeader, Postfix accept
>> the mail and delivers it to backend.
>> If my Postfix receives a mail that hasn't X-MyCustomHeader, Postfix
>> checks if client ip is in a blacklist and reject the email if the ip is
>> in blacklist or accept the mail if it isn't in blacklist.
> Rejection of email can only happen before the mail is queued. Therefore,
> this can only be done with a proxy-filter or milter.
>
>     http://www.postfix.org/SMTPD_PROXY_README.html
>     http://www.postfix.org/MILTER_README.html
Another questions.
If i use a MILTER, and if i have smtpd_recipient_restrictions
configured, postfix uses this restriction? I did not understand this :-(

In your opinion, to do this is better MILTER or SMTPD_PROXY?

Do you know a simple milter (write in perl or python) that i can use as
example for develop my milter?

Thanks
> While client addresses can checked via built-in mechanisms in
> smtpd_end_of_data_restrictions, there is no built-in mechanism to make
> these checks dependent on the message headers. Adding such a feature
> would not be easy, the header checks are performed in the cleanup(8)
> server, while client address checks are performed in the smtpd(8)
> server, the data flow from smtpd(8) to cleanup(8) is essentially
> one-way...
>
>     http://www.postfix.org/OVERVIEW.html
>

Reply via email to