probleme mails en double Postfix+Mysql - réseaux et sécurité - Linux et OS Alternatifs
Marsh Posté le 30-01-2007 à 17:25:18
bonjour 
peux tu poster la sortie d'un postconf -n  et le log qui montre le probleme ? 
 
as tu amavisd ou tout autre content filter sur ton serveur ?
Marsh Posté le 30-01-2007 à 17:39:34
Voici le postconf -n
alias_database = hash etc/aliases
etc/aliases
alias_maps = hash etc/aliases
etc/aliases
append_dot_mydomain = yes
biff = no
config_directory = /etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
home_mailbox = Maildir/
inet_interfaces = all
mailbox_command =
mailbox_size_limit = 0
mydestination = serveur.toto.fr, localhost
mydomain = toto.fr
myhostname = serveur.toto.fr
mynetworks = 85.24.21.47/28, 127.0.0.0/8
myorigin = /etc/mailname
recipient_delimiter = +
relayhost =
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
virtual_alias_maps = mysql etc/postfix/mysql_virtual_alias_maps.cf
etc/postfix/mysql_virtual_alias_maps.cf
virtual_gid_maps = static:1001
virtual_mailbox_base = /var/mail/vhosts
virtual_mailbox_domains = mysql etc/postfix/mysql_virtual_domains_maps.cf
etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_maps = mysql etc/postfix/mysql_virtual_mailbox_maps.cf
etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 1001
virtual_transport = virtual
virtual_uid_maps = static:1001
En effet, j'utilise amavis.
le log:
Jan 30 17:21:33 brazil postfix/smtp[8974]: 87E10724141: to=<directeur@toto.org>, relay=127.0.0.1[127.0.0.1], delay=6, status=sent (250 2.6.0 Ok, id=08715-09, from MTA: 250 Ok: queued as ACC2272414A)
Jan 30 17:21:33 brazil postfix/smtp[8974]: 87E10724141: to=<personne@toto.org>, orig_to=<directeur@toto.org>, relay=127.0.0.1[127.0.0.1], delay=6, status=sent (250 2.6.0 Ok, id=08715-09, from MTA: 250 Ok: queued as ACC2272414A)
Jan 30 17:21:33 brazil postfix/virtual[8982]: ACC2272414A: to=<directeur@toto.org>, relay=virtual, delay=1, status=sent (delivered to maildir)
Jan 30 17:21:34 brazil postfix/virtual[8982]: ACC2272414A: to=<personne@toto.org>, orig_to=<directeur@toto.org>, relay=virtual, delay=2, status=sent (delivered to maildir)
Jan 30 17:21:34 brazil postfix/virtual[8982]: ACC2272414A: to=<personne@toto.org>, relay=virtual, delay=2, status=sent (deliv
Merci de ton aide
Marsh Posté le 30-01-2007 à 17:46:21
j'ai oublié de te demander ton master.cf 
 
mais je pense que c'est un probleme classique de virtual alias 
 
 
essaye d'ajouter dans le main.cf: 
 
receive_override_options = no_address_mappings 
 
 
ton master.cf doit avoir cette partie la: (notamment la ligne receive_override_options...) 
 
127.0.0.1:10025 inet n	-	y	-	-  smtpd 
    -o content_filter= 
    -o local_recipient_maps= 
    -o relay_recipient_maps= 
    -o smtpd_restriction_classes= 
    -o smtpd_client_restrictions= 
    -o smtpd_helo_restrictions= 
    -o smtpd_sender_restrictions= 
    -o smtpd_recipient_restrictions=permit_mynetworks,reject 
    -o smtpd_data_restrictions=reject_unauth_pipelining 
    -o smtpd_end_of_data_restrictions= 
    -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
Marsh Posté le 30-01-2007 à 17:58:04
master.cf 
 
smtp      inet  n       -       n       -       -       smtpd 
#submission inet n      -       -       -       -       smtpd 
#       -o smtpd_etrn_restrictions=reject 
#628      inet  n       -       -       -       -       qmqpd 
pickup    fifo  n       -       -       60      1       pickup 
cleanup   unix  n       -       n       -       0       cleanup 
qmgr      fifo  n       -       -       300     1       qmgr 
#qmgr     fifo  n       -       -       300     1       oqmgr 
rewrite   unix  -       -       n       -       -       trivial-rewrite 
bounce    unix  -       -       -       -       0       bounce 
defer     unix  -       -       -       -       0       bounce 
trace     unix  -       -       -       -       0       bounce 
verify    unix  -       -       -       -       1       verify 
flush     unix  n       -       -       1000?   0       flush 
proxymap  unix  -       -       n       -       -       proxymap 
smtp      unix  -       -       -       -       -       smtp 
relay     unix  -       -       -       -       -       smtp 
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5 
showq     unix  n       -       -       -       -       showq 
error     unix  -       -       -       -       -       error 
local     unix  -       n       n       -       -       local 
virtual   unix  -       n       n       -       -       virtual 
lmtp      unix  -       -       n       -       -       lmtp 
anvil     unix  -       -       n       -       1       anvil 
# 
# Interfaces to non-Postfix software. Be sure to examine the manual 
# pages of the non-Postfix software to find out what options it wants. 
# 
# maildrop. See the Postfix MAILDROP_README file for details. 
# 
maildrop  unix  -       n       n       -       -       pipe 
  flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient} 
