Bonjour,

je me tourne vers vous car, je ne trouve pas d'info sur mon problème

Mon backup se fait via un script externe appelé via pipe

Le script et bien appelé, mais il l'est deux fois !

donc j'ai 2 backups de mails à la place de un dans le meme répertoire

2 backup c'est mieux qu'un seul ok mais ça écrit et ça gonfle aussi 2 fois plus ^^'

voila mon master.cf :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#
# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       -       -       -       smtpd
     -o content_filter=smtp-amavis:[127.0.0.1]:10024
#smtp      inet  n       -       n       -       1       postscreen
#smtpd     pass  -       -       n       -       -       smtpd
#dnsblog   unix  -       -       n       -       0       dnsblog
#tlsproxy  unix  -       -       n       -       0       tlsproxy
#submission inet n       -       n       -       -       smtpd
#  -o syslog_name=postfix/submission
#  -o smtpd_tls_security_level=encrypt
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#smtps     inet  n       -       n       -       -       smtpd
#  -o syslog_name=postfix/smtps
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#628       inet  n       -       n       -       -       qmqpd
pickup    fifo  n       -       n       60      1       pickup
cleanup   unix  n       -       n       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
#qmgr     fifo  n       -       n       300     1       oqmgr
tlsmgr    unix  -       -       n       1000?   1       tlsmgr
rewrite   unix  -       -       n       -       -       trivial-rewrite
bounce    unix  -       -       n       -       0       bounce
defer     unix  -       -       n       -       0       bounce
trace     unix  -       -       n       -       0       bounce
verify    unix  -       -       n       -       1       verify
flush     unix  n       -       n       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       n       -       -       smtp
relay     unix  -       -       n       -       -       smtp
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       n       -       -       showq
error     unix  -       -       n       -       -       error
retry     unix  -       -       n       -       -       error
discard   unix  -       -       n       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       n       -       -       lmtp
anvil     unix  -       -       n       -       1       anvil
scache    unix  -       -       n       -       1       scache
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
#maildrop  unix  -       n       n       -       -       pipe
#  flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
#
# ====================================================================
#
# Recent Cyrus versions can use the existing "lmtp" master.cf entry.
#
# Specify in cyrus.conf:
#   lmtp    cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
#
# Specify in main.cf one or more of the following:
#  mailbox_transport = lmtp:inet:localhost
#  virtual_transport = lmtp:inet:localhost
#
# ====================================================================
#
# Cyrus 2.1.5 (Amos Gouaux)
# Also specify in main.cf: cyrus_destination_recipient_limit=1
#
#cyrus     unix  -       n       n       -       -       pipe
#  user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}
#
# ====================================================================
#
# Old example of delivery via Cyrus.
#
#old-cyrus unix  -       n       n       -       -       pipe
#  flags=R user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -m ${extension} ${user}
#
# ====================================================================
#
# See the Postfix UUCP_README file for configuration details.
#
#uucp      unix  -       n       n       -       -       pipe
#  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# ====================================================================
#
# Other external delivery methods.
#
#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/local/sbin/bsmtp -f $sender $nexthop $recipient
#
#scalemail-backend unix -       n       n       -       2       pipe
#  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store
#  ${nexthop} ${user} ${extension}
#
#mailman   unix  -       n       n       -       -       pipe
#  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
#  ${nexthop} ${user}
dovecot   unix  -       n       n       -       -       pipe
  flags=DRhu user=mailv:mailv argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}
##########
# AMAVIS #
##########
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_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
 
smtp-amavis unix -      -       -       -        4     smtp
    -o smtp_data_done_timeout=1200
    -o smtp_send_xforward_command=yes
    -o disable_dns_lookups=yes
 
##########
# BACKUP #
##########
backup3 unix  -       n       n       -       -      pipe
  flags=DRhu. user=backup:backup argv=/usr/sbin/backup3.py $sender $user@$nexthop}
dans mon main.cf :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
myhostname = mail3
mydomain = domain.com
myorigin = $mydomain
inet_interfaces = all
inet_protocols = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, localhost.localdomain, mail3.domain.com, mail3
unknown_local_recipient_reject_code = 550
mynetworks =  192.9.200.0/24,192.9.201.0/24,192.9.203.0/24,localhost, localhost.localdomain
alias_maps = hash:/etc/aliases,ldap:/etc/postfix/ldap-groupes.cf,ldap:/etc/postfix/ldap-aliases.cf,ldap:/etc/postfix/ldap-aliases2.cf,ldap:/etc/postfix/ldap-aliases3.cf,ldap:/etc/postfix/ldap-aliases4.cf
alias_database = hash:/etc/aliases
home_mailbox = Maildir/


