amavisd & Postfix alias: duplicate mails

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

amavisd & Postfix alias: duplicate mails

Zhang Huangbin
Hi, all.

I found an non-expect effect while I use alias in Postfix.

I have two accounts and one alias:
  - User: [hidden email]
  - User: [hidden email]
  - Alias: [hidden email] -> [hidden email], [hidden email]

I sent mail to both '[hidden email]' and '[hidden email]', then user 'www@' will receive
duplicate mails.

How can i make user 'www@' receive only one copy?

I already have 'receive_override_options = no_address_mappings' in Postfix
main.cf.

--------------- output of postconf -n -------------
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
allow_min_user = no
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
local_recipient_maps = $alias_maps $virtual_alias_maps $virtual_mailbox_maps
mail_owner = postfix
mailbox_command = /usr/libexec/dovecot/deliver
mailbox_size_limit = 15728640
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
maximal_backoff_time = 4000s
message_size_limit = 15728640
mydestination = $myhostname, localhost, localhost.localdomain,
localhost.$myhostname, mysql:/etc/postfix/mysql_virtual_domains.cf
mydomain = rh523.bibby.org
myhostname = rh523.bibby.org
mynetworks = 127.0.0.0/8
myorigin = rh523.bibby.org
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
receive_override_options = no_address_mappings
recipient_bcc_maps =
mysql:/etc/postfix/mysql_recipient_bcc_maps_domain.cf,
mysql:/etc/postfix/mysql_recipient_bcc_maps_user.cf
relay_domains = $mydestination
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sender_bcc_maps = mysql:/etc/postfix/mysql_sender_bcc_maps_domain.cf,
mysql:/etc/postfix/mysql_sender_bcc_maps_user.cf
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_enforce_tls = no
smtpd_recipient_restrictions = permit_mynetworks,
reject_unauth_pipelining, reject_unknown_recipient_domain,
reject_invalid_hostname, reject_unlisted_recipient,
reject_non_fqdn_sender, reject_non_fqdn_recipient,
reject_unauth_destination, check_policy_service unix:private/policy-spf,
check_policy_service inet:127.0.0.1:10031, permit_sasl_authenticated
smtpd_reject_unlisted_sender = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_login_maps = mysql:/etc/postfix/mysql_virtual_sender_maps.cf
smtpd_sender_restrictions = reject_authenticated_sender_login_mismatch,
reject_sender_login_mismatch,
reject_unauthenticated_sender_login_mismatch, permit_sasl_authenticated,
permit_mynetworks
smtpd_tls_cert_file = /etc/postfix/certs/postfixCert.pem
smtpd_tls_key_file = /etc/postfix/certs/postfixKey.pem
smtpd_tls_loglevel = 0
smtpd_tls_security_level = may
tls_random_source = dev:/dev/urandom
transport_maps = mysql:/etc/postfix/mysql_transport_maps.cf
unknown_local_recipient_reject_code = 550
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_gid_maps = static:2000
virtual_mailbox_base = /home/vmail
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 2000
virtual_transport = dovecot
virtual_uid_maps = static:2000
-------------------------------------------------------

Amavisd entries in Postfix master.cf:
-------------------------------------------------------
smtp-amavis unix -  -   -   -   2  smtp
    -o smtp_data_done_timeout=1200
    -o smtp_send_xforward_command=yes
    -o disable_dns_lookups=yes
    -o max_use=20

127.0.0.1:10025 inet n  -   -   -   -  smtpd
    -o content_filter=
    -o local_recipient_maps=
    -o relay_recipient_maps=
    -o smtpd_restriction_classes=
    -o smtpd_delay_reject=no
    -o smtpd_client_restrictions=permit_mynetworks,reject
    -o smtpd_helo_restrictions=
    -o smtpd_sender_restrictions=
    -o smtpd_recipient_restrictions=permit_mynetworks,reject
    -o mynetworks_style=host
    -o mynetworks=127.0.0.0/8
    -o strict_rfc821_envelopes=yes
    -o smtpd_error_sleep_time=0
    -o smtpd_soft_error_limit=1001
    -o smtpd_hard_error_limit=1000
    -o smtpd_client_connection_count_limit=0
    -o smtpd_client_connection_rate_limit=0
    -o
receive_override_options=no_header_body_checks,no_unknown_recipient_checks
-------------------------------------------------------

--
Best Regards.

Zhang Huangbin

- Mail Server Solution for Red Hat(R) Enterprise Linux & CentOS 5.x:
  http://rhms.googlecode.com/


Reply | Threaded
Open this post in threaded view
|

