On Wed, May 18, 2011 at 5:01 PM, Noel Jones <njo...@megan.vbhcs.org> wrote:
> On 5/18/2011 1:30 PM, Lima Union wrote:
>>
>> One last question regarding this, due that the amount of spam is huge
>> I'd like to catch some of these messages, how should I configure
>> Postfix in order to let this kind of messages (beginning with /^0-/ )
>> bypass all my checks (RBL,etc) and redirect them to my account to
>> review them? is this possible?
>> Thanks once again.
>
> You can do that, but you'll need to adjust your rules some. The general idea
> is you need to REDIRECT the mail and then whitelist it before subsequent
> rules reject it.  We'll use a restriction class because postfix can't
> normally do two actions on one match.  Something like:
>
> !Caution!
> http://www.postfix.org/SMTPD_ACCESS_README.html#danger
>
>
> # main.cf
> smtpd_restriction_classes =
>  REDIRECT_OK
>
> REDIRECT_OK =
>  check_sender_access
>     regexp:$config_directory/maps/redirect.regexp
>  permit
>
> # redirect.regexp
> /./  REDIRECT u...@example.com
>
>
> And in your sender.regexp, change the REJECT line to REDIRECT_OK
> # sender.regexp
> /^0-/  REDIRECT_OK
>
>
> And then you'll need to change your smtpd_recipient_restrictions to catch
> these before any other rules reject them.  Something like:
> smtpd_recipient_restrictions =
>        permit_mynetworks,
> # reject_unauth_destination should be your first "reject"
>        reject_unauth_destination,
> # move your sender.regexp here, before any other reject*
>        check_sender_access
> regexp:$config_directory/maps/smtpd_sender_checks.regexp,
> # other stuff...
>        reject_invalid_helo_hostname,
>        reject_non_fqdn_helo_hostname,
>        reject_non_fqdn_sender,
>        reject_non_fqdn_recipient,
>        check_client_access hash:$config_directory/maps/smtpd_client_checks,
>        check_helo_access hash:$config_directory/maps/smtpd_helo_checks,
>        check_sender_access hash:$config_directory/maps/smtpd_sender_checks,
>        check_sender_access
> regexp:$config_directory/maps/smtpd_sender_checks.regexp,
> ... other exiting stuff...
>
>
>

Noel, thank you very much for your explanation, I'll review and try it tomorrow.
LU.

Reply via email to