debug_peer_level = 5
debugger_command =
         PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
         ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.9.4/samples
readme_directory = /usr/share/doc/postfix-2.9.4/README_FILES
inet_protocols = ipv4
smtpd_tls_security_level = may
smtp_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_auth_only = no
smtpd_use_tls = yes
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
smtpd_recipient_limit = 100
smtpd_helo_restrictions = reject_invalid_hostname
smtpd_sender_restrictions = reject_unknown_address
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
dovecot_destination_recipient_limit = 1
virtual_transport = dovecot
mailbox_command = /usr/libexec/dovecot/dovecot-lda -f "$SENDER" -a "$RECIPIENT"
virtual_mailbox_domains = virt1.com virt2.com
virtual_mailbox_base = /home/mail/
virtual_mailbox_maps = hash:/etc/postfix/virtual
virtual_alias_maps = hash:/etc/postfix/virtual_alias
virtual_uid_maps = static:600
virtual_gid_maps = static:600
virtual_mailbox_limit = 0
content_filter = smtp-amavis:[127.0.0.1]:10024
sender_bcc_maps = hash:/etc/postfix/sender_bcc
always_bcc = backup@backup3.domain.com
mailbox_size_limit = 0
recipient_delimiter = +
message_size_limit = 1024000000
smtpd_recipient_limit = 80
transport_maps = hash:/etc/postfix/transport
backup3_destination_recipient_limit = 1
dans le fichier transport :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
backup3.domain.com backup3:
extrait de log :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
postfix/pickup[5710]: 4A4E52E0D92: uid=0 from=<root>
postfix/cleanup[5917]: 4A4E52E0D92: message-id=<20121029164415.4A4E52E0D92@mail3>
postfix/qmgr[5711]: 4A4E52E0D92: from=<root@domain>, size=412, nrcpt=2 (queue active)
postfix/smtpd[5922]: connect from unknown[127.0.0.1]
postfix/smtpd[5922]: C979A2E0D8C: client=unknown[127.0.0.1]
postfix/cleanup[5917]: C979A2E0D8C: message-id=<20121029164415.4A4E52E0D92@mail3>
postfix/smtpd[5922]: disconnect from unknown[127.0.0.1]
postfix/qmgr[5711]: C979A2E0D8C: from=<root@domain>, size=935, nrcpt=3 (queue active)
amavis[1299]: (01299-14) Passed CLEAN, <root@domain> -> <backup@backup3.domain>,<mathv@domain>, Message-ID: <20121029164415.4A4E52E0D92@mail3>, mail_id: B0+Od305WjqL, Hits: 0, size: 412, queued_as: C979A2E0D8C, 512 ms
postfix/smtp[5919]: 4A4E52E0D92: to=<backup@backup3.domain>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.54, delays=0.01/0.01/0/0.51, dsn=2.0.0, status=sent (250 2.0.0 from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as C979A2E0D8C)
postfix/smtp[5919]: 4A4E52E0D92: to=<mathv@domain>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.54, delays=0.01/0.01/0/0.51, dsn=2.0.0, status=sent (250 2.0.0 from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as C979A2E0D8C)
postfix/qmgr[5711]: 4A4E52E0D92: removed
dovecot: lda(mathv): msgid=<20121029164415.4A4E52E0D92@mail3>: saved mail to INBOX
postfix/local[5925]: C979A2E0D8C: to=<mathv@domain>, relay=local, delay=0.04, delays=0/0.01/0/0.02, dsn=2.0.0, status=sent (delivered to command: /usr/libexec/dovecot/dovecot-lda -f "$SENDER" -a "$RECIPIENT")
postfix/pipe[5926]: C979A2E0D8C: to=<backup@backup3.domain>, relay=backup3, delay=0.15, delays=0/0.01/0/0.14, dsn=2.0.0, status=sent (delivered via backup3 service)
postfix/pipe[5927]: C979A2E0D8C: to=<backup@backup3.domain>, relay=backup3, delay=0.15, delays=0/0.01/0/0.14, dsn=2.0.0, status=sent (delivered via backup3 service)
postfix/qmgr[5711]: C979A2E0D8C: removed
je trouve pas pourquoi il est appelé deux fois...

j'ai bien une idée mais je ne sais pas la vérifier :

le mail arrive dans qmgr une première fois par le port 25, amavis l'attrape et l'envois au port 10024 ou il est analysé.
Ensuite il est renvoyé au port 10025 et repasse une seconde fois par qmgr...

Vous en pensez quoi?