Re: amavisd & Postfix alias: duplicate mails

Anders-19
Zhang Huangbin wrote:

> I already have 'receive_override_options = no_address_mappings' in Postfix
> main.cf.

I believe that this is the relevant FAQ entry:

  http://www.postfix.org/faq.html#duplicate


Anders.


Reply | Threaded
Open this post in threaded view
|

Re: amavisd & Postfix alias: duplicate mails

Victor Duchovni
On Wed, Jun 04, 2008 at 03:33:41PM +0200, Anders wrote:

> Zhang Huangbin wrote:
>
> > I already have 'receive_override_options = no_address_mappings' in Postfix
> > main.cf.
>
> I believe that this is the relevant FAQ entry:
>
>   http://www.postfix.org/faq.html#duplicate

Note, the legacy FAQ is no longer maintained. Also relevant may be:

        http://www.postfix.org/postconf.5.html#enable_original_recipient

of couse the legacy information is often still applicable, so in this case
the local(8) delivery agent continues to deliver to 1 alias at a time, and
overlapping local aliases will indeed lead to multiple deliveries. This
cannot be avoided without migrating aliases(5) used simply to expand
address lists to other addresses to virtual(5) where duplicate elimination
is available (see "enable_original_recipient").

--
        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
|

Bounced: Name or service not known

S-22
Up to now I have setup a few accounts which all correctly receive mail,
however sending does not work.
Although it's not exactly what I want, if I enable my local (external)
IP in mynetworks=xxx.xxx.xxx.xxx for testing purposes, this is what logs
produce:

to=<...@versatel.nl>, relay=none, delay=1, status=bounced
([versatel.nl]: Name or service not known)

Anyway, I want to be able to use a mail client from any IP address and
to send mails to anywhere, without enabling open relay, of course.
How to do it?

My postconf:

#################################################################
alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
broken_sasl_auth_clients = yes
canonical_maps = hash:/etc/postfix/canonical
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 4
default_privs = nobody
home_mailbox = Maildir/
inet_interfaces = all
local_transport = local
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, $mydomain,
mail.$mydomain
mydomain = netshosting.com
myhostname = netshosting.com
mynetworks = [x.x.x.x (hidden obviously)]
mynetworks_style = host
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.0.18/README_FILES
relay_domains = $mydomain, $virtual_mailbox_domains
sample_directory = /usr/share/doc/postfix-2.0.18/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtpd_recipient_restrictions = permit_sasl_authenticated,
permit_mynetworks, check_relay_domains
smtpd_sasl_local_domain = $mydomain
smtpd_sasl_security_options = noanonymous
soft_bounce = no
unknown_local_recipient_reject_code = 550
virtual_alias_maps = hash:/etc/postfix/virtual
virtual_gid_maps = static:1000
virtual_mailbox_base = /var/mail/vhosts
virtual_mailbox_domains = example1.com example2.com example3.org
 example4.net
virtual_mailbox_maps = hash:/etc/postfix/vmailbox
virtual_minimum_uid = 100
virtual_uid_maps = hash:/etc/postfix/virtual_uids
###########################################################################


#sasl_passwd:
example1.com info:pass
###########################################################################

Postmap made alle db OK, all services restarted (postfix, saslauthd).

Reply | Threaded
Open this post in threaded view
|

Re: Bounced: Name or service not known

Brian Evans - Postfix List
S wrote:

> Up to now I have setup a few accounts which all correctly receive mail,
> however sending does not work.
> Although it's not exactly what I want, if I enable my local (external)
> IP in mynetworks=xxx.xxx.xxx.xxx for testing purposes, this is what logs
> produce:
>
> to=<...@versatel.nl>, relay=none, delay=1, status=bounced
> ([versatel.nl]: Name or service not known)
>
> Anyway, I want to be able to use a mail client from any IP address and
> to send mails to anywhere, without enabling open relay, of course.
> How to do it?
>
> My postconf:
>
> #################################################################
> alias_database = hash:/etc/postfix/aliases
> alias_maps = hash:/etc/postfix/aliases
> broken_sasl_auth_clients = yes
> canonical_maps = hash:/etc/postfix/canonical
> command_directory = /usr/sbin
> config_directory = /etc/postfix
> daemon_directory = /usr/libexec/postfix
> debug_peer_level = 4
> default_privs = nobody
> home_mailbox = Maildir/
> inet_interfaces = all
>  
default
> local_transport = local
> mail_owner = postfix
>  
default
> mailq_path = /usr/bin/mailq.postfix
> manpage_directory = /usr/share/man
> mydestination = $myhostname, localhost.$mydomain, $mydomain,
> mail.$mydomain
> mydomain = netshosting.com
> myhostname = netshosting.com
> mynetworks = [x.x.x.x (hidden obviously)]
> mynetworks_style = host
>  
This setting is useless since you specify mynetworks.

