Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a problem with my Postfix configuration.

When i receive mail from the Internet, i check the mail (virus, address etc etc). If the check is ok, i send the mail to its destination.

I give the mail to a script and i check it. But i have a forwarding loop and i send infinite mail.

vi /var/log/mail.log

Jul 28 14:48:41 ks****** postfix/local[19635]: D0A1B1C9AC: to=, relay=local, delay=0.12, delays=0.01/0/0/0.11, dsn=2.0.0, status=sent (delivered to command: /usr/lib/cgi-bin/test.php)
Jul 28 14:48:41 ks****** postfix/qmgr[30839]: D0A1B1C9AC: removed
Jul 28 14:48:41 ks****** postfix/qmgr[30839]: EA40D1C9AD: from=, size=2973, nrcpt=4 (queue active)
Jul 28 14:48:41 ks****** postfix/local[19635]: warning: required alias not found: mailer-daemon
Jul 28 14:48:41 ks****** postfix/local[19635]: EA40D1C9AD: to=, relay=local, delay=0.03, delays=0.02/0.01/0/0, dsn=2.0.0, status=sent (discarded)
Jul 28 14:48:41 ks****** postfix/error[19647]: EA40D1C9AD: to=, orig_to=, relay=none, delay=0.04, delays=0.02/0.01/0/0.01, dsn=5.1.3, status=bounced (bad address syntax)
Jul 28 14:48:43 ks****** postfix/smtp[18177]: EA40D1C9AD: to=, relay=b.mx.mail.yahoo.com[66.196.82.7]:25, conn_use=2, delay=1.1, delays=0.02/0/0.09/0.95, dsn=2.0.0, status=sent (250 ok dirdel)
Jul 28 14:48:43 ks****** postfix/local[19635]: EA40D1C9AD: to=, relay=local, delay=1.2, delays=0.02/0.01/0/1.1, dsn=5.4.6, status=bounced (mail forwarding loop for root@ks******.kimsufi.com)
Jul 28 14:48:43 ks****** postfix/cleanup[19633]: 1F3F71C9A9: message-id=
Jul 28 14:48:43 ks****** postfix/qmgr[30839]: 1F3F71C9A9: from=, size=5017, nrcpt=1 (queue active)
Jul 28 14:48:43 ks****** postfix/bounce[19648]: EA40D1C9AD: sender non-delivery notification: 1F3F71C9A9
Jul 28 14:48:43 ks****** postfix/qmgr[30839]: EA40D1C9AD: removed
Jul 28 14:48:43 ks****** postfix/pickup[18314]: 3889F1C9AD: uid=0 from=
Jul 28 14:48:43 ks****** postfix/cleanup[19633]: 3889F1C9AD: message-id=
Jul 28 14:48:43 ks****** postfix/local[19635]: 1F3F71C9A9: to=, relay=local, delay=0.12, delays=0.01/0/0/0.11, dsn=2.0.0, status=sent (delivered to command: /usr/lib/cgi-bin/test.php)
Jul 28 14:48:43 ks****** postfix/qmgr[30839]: 1F3F71C9A9: removed
Jul 28 14:48:43 ks****** postfix/qmgr[30839]: 3889F1C9AD: from=, size=5216, nrcpt=4 (queue active)
Jul 28 14:48:43 ks****** postfix/local[19635]: warning: required alias not found: mailer-daemon
Jul 28 14:48:43 ks****** postfix/local[19635]: 3889F1C9AD: to=, relay=local, delay=0.03, delays=0.02/0.01/0/0, dsn=2.0.0, status=sent (discarded)
Jul 28 14:48:43 ks****** postfix/error[19647]: 3889F1C9AD: to=, orig_to=, relay=none, delay=0.03, delays=0.02/0/0/0.01, dsn=5.1.3, status=bounced (bad address syntax) 
postconf -n

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
default_privs = www-data
html_directory = /usr/share/doc/postfix/html
inet_interfaces = all
inet_protocols = ipv4
mailbox_size_limit = 0
mydestination = ks******.kimsufi.com, localhost.kimsufi.com, , localhost
myhostname = ks******.kimsufi.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
notify_classes = resource, software
readme_directory = /usr/share/doc/postfix
recipient_delimiter = +
relay_domains = mysql:/etc/postfix/mysql-rd.cf
relayhost = 
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_client_restrictions = permit_mynetworks
smtpd_recipient_restrictions = permit_mynetworks,        reject_unauth_destination,        reject_non_fqdn_recipient
smtpd_sender_restrictions = permit_mynetworks,        warn_if_reject reject_unverified_sender
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
transport_maps = mysql:/etc/postfix/mysql-transport.cf
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual_aliases.cf,mysql:/etc/postfix/mysql-virtual_aliases_comptes.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /var/spool/vmail/
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_domaines.cf
virtual_uid_maps = static:5000
.forward

|/usr/lib/cgi-bin/test.php
share|improve this question

migrated from stackoverflow.com Jul 28 '09 at 15:01

This question came from our site for professional and enthusiast programmers.

add comment

2 Answers 2

Aren´those the bounces that are trigger the mail avalanche? I would also eadd an alias for mailer-daemon to your alliasses file. so you can read the errormessage and post it here...

Jul 28 14:48:41 ks****** postfix/local[19635]: warning: required alias not found: mailer-daemon
share|improve this answer
    
Looks to me like it's the content filter feeding the message back into istelf, and the double-bounce or 'too many hops' message generating that warning. –  Rob Chanter Aug 7 '09 at 5:43
add comment

I'm not quite sure what you are trying to do here. I'd suggest reading the CONTENT_FILTER_README and SMTPD_POLICY_README in the Postfix documentation. Your test.php script should probably be running as a content filter rather than a delivery-time script. Especially if you are using the script to reject messages based on sender/recipient, it's considered bad form to make those sorts of decisions after you've accepted the message for delivery.

The usual way to do content filtering in Postfix is for the front-end smtpd to hand off to a content filter via SMTP, LMTP or a pipe, and the content filter to reinject into an entry point that has no content filtering enabled -- either another smtpd with the content_filter parameter disabled in a -o override in master.cf, or local submission using /usr/sbin/sendmail with the Postfix pickup daemon's content_filter disabled in master.cf.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.