Hi All!
I've created a simple PHP script that recognizes mail delivery errors 
("Undelivered Mail Returned to Sender")
and does a number of things on a database (100% legit traffic I swear, I work 
for an ISP and hate spam / abuses as much as you do :|)

I've added it to transport_maps
so it processed mails bounced by postfix itself
with the string:
myemailaddr...@mydomain.com mySimplePhpScript:dummy

it works great but there is a problem:
when trying to send a normal (not an error) direct email to 
myemailaddr...@mydomain.com
it loops around 10 times and then dies with the error:
status=bounced (too many hops)
and the email is not delivered to myemailaddr...@mydomain.com

The PHP script finishes with this:
$sendmail = '/usr/sbin/sendmail -G -i ' . implode(' ', $argv);
$handle = popen($sendmail, 'w');
fwrite($handle, $content);
$sendmail_return_value = pclose($handle);

so it uses 'sendmail' to try to delivery the email, but it loops.

I've read the transport_maps documentation but I have no idea how to prevent 
this,
if I delete that part of code, the email looks delivered ok:
status=sent (delivered via mySimplePhpScript service)
but it doesn't show up in the inbox.

Thank you very much for supporting, any hint would be greatly appreciated!


Best Regards,
Mike

Reply via email to