> newaliases_path = /usr/bin/newaliases.postfix
> queue_directory = /var/spool/postfix
> readme_directory = /usr/share/doc/postfix-2.0.18/README_FILES
> relay_domains = $mydomain, $virtual_mailbox_domains
> sample_directory = /usr/share/doc/postfix-2.0.18/samples
> sendmail_path = /usr/sbin/sendmail.postfix
> setgid_group = postdrop
> smtp_sasl_auth_enable = yes
> smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
> smtpd_recipient_restrictions = permit_sasl_authenticated,
> permit_mynetworks, check_relay_domains
>  
check_relay_domains doesn't seem to be documented in postconf(5)
You will be an open relay if you omit reject_unauth_destination here!

> smtpd_sasl_local_domain = $mydomain
> smtpd_sasl_security_options = noanonymous
> soft_bounce = no
> unknown_local_recipient_reject_code = 550
> virtual_alias_maps = hash:/etc/postfix/virtual
> virtual_gid_maps = static:1000
> virtual_mailbox_base = /var/mail/vhosts
> virtual_mailbox_domains = example1.com example2.com example3.org
>  example4.net
> virtual_mailbox_maps = hash:/etc/postfix/vmailbox
> virtual_minimum_uid = 100
> virtual_uid_maps = hash:/etc/postfix/virtual_uids
> ###########################################################################
>
>
> #sasl_passwd:
> example1.com info:pass
>  
Your verifying a password when sending to your own domain?!?
> ###########################################################################
>
> Postmap made alle db OK, all services restarted (postfix, saslauthd).
>
>  
See http://www.postfix.org/DEBUG_README.html#mail and grab saslfinger to
assist you.

Brian
Reply | Threaded
Open this post in threaded view
|

Re: Bounced: Name or service not known

Brian Evans - Postfix List
Brian Evans wrote:
> S wrote:
>> Up to now I have setup a few accounts which all correctly receive mail,
>> however sending does not work.
>> Although it's not exactly what I want, if I enable my local (external)
>> IP in mynetworks=xxx.xxx.xxx.xxx for testing purposes, this is what logs
>> produce:
This should not be a public interface.
If you are behind a NAT firewall, use proxy_interfaces
>>
>> to=<...@versatel.nl>, relay=none, delay=1, status=bounced
>> ([versatel.nl]: Name or service not known)
Don't truncate log entries. Show an entire transaction to help us.
>>
>> Anyway, I want to be able to use a mail client from any IP address and
>> to send mails to anywhere, without enabling open relay, of course.
>> How to do it?
If clients are in your local network, permit_mynetworks allows sending.
If clients are non-local, authenticate with SASL on smtpd then use
permit_sasl_authenticated

>>
>> My postconf:
>>
>> #################################################################
>> alias_database = hash:/etc/postfix/aliases
>> alias_maps = hash:/etc/postfix/aliases
>> broken_sasl_auth_clients = yes
>> canonical_maps = hash:/etc/postfix/canonical
>> command_directory = /usr/sbin
>> config_directory = /etc/postfix
>> daemon_directory = /usr/libexec/postfix
>> debug_peer_level = 4
>> default_privs = nobody
>> home_mailbox = Maildir/
>> inet_interfaces = all
>>  
> default
>> local_transport = local
>> mail_owner = postfix
>>  
> default
>> mailq_path = /usr/bin/mailq.postfix
>> manpage_directory = /usr/share/man
>> mydestination = $myhostname, localhost.$mydomain, $mydomain,
>> mail.$mydomain
>> mydomain = netshosting.com
>> myhostname = netshosting.com
>> mynetworks = [x.x.x.x (hidden obviously)]
>> mynetworks_style = host
>>  
> This setting is useless since you specify mynetworks.
>> newaliases_path = /usr/bin/newaliases.postfix
>> queue_directory = /var/spool/postfix
>> readme_directory = /usr/share/doc/postfix-2.0.18/README_FILES
>> relay_domains = $mydomain, $virtual_mailbox_domains
>> sample_directory = /usr/share/doc/postfix-2.0.18/samples
>> sendmail_path = /usr/sbin/sendmail.postfix
>> setgid_group = postdrop
>> smtp_sasl_auth_enable = yes
>> smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
>> smtpd_recipient_restrictions = permit_sasl_authenticated,
>> permit_mynetworks, check_relay_domains
>>  
> check_relay_domains doesn't seem to be documented in postconf(5)
> You will be an open relay if you omit reject_unauth_destination here!
>> smtpd_sasl_local_domain = $mydomain
>> smtpd_sasl_security_options = noanonymous
>> soft_bounce = no
>> unknown_local_recipient_reject_code = 550
>> virtual_alias_maps = hash:/etc/postfix/virtual
>> virtual_gid_maps = static:1000
>> virtual_mailbox_base = /var/mail/vhosts
>> virtual_mailbox_domains = example1.com example2.com example3.org
>>  example4.net
>> virtual_mailbox_maps = hash:/etc/postfix/vmailbox
>> virtual_minimum_uid = 100
>> virtual_uid_maps = hash:/etc/postfix/virtual_uids
>> ###########################################################################
>>
>>
>>
>> #sasl_passwd:
>> example1.com info:pass
>>  
> Your verifying a password when sending to your own domain?!?
>> ###########################################################################
>>
>>
>> Postmap made alle db OK, all services restarted (postfix, saslauthd).
>>
>>  
> See http://www.postfix.org/DEBUG_README.html#mail and grab saslfinger
> to assist you.
>
> Brian
Reply | Threaded
Open this post in threaded view
|

