Loading ...
Sorry, an error occurred while loading the content.
 

smtpd_data_restrictions - catching aliases with regexp?

Expand Messages
  • Regan Yelcich
    I have postfix setup using virtual domains which call a remote mysql server. I m also using PostfixAdmin to administer the virtual domains on the remote mysql
    Message 1 of 2 , Oct 1, 2013
      I have postfix setup using virtual domains which call a remote mysql server.
      I'm also using PostfixAdmin to administer the virtual domains on the remote mysql server.
      In postfixadmin I have setup a real mailbox for devnull@...
      I have also setup aliases - mailer@... - for the devnull@... mailbox.
      I would like MX server to DISCARD any mail sent to devnull@... before it attempts to deliver it via LMTP to my remote mail store.
      Mail is being DISCARDed fine when email is addressed directly to devnull@...
      But when the mail is sent to the alias - mailer@... - and includes orig_to (see below) the mail is not being DISCARDed.
      Can anyone tell me the correct way to do this?
      The regex below is "supposed" to catch ANY email accepted by this MX server addressed to any valid mailbox - devnull@validdomain
      Thanks!


      # cat /etc/postfix/devnull-discard
      /^devnull@.*$/ DISCARD

      # main.cf
      smtpd_data_restrictions = check_recipient_access regexp:/etc/postfix/devnull-discard, reject_unauth_pipelining, reject_multi_recipient_bounce, permit

      Any mail sent to - devnull@... - is successfully discarded:

      Oct 1 20:50:26 mta-0 postfix/smtpd[27903]: DEB4FC096: discard: DATA from mail-pd0-f173.google.com[209.85.192.173]: <devnull@...>: Recipient address triggers DISCARD action; from=<example@...> to=<devnull@...> proto=ESMTP helo=<mail-pd0-f173.google.com>

      But any email message that has had its address modified as an alias is not caught:

      Oct 1 20:50:35 mta-0 postfix/lmtp[27909]: F3CDDC096: to=<devnull@...>, orig_to=<mailer@...>, relay=X.X.X.X[X.X.X.X]:2424, delay=1.1, delays=0.69/0.01/0.04/0.33, dsn=2.6.0, status=sent (250 2.6.0 <devnull@...> Message accepted for delivery)
    • Ansgar Wiechers
      ... Remove the aliases pointing to . Problem solved. Regards Ansgar Wiechers -- Abstractions save us time working, but they don t save us
      Message 2 of 2 , Oct 1, 2013
        On 2013-10-01 Regan Yelcich wrote:
        > I would like MX server to DISCARD any mail sent to devnull@...
        > before it attempts to deliver it via LMTP to my remote mail store.
        > Mail is being DISCARDed fine when email is addressed directly to
        > devnull@... But when the mail is sent to the alias -
        > mailer@... - and includes orig_to (see below) the mail is not
        > being DISCARDed. Can anyone tell me the correct way to do this?

        Remove the aliases pointing to <devnull@...>. Problem solved.

        Regards
        Ansgar Wiechers
        --
        "Abstractions save us time working, but they don't save us time learning."
        --Joel Spolsky
      Your message has been successfully submitted and would be delivered to recipients shortly.