On 8/21/2014 2:49 PM, Viktor Dukhovni wrote:
On Thu, Aug 21, 2014 at 02:22:46PM -0700, Darren Pilgrim wrote:

I want to rewrite the envelope recipient of a message if it's from a
specific sender, but have that rewrite change the envelope before reaching
permit_auth_destination (i.e., an immediate, before-queue rewrite).  I want
this so that I don't have to allow open relay from a given address just to
bypass relay restrictions that don't apply anyway because the mail will
ultimately redirect to an address within mydestinations.

The sender can't authenticate itself, so I'm a bit stuck.  Is the above
possible?

There's no need for this.

main.cf:
     indexed = ${default_database_type}:${config_directory}/

     smtpd_restrictions_classes = redirect_sender

     redirect_sender =
        check_sender_access ${indexed}sender-redirect

     smtpd_recipient_restrictions =
        permit_mynetworks,
        permit_sasl_authenticated,
        check_sender_access ${indexed}redirected-senders,
        reject_unauth_destination,
        ...

sender-redirect:
     j...@example.com   moe@local.example

redirected-senders:
     j...@example.com   redirect_sender, permit

Just make sure that new senders are added to sender-redirect before
redirected-senders, and removed after.

That's exactly the hack I was hoping to avoid. I guess Postfix can't do before-queue envelope rewriting?


Reply via email to