Re: Bounced: Name or service not known

mouss-2
In reply to this post by S-22
S wrote:
> Up to now I have setup a few accounts which all correctly receive mail,
> however sending does not work.
>  

Please do not hijack threads. compose a new message instead of replying
to an unrelated one.
    http://en.wikipedia.org/wiki/Thread_hijacking

> Although it's not exactly what I want, if I enable my local (external)
> IP in mynetworks=xxx.xxx.xxx.xxx for testing purposes, this is what logs
> produce:
>
> to=<...@versatel.nl>, relay=none, delay=1, status=bounced
> ([versatel.nl]: Name or service not known)
>  

Please do not truncate log lines. post FULL log lines.

Anyway, apparently, postfix cannot find versatel.nl. This is a DNS
issue. you need to fix it. you may need to disable chrooting in postfix.
chrooting is for "advanced" users who can fix the resulting problems.

> Anyway, I want to be able to use a mail client from any IP address and
> to send mails to anywhere, without enabling open relay, of course.
> How to do it?
>  


then you need to setup "server side" SASL. see
       http://www.postfix.org/SASL_README.html#server_sasl

> [snip]
> #sasl_passwd:
> example1.com info:pass
>  


use
[example.com]      info:pass

Note that this is for "client side" SASL, and not for authenticating
users who connect to your postfix.


Reply | Threaded
Open this post in threaded view
|

Re: amavisd & Postfix alias: duplicate mails

Zhang Huangbin
In reply to this post by Victor Duchovni
Victor Duchovni wrote:

>> Zhang Huangbin wrote:
>>
>>    
>>> I already have 'receive_override_options = no_address_mappings' in Postfix
>>> main.cf.
>>>      
>> I believe that this is the relevant FAQ entry:
>>
>>   http://www.postfix.org/faq.html#duplicate
>>    
>
> Note, the legacy FAQ is no longer maintained. Also relevant may be:
>
> http://www.postfix.org/postconf.5.html#enable_original_recipient
>
> of couse the legacy information is often still applicable, so in this case
> the local(8) delivery agent continues to deliver to 1 alias at a time, and
> overlapping local aliases will indeed lead to multiple deliveries. This
> cannot be avoided without migrating aliases(5) used simply to expand
> address lists to other addresses to virtual(5) where duplicate elimination
> is available (see "enable_original_recipient").
>
>  
Thanks Anders & Victor.

But it didn't work while 'enable_original_recipient' was set to either
'yes' or 'no'. It will receive duplicate msgs too.

Am i missing something?
Or is there something wrong with my postfix configuration?


--
Best Regards.

Zhang Huangbin

- Mail Server Solution for Red Hat(R) Enterprise Linux & CentOS 5.x:
  http://rhms.googlecode.com/

Reply | Threaded
Open this post in threaded view
|

Re: Bounced: Name or service not known

S-22
In reply to this post by mouss-2

On Wed, 2008-06-04 at 16:50 +0200, mouss wrote:

> Please do not hijack threads. compose a new message instead of replying
> to an unrelated one.
>     http://en.wikipedia.org/wiki/Thread_hijacking
>

This was a new thread. It could be however that I "replied" and changed
subject line. My apologizes if it caused some hijacking.


>Anyway, apparently, postfix cannot find versatel.nl. This is a DNS
> issue. you need to fix it. you may need to disable chrooting in postfix.
> chrooting is for "advanced" users who can fix the resulting problems.
>

