On Sun, Nov 23, 2008 at 03:06:27AM -0600, Ville Walveranta wrote:

> The problem here is that the local server is also
> the final destination for the primary domain. When I do a redirect in
> virtual_alias_maps:
> 
> [EMAIL PROTECTED]        [EMAIL PROTECTED]
> 
> ..the mail gets delivered locally because the primarydomain.com is in
> virtual_mailbox_domains/virtual_mailbox_maps. I would like the mail to
> be delivered instead to the external filtering service's MX, where it
> would be filtered and, if clean, would eventually be delivered at the
> [EMAIL PROTECTED] at the local server.
> 
> Perhaps some transport map could resolve this? The problem is that I can't 
> use..
> 
> [EMAIL PROTECTED]       smtp:mx.externalspamfilteringservice.com
> 
> ..because that would result in a loop. Somehow I'd need to combine the
> entry in virtual_alias_maps and the transport map instruction to
> deliver the remapped email at the external SMTP server.
> 
> Can this be done?

Yes, you need to use a combination of "virtual" and ""generic" rewriting,
together with a transport override:

    virtual:
        [EMAIL PROTECTED]               [EMAIL PROTECTED]

    transport:
        efilter.invalid         smtp:example.net

    generic:
        @efilter.invalid        @example.com

    main.cf:
        virtual_alias_maps = hash:/etc/postfix/virtual
        transport_maps = hash:/etc/postfix/transport
        smtp_generic_maps = hash:/etc/postfix/generic
        # This domain is delivered here, perhaps via some other mechanism
        mydestination = example.com
        

This will deliver mail for [EMAIL PROTECTED] to [EMAIL PROTECTED] via an
external filter service whose MX records are listed at example.net.
The envelope recipient seen by exmaple.net will be [EMAIL PROTECTED],
but your logs will record a delivery to [EMAIL PROTECTED]

Adjust the domain names to taste, make sure the intermediate domain
used to route traffic to the external provider is never going to
be a valid DNS domain (the ".invalid" namespace is RFC reserved).

-- 
        Viktor.

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.

To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
<mailto:[EMAIL PROTECTED]>

If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.

Reply via email to