uucp      unix  -       n       n       -       -       pipe 
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient) 
ifmail    unix  -       n       n       -       -       pipe 
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient) 
bsmtp     unix  -       n       n       -       -       pipe 
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -d -t$nexthop -f$sender $recipient 
scalemail-backend unix  -       n       n       -       2       pipe 
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension} 
 
# only used by postfix-tls 
#tlsmgr   fifo  -       -       n       300     1       tlsmgr 
#smtps    inet  n       -       n       -       -       smtpd -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes 
#587      inet  n       -       n       -       -       smtpd -o smtpd_enforce_tls=yes -o smtpd_sasl_auth_enable=yes 
 
 
smtp-amavis unix -      -       n     -       2  smtp 
        -o smtp_data_done_timeout=1200 
        -o smtp_send_xforward_command=yes 
        -o disable_dns_lookups=yes 
 
127.0.0.1:10025 inet  n       -       n       -       -       smtpd 
        -o content_filter= 
        -o local_recipient_maps= 
        -o relay_recipient_maps= 
        -o smtpd_restriction_classes= 
        -o smtpd_client_restrictions= 
        -o smtpd_helo_restrictions= 
        -o smtpd_sender_restrictions= 
        -o smtpd_recipient_restrictions=permit_mynetworks,reject 
        -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 
 
Marsh Posté le 30-01-2007 à 18:56:28
modifie ton master.cf en ajoutant cette ligne dans la partie de retour d'amavis (a la fin):  
-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks 
 
 
puis ajoute au main.cf 
 
receive_override_options = no_address_mappings  
 
 
puis postfix reload  
 
 
  
Marsh Posté le 30-01-2007 à 17:20:38
bonjour,
J'ai un système Sarge+Postfix+Mysql+Postfixadmin.(+Courier...)
Tout fonctionne bien sauf un truc.
J'ai une boite réelle (directeur@toto.com) qui devrait envoyer une copie à klk1@autre.com.
donc, dans ma table alias j'ai :
-------------------------------------------------------------------------------
| address | goto | domain |
-------------------------------------------------------------------------------
| directeur@toto.com | directeur@toto.com, klk1@autre.com | toto.com |
--------------------------------------------------------------------------------
Cette astuce de copie fonctionnait avec Exim3 (patché vmails). Cette syntaxe marche aussi avec un bête /etc/aliases
Or, avec ma (nouvelle) configuration, un mail est envoyé en double à klk1@autre.com. Je ne vois pas pourquoi.
Les 2 mails reçus par klk1@autre.com ont le même id, la même source, hormis le "X-Original-To:" qui prend successivement les valeurs "directeur@toto.com" et "klk1@autre.com".
Dans le mail.log, on voit bien que Postfix envoie 2 mails avec le même id à la même adresse finale (ici klk1@autre.com).
quant à "directeur@toto.com", il reçoit son mail normalement.
Je pensais que le(s) serveur(s) SMTP évitait lui-même les doublons.
On pourrait évoquer un problème de loop, mais ds ce cas pourquoi seuelement 2 mails et pas une infinité ? je n'ai pas trouvé de paramètre Postfix allant dans ce sens.
Merci d'avance pour votre aide et vos pistes.