Thanks for that. Fixed in resolv.conf.



On Wed, 2008-06-04 at 10:30 -0400, Brian Evans wrote:
>check_relay_domains doesn't seem to be documented in postconf(5)
> You will be an open relay if you omit reject_unauth_destination here!

Ok I changed that.


>> IP in mynetworks=xxx.xxx.xxx.xxx for testing purposes
> This should not be a public interface.
> If you are behind a NAT firewall, use proxy_interfaces
>

I connect from another network and it works OK in this way. Otherwise I
get "Recipient address rejected: Relay access denied;".

It works now, but only from my (allowed) address, but I need access from anywhere, sending to everywhere, using authentication.

> If clients are in your local network, permit_mynetworks allows sending.
> If clients are non-local, authenticate with SASL on smtpd then use
> permit_sasl_authenticated
> >>

I thought I already did it. Obviously I miss the SASL working.
I'll check the links you guys provided.

Thanks for all the replies.




Reply | Threaded
Open this post in threaded view
|

Re: Bounced: Name or service not known

mouss-2
S wrote:

> On Wed, 2008-06-04 at 16:50 +0200, mouss wrote:
>
>  
>> Please do not hijack threads. compose a new message instead of replying
>> to an unrelated one.
>>     http://en.wikipedia.org/wiki/Thread_hijacking
>>
>>    
>
> This was a new thread. It could be however that I "replied" and changed
> subject line. My apologizes if it caused some hijacking.
>  

changing the subject is not enough. your mail contains:

        In-Reply-To: <[hidden email]>
        References: <[hidden email]>
         <54722.bFoQE3daRhY=.[hidden email]>
         <[hidden email]>


which link to the previous messages. you'll quickly see this if using a
"threaded view" (which I do).

you need to compose a new message (use "new message" or "compose" or
whatever button in your mailer), not "reply" to another one.

>
>  
>> Anyway, apparently, postfix cannot find versatel.nl. This is a DNS
>> issue. you need to fix it. you may need to disable chrooting in postfix.
>> chrooting is for "advanced" users who can fix the resulting problems.
>>
>>    
>
> Thanks for that. Fixed in resolv.conf.
>  

good. happy postfixing...


Reply | Threaded
Open this post in threaded view
|

Re: amavisd & Postfix alias: duplicate mails

mouss-2
In reply to this post by Zhang Huangbin
Zhang Huangbin wrote:

> Victor Duchovni wrote:
>>> Zhang Huangbin wrote:
>>>
>>>    
>>>> I already have 'receive_override_options = no_address_mappings' in
>>>> Postfix
>>>> main.cf.
>>>>      
>>> I believe that this is the relevant FAQ entry:
>>>
>>>   http://www.postfix.org/faq.html#duplicate
>>>    
>>
>> Note, the legacy FAQ is no longer maintained. Also relevant may be:
>>
>>     http://www.postfix.org/postconf.5.html#enable_original_recipient
>>
>> of couse the legacy information is often still applicable, so in this
>> case
>> the local(8) delivery agent continues to deliver to 1 alias at a
>> time, and
>> overlapping local aliases will indeed lead to multiple deliveries. This
>> cannot be avoided without migrating aliases(5) used simply to expand
>> address lists to other addresses to virtual(5) where duplicate
>> elimination
>> is available (see "enable_original_recipient").
>>
>>  
> Thanks Anders & Victor.
>
> But it didn't work while 'enable_original_recipient' was set to either
> 'yes' or 'no'. It will receive duplicate msgs too.

are you using virtual_alias_maps or alias_maps? As Viktor said, local
aliases (alias_maps) will lead to multiple deliveries.

>
> Am i missing something?
> Or is there something wrong with my postfix configuration?
>
>

Reply | Threaded
Open this post in threaded view
|

Re: amavisd & Postfix alias: duplicate mails

Zhang Huangbin
mouss wrote:

> Zhang Huangbin wrote:
>> Victor Duchovni wrote:
>>>> Zhang Huangbin wrote:
>>>>
>>>>  
>>>>> I already have 'receive_override_options = no_address_mappings' in
>>>>> Postfix
>>>>> main.cf.
>>>>>      
>>>> I believe that this is the relevant FAQ entry:
>>>>
>>>>   http://www.postfix.org/faq.html#duplicate
>>>>    
>>>
>>> Note, the legacy FAQ is no longer maintained. Also relevant may be:
>>>
>>>     http://www.postfix.org/postconf.5.html#enable_original_recipient
>>>
>>> of couse the legacy information is often still applicable, so in
>>> this case
>>> the local(8) delivery agent continues to deliver to 1 alias at a
>>> time, and
>>> overlapping local aliases will indeed lead to multiple deliveries. This
>>> cannot be avoided without migrating aliases(5) used simply to expand
>>> address lists to other addresses to virtual(5) where duplicate
>>> elimination
>>> is available (see "enable_original_recipient").
>>>
>>>  
>> Thanks Anders & Victor.
>>
>> But it didn't work while 'enable_original_recipient' was set to either
>> 'yes' or 'no'. It will receive duplicate msgs too.
>
> are you using virtual_alias_maps or alias_maps? As Viktor said, local
> aliases (alias_maps) will lead to multiple deliveries.

Hi, Mouss.

I use virtual_alias_maps with mysql backend. How can i solve this issue?

Thanks very much.


--
Best Regards.

Zhang Huangbin

- Mail Server Solution for Red Hat(R) Enterprise Linux & CentOS 5.x:
  http://rhms.googlecode.com/

Reply | Threaded
Open this post in threaded view
|

Re: amavisd & Postfix alias: duplicate mails

Victor Duchovni
On Thu, Jun 05, 2008 at 09:10:30AM +0800, Zhang Huangbin wrote:

> >>Thanks Anders & Victor.
> >>
> >>But it didn't work while 'enable_original_recipient' was set to either
> >>'yes' or 'no'. It will receive duplicate msgs too.
> >
> >are you using virtual_alias_maps or alias_maps? As Viktor said, local
> >aliases (alias_maps) will lead to multiple deliveries.
>
> Hi, Mouss.
>
> I use virtual_alias_maps with mysql backend. How can i solve this issue?

Describe the issue in terms of facts ("postconf -n", full logs showing
the multiple deliveries and how the mail entered and left Postfix). Mere
anecdotes of "multiple deliveries" are too vague to enable anyone to
help you.

With virtual_alias_maps, a sufficiently recent Postfix release, no
dual rewriting before and after a filter, and enable_original_recipient=no
Postfix will generally not make double deliveries when a message addressed
to multiple virtual aliases that overlap is delivered (subject to the
duplicate_filter_limit).

--
        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: amavisd & Postfix alias: duplicate mails

Zhang Huangbin
In reply to this post by Zhang Huangbin
Thanks for all response.

Viktor wrote:
 > Describe the issue in terms of facts ("postconf -n", full logs showing
 > the multiple deliveries and how the mail entered and left Postfix). Mere
 > anecdotes of "multiple deliveries" are too vague to enable anyone to
 > help you.

Hi, Viktor.

I use Postfix-2.3.3 on Red Hat(R) Enterprise Linux 5.2(i386 & x86_64).

Mail Server components:

- Postfix-2.3.3(SMTP)
- MySQL-5.0.45 (Virtual domains/users)
- Dovecot-1.0.13 (POP3(s)/IMAP(s))
- Amavisd-new-(2.5.4/2.6.0) (content-filter)
  + SpamAssassin
  + ClamAV
- Roundcubemail-0.1.1 (WebMail)

I have two accounts and one alias:
- User: [hidden email]
- User: [hidden email]
- Alias: [hidden email] -> www@, postmaster@

Logged in webmail, sent mail to both 'www@'(user) and 'all@'(alias),
user 'www@' will receive duplicate msgs.

Output of 'postconf -n':
-----------8<-----------------
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
allow_min_user = no
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
enable_original_recipient = yes
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
local_recipient_maps = $alias_maps $virtual_alias_maps $virtual_mailbox_maps
mail_owner = postfix
mailbox_command = /usr/libexec/dovecot/deliver
mailbox_size_limit = 15728640
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
maximal_backoff_time = 4000s
message_size_limit = 15728640
mydestination = $myhostname, localhost, localhost.localdomain,
localhost.$myhostname, mysql:/etc/postfix/mysql_virtual_domains.cf
mydomain = rh523.bibby.org
myhostname = rh523.bibby.org
mynetworks = 127.0.0.0/8
myorigin = rh523.bibby.org
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
receive_override_options = no_address_mappings
recipient_bcc_maps =
mysql:/etc/postfix/mysql_recipient_bcc_maps_domain.cf,
mysql:/etc/postfix/mysql_recipient_bcc_maps_user.cf
relay_domains = $mydestination
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sender_bcc_maps = mysql:/etc/postfix/mysql_sender_bcc_maps_domain.cf,
mysql:/etc/postfix/mysql_sender_bcc_maps_user.cf
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_enforce_tls = no
smtpd_recipient_restrictions = permit_mynetworks,
reject_unauth_pipelining, reject_unknown_recipient_domain,
reject_invalid_hostname, reject_unlisted_recipient,
reject_non_fqdn_sender, reject_non_fqdn_recipient,
reject_unauth_destination,    check_policy_service
unix:private/policy-spf,    check_policy_service inet:127.0.0.1:10031,
permit_sasl_authenticated
smtpd_reject_unlisted_sender = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_login_maps = mysql:/etc/postfix/mysql_virtual_sender_maps.cf
smtpd_sender_restrictions = reject_authenticated_sender_login_mismatch,
reject_sender_login_mismatch,
reject_unauthenticated_sender_login_mismatch, permit_sasl_authenticated,
permit_mynetworks
smtpd_tls_cert_file = /etc/postfix/certs/postfixCert.pem
smtpd_tls_key_file = /etc/postfix/certs/postfixKey.pem
smtpd_tls_loglevel = 0
smtpd_tls_security_level = may
tls_random_source = dev:/dev/urandom
transport_maps = mysql:/etc/postfix/mysql_transport_maps.cf
unknown_local_recipient_reject_code = 550
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_gid_maps = static:2000
virtual_mailbox_base = /home/vmail
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 2000
virtual_transport = dovecot
virtual_uid_maps = static:2000
-----------8<-----------------

mail log:
-----------8<-----------------
Jun  5 19:33:01 rh523 postfix/smtpd[2146]: connect from
localhost.localdomain[127.0.0.1]
Jun  5 23:33:01 rh523 postfix/smtpd[2146]: 9DD29B0616:
client=localhost.localdomain[127.0.0.1], sasl_method=LOGIN,
sasl_username=[hidden email]
Jun  5 19:33:01 rh523 postfix/cleanup[2147]: 9DD29B0616:
message-id=<dd0e83061b562a3a98fff950675ea7ff@127.0.0.1>
Jun  5 19:33:01 rh523 postfix/qmgr[2086]: 9DD29B0616: from=<[hidden email]>,
size=473, nrcpt=2 (queue active)
Jun  5 23:33:01 rh523 postfix/smtpd[2146]: disconnect from
localhost.localdomain[127.0.0.1]
Jun  5 19:33:06 rh523 postfix/smtpd[2156]: connect from
localhost.localdomain[127.0.0.1]
Jun  5 23:33:06 rh523 postfix/smtpd[2156]: C3690B0617:
client=localhost.localdomain[127.0.0.1]
Jun  5 19:33:06 rh523 postfix/cleanup[2147]: C3690B0617:
message-id=<dd0e83061b562a3a98fff950675ea7ff@127.0.0.1>
Jun  5 19:33:06 rh523 postfix/qmgr[2086]: C3690B0617: from=<[hidden email]>,
size=866, nrcpt=3 (queue active)
Jun  5 19:33:06 rh523 postfix/smtp[2149]: 9DD29B0616: to=<[hidden email]>,
relay=127.0.0.1[127.0.0.1]:10024, delay=5.2, delays=0.07/0.01/0.01/5.1,
dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as C3690B0617)
Jun  5 23:33:06 rh523 postfix/smtp[2149]: 9DD29B0616: to=<[hidden email]>,
relay=127.0.0.1[127.0.0.1]:10024, delay=5.2, delays=0.07/0.01/0.01/5.1,
dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as C3690B0617)
Jun  5 19:33:06 rh523 postfix/qmgr[2086]: 9DD29B0616: removed
Jun  5 19:33:06 rh523 postfix/pipe[2163]: C3690B0617: to=<[hidden email]>,
orig_to=<[hidden email]>, relay=dovecot, delay=0.17, delays=0.04/0.06/0/0.07,
dsn=2.0.0, status=sent (delivered via dovecot service)
Jun  5 19:33:06 rh523 postfix/pipe[2162]: C3690B0617:
to=<[hidden email]>, orig_to=<[hidden email]>, relay=dovecot, delay=0.17,
delays=0.04/0.04/0/0.1, dsn=2.0.0, status=sent (delivered via dovecot
service)
Jun  5 19:33:07 rh523 postfix/pipe[2165]: C3690B0617: to=<[hidden email]>,
relay=dovecot, delay=0.32, delays=0.04/0.07/0/0.22, dsn=2.0.0,
status=sent (delivered via dovecot service)
Jun  5 19:33:07 rh523 postfix/qmgr[2086]: C3690B0617: removed
-----------8<-----------------


Thanks very much.

--
Best Regards.

Zhang Huangbin

- Mail Server Solution for Red Hat(R) Enterprise Linux & CentOS 5.x:
  http://rhms.googlecode.com/

Reply | Threaded
Open this post in threaded view
|

Re: amavisd & Postfix alias: duplicate mails

Victor Duchovni
On Thu, Jun 05, 2008 at 07:35:27PM +0800, Zhang Huangbin wrote:

> Thanks for all response.
>
> Viktor wrote:
> > Describe the issue in terms of facts ("postconf -n", full logs showing
> > the multiple deliveries and how the mail entered and left Postfix). Mere
> > anecdotes of "multiple deliveries" are too vague to enable anyone to
> > help you.
>
> Hi, Viktor.
>
> I use Postfix-2.3.3 on Red Hat(R) Enterprise Linux 5.2(i386 & x86_64).

In this (2.3.3) release "DSN" support disabled "enable_original_recipient",
upgrade to the latest 2.3, 2.4 or 2.5 release.

--
        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: amavisd & Postfix alias: duplicate mails

Zhang Huangbin
Victor Duchovni wrote:

> On Thu, Jun 05, 2008 at 07:35:27PM +0800, Zhang Huangbin wrote:
>
>  
>> Thanks for all response.
>>
>> Viktor wrote:
>>    
>>> Describe the issue in terms of facts ("postconf -n", full logs showing
>>> the multiple deliveries and how the mail entered and left Postfix). Mere
>>> anecdotes of "multiple deliveries" are too vague to enable anyone to
>>> help you.
>>>      
>> Hi, Viktor.
>>
>> I use Postfix-2.3.3 on Red Hat(R) Enterprise Linux 5.2(i386 & x86_64).
>>    
>
> In this (2.3.3) release "DSN" support disabled "enable_original_recipient",
> upgrade to the latest 2.3, 2.4 or 2.5 release.
>  

OK, i will try to upgrade to the lastest 2.3.x version.

Thanks very much. :)


--
Best Regards.

Zhang Huangbin

- Mail Server Solution for Red Hat(R) Enterprise Linux & CentOS 5.x:
  http://rhms.googlecode.com/

Reply | Threaded
Open this post in threaded view
|

Re: amavisd & Postfix alias: duplicate mails

Victor Duchovni
On Thu, Jun 05, 2008 at 09:01:22PM +0800, Zhang Huangbin wrote:

> >In this (2.3.3) release "DSN" support disabled "enable_original_recipient",
> >upgrade to the latest 2.3, 2.4 or 2.5 release.
> >  
>
> OK, i will try to upgrade to the lastest 2.3.x version.
>
> Thanks very much. :)

This following appears in the 2.3.10 HISTORY file:

    20070520

        Bugfix (problem introduced Postfix 2.3): when DSN support
        was introduced it broke "agressive" recipient duplicate
        elimination with "enable_original_recipient = no".  File:
        cleanup/cleanup_out_recipient.c.

you should upgrade to 2.3.14.

--
        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: amavisd & Postfix alias: duplicate mails

Zhang Huangbin
Victor Duchovni wrote:

> This following appears in the 2.3.10 HISTORY file:
>     20070520
>
> Bugfix (problem introduced Postfix 2.3): when DSN support
> was introduced it broke "agressive" recipient duplicate
> elimination with "enable_original_recipient = no".  File:
> cleanup/cleanup_out_recipient.c.
>
> you should upgrade to 2.3.14.
>  
Hi, Victor.

I saw this bugfix in 2.3.x ChangeLog file moment ago. Thanks for your
help. :)

I'm rebuilding RPM.

--
Best Regards.

Zhang Huangbin

- Mail Server Solution for Red Hat(R) Enterprise Linux & CentOS 5.x:
  http://rhms.googlecode.com/

Reply | Threaded
Open this post in threaded view
|

Re: amavisd & Postfix alias: duplicate mails

Zhang Huangbin
In reply to this post by Victor Duchovni
Victor Duchovni wrote:

> This following appears in the 2.3.10 HISTORY file:
>     20070520
>
> Bugfix (problem introduced Postfix 2.3): when DSN support
> was introduced it broke "agressive" recipient duplicate
> elimination with "enable_original_recipient = no".  File:
> cleanup/cleanup_out_recipient.c.
>
> you should upgrade to 2.3.14.
>  
Hi, Victor.

I upgraded to postfix-2.3.14, and set 'enable_original_recipient = no',
it works.

Thanks very much. ^_^

--
Best Regards.

Zhang Huangbin

- Mail Server Solution for Red Hat(R) Enterprise Linux & CentOS 5.x:
  http://rhms.googlecode.com/