Hello,
I've a problem when I try to make a script autoreply for a user in postfix.
I think the problem is due to amavis, because I've made this:
When a mail is sent to
thierry@linux.thierry.eu.org (which is a real user with a virtual mailbox), it's forwarded to itself, and to
thierry@autoreply.linux.thierry.eu.org, which is used with the transport autoreply.
So the sender receives 2 times the autoreply script.
(this is the interesting lines of master.cf)
smtp inet n - - - - smtpd
smtp-amavis unix - - n - 2 lmtp -o lmtp_data_done_timeout=1200 -o lmtp_send_xforward_command=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
smtp unix - - - - - smtp
autoreply unix - n n - - pipe
flags= user=vmail argv=/home/thierry/autoreply.sh ${recipient} ${sender}
maildrop unix - n n - - pipe
flags=R user=vmail argv=/usr/local/bin/maildrop -d ${recipient} -f ${sender}
mon script autoreply.sh:
#!/bin/sh
echo -e "Repondeur\n\nJe ne suis pas là pour le moment." |mail -a "From: $1" -s "Essai de repondeur" $2
mon main.cf:
myhostname = debian
mydomain = debian
mydestination = $myhostname
local_recipient_maps = $alias_maps $virtual_mailbox_maps unix

asswd.byname
home_mailbox = Maildir/
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
broken_sasl_auth_clients = yes
alias_maps = mysql:/etc/postfix/mysql-aliases.cf
relocated_maps = mysql:/etc/postfix/mysql-relocated.cf
transport_maps = mysql:/etc/postfix/mysql-transport.cf
maildrop_destination_recipient_limit = 1
autoreply_destination_recipient_limit = 1
virtual_transport = maildrop
#virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-domains.cf
virtual_mailbox_domains = linux.thierry.eu.org
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual.cf
#virtual_alias_maps = hash:/etc/postfix/virtual
virtual_mailbox_base = /home/vmail
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-maps.cf
virtual_uid_maps = mysql:/etc/postfix/mysql-virtual-uid.cf
virtual_gid_maps = mysql:/etc/postfix/mysql-virtual-gid.cf
#OPTIONAL PART
smtpd_helo_required = yes
disable_vrfy_command = yes
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_etrn_restrictions = reject
content_filter=smtp-amavis:[127.0.0.1]:10024
Thanks.
Bye