cleanup, virtual_alias_maps, recipient_delimiter and recipient_canonical_maps

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

cleanup, virtual_alias_maps, recipient_delimiter and recipient_canonical_maps

Miolinux
hi,

i've installed a mail server with postfix and amavisd-new. I run it with
a double cleanup service, "cleanup" which transform all aliases into
real mailaddress and pass mail to amavisd-new, and a second
"post-cleanup" service which take the real mail-address and via a
virtual_alias_maps trasform it into mail-addresss and eventually a
forward-email-address.

All things works great, but i got a problem when amavisd-new tags the
message as spam, since it trasform the mail-address in user
+spam@mydomain.

The message get trough "post-cleanup" and expand into: user
+spam@mydomain,[hidden email].

I use the recipient delimiter to move spam messages into spam folder,
but i would like to send mail to externaldomain WITHOUT +spam.

I tried to play with a recipient_canonical_maps like this:
-------
if !/(.*)@mydomain/
        /^([^\+]+)\+[^@]+@(.*)$/ $1@$2
endif
-------
but it seems to be evaluated BEFORE virtual_alias_maps, so the tricks
doesn't work. I got no luck with propagate_unmatched_extensions also.

How can i solve the problem? Can i tell "post-cleanup" to do
recipient_canonical_maps after virtual_alias_map? can i tell a cleanup
service to pass mail to another cleanup service? (just to avoid another
smtpd istance)

Thanks
--
Miolinux

Reply | Threaded
Open this post in threaded view
|

Re: cleanup, virtual_alias_maps, recipient_delimiter and recipient_canonical_maps

Victor Duchovni
On Fri, Jun 13, 2008 at 12:48:56PM +0200, Miolinux wrote:

> hi,
>
> i've installed a mail server with postfix and amavisd-new. I run it with
> a double cleanup service, "cleanup" which transform all aliases into
> real mailaddress and pass mail to amavisd-new, and a second
> "post-cleanup" service which take the real mail-address and via a
> virtual_alias_maps trasform it into mail-addresss and eventually a
> forward-email-address.
>
> All things works great, but i got a problem when amavisd-new tags the
> message as spam, since it trasform the mail-address in user
> +spam@mydomain.
>
> The message get trough "post-cleanup" and expand into: user
> +spam@mydomain,[hidden email].

Your rewriting tables need to explicitly match "user+spam@mydomain":

        user@mydomain user@mydomain, [hidden email]
        user+spam@mydomain user+spam@mydomain, [hidden email]

Nothing else will likely work.

--
        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:[hidden email]?body=unsubscribe%20postfix-users>

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 | Threaded
Open this post in threaded view
|

Re: cleanup, virtual_alias_maps, recipient_delimiter and recipient_canonical_maps

Miolinux
On Fri, 2008-06-13 at 10:09 -0400, Victor Duchovni wrote:

> On Fri, Jun 13, 2008 at 12:48:56PM +0200, Miolinux wrote:
>
> > hi,
> >
> > i've installed a mail server with postfix and amavisd-new. I run it with
> > a double cleanup service, "cleanup" which transform all aliases into
> > real mailaddress and pass mail to amavisd-new, and a second
> > "post-cleanup" service which take the real mail-address and via a
> > virtual_alias_maps trasform it into mail-addresss and eventually a
> > forward-email-address.
> >
> > All things works great, but i got a problem when amavisd-new tags the
> > message as spam, since it trasform the mail-address in user
> > +spam@mydomain.
> >
> > The message get trough "post-cleanup" and expand into: user
> > +spam@mydomain,[hidden email].
>
> Your rewriting tables need to explicitly match "user+spam@mydomain":
>
> user@mydomain user@mydomain, [hidden email]
> user+spam@mydomain user+spam@mydomain, [hidden email]
>
> Nothing else will likely work.

my ´╗┐virtual_alias_maps is this:
-------------
server_host = xxx.xxx.xxx.xxx
server_port = 389
timeout = 10
version = 3
bind = yes
bind_dn = xxxxxxxxxxxxxxxxx
bind_pw = xxxxxxxxxxxxxxxxx
search_base = xxxxxxxxxxxxxxxxxxxxxxx
scope = sub
query_filter = (&(maildrop=%
s)(&(&(defaultdelivery=forward)(accountStatus=active))(objectClass=mailUser)))
result_attribute = mail,MailForwardingAddress
debuglevel = 0
-------------

users and forwards are in a ldap server in form:
------------
mail: user@mydomain
maildrop: user@mydomain
maildrop: alias@mydomain
MailForwardingAddress: [hidden email]
-------------

So i think cleanup service strip +spam, then search virtual_alias_maps
and re-attach +spam to results. (This because the default setting is:
propagate_unmatched_extensions = canonical, virtual
, if i change it to only canonical cleanup service does not re-attach
+spam to any address)

Example:
---
´╗┐propagate_unmatched_extensions = canonical, virtual
user+spam@mydomain -> user+spam@mydomain,[hidden email]
---
´╗┐propagate_unmatched_extensions = canonical
user+spam@mydomain -> user@mydomain,[hidden email]
---

Any other hints?

--
Miolinux

Reply | Threaded
Open this post in threaded view
|

Re: cleanup, virtual_alias_maps, recipient_delimiter and recipient_canonical_maps

mouss-2
In reply to this post by Miolinux
Miolinux wrote:

> hi,
>
> i've installed a mail server with postfix and amavisd-new. I run it with
> a double cleanup service, "cleanup" which transform all aliases into
> real mailaddress and pass mail to amavisd-new, and a second
> "post-cleanup" service which take the real mail-address and via a
> virtual_alias_maps trasform it into mail-addresss and eventually a
> forward-email-address.
>
> All things works great, but i got a problem when amavisd-new tags the
> message as spam, since it trasform the mail-address in user
> +spam@mydomain.
>
> The message get trough "post-cleanup" and expand into: user
> +spam@mydomain,[hidden email].
>
> I use the recipient delimiter to move spam messages into spam folder,
> but i would like to send mail to externaldomain WITHOUT +spam.
>
> I tried to play with a recipient_canonical_maps like this:
>  

use generic instead of canonical

/(.*)\+spam@example\.com$/         $[hidden email]




> -------
> if !/(.*)@mydomain/
> /^([^\+]+)\+[^@]+@(.*)$/ $1@$2
> endif
>  

are you participiting to a pcre context?

> -------
> but it seems to be evaluated BEFORE virtual_alias_maps, so the tricks
> doesn't work. I got no luck with propagate_unmatched_extensions also.
>
> How can i solve the problem? Can i tell "post-cleanup" to do
> recipient_canonical_maps after virtual_alias_map? can i tell a cleanup
> service to pass mail to another cleanup service? (just to avoid another
> smtpd istance)
>
> Thanks
> --
> Miolinux
>
>  

Reply | Threaded
Open this post in threaded view
|

Re: cleanup, virtual_alias_maps, recipient_delimiter and recipient_canonical_maps

Victor Duchovni
On Fri, Jun 13, 2008 at 07:31:22PM +0200, mouss wrote:

>
> use generic instead of canonical
>
> /(.*)\+spam@example\.com$/         $[hidden email]
>

This will break external addresses of this form, that are the result
of rewrites. The external domain is unlikely to be fixed for all users.
And why forward spam out, it is rather a bad idea.

--
        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:[hidden email]?body=unsubscribe%20postfix-users>

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.