I'm using the php mail()
function to send mails to recipients
$to = "recipient@example.com";
$subject = "Subject";
$message = "This is a message from our website to say thank you";
$headers = "From: sender@example.com \r\nReply-To: sender@example.com\r\nReturn-Path: sender@example.com\r\n";
$additional = "-rsender@example.com";
//(have also tried -fsender@example.com in $additional)
mail($to, $subject, $message, $headers,$additional);
It didn't send the bounced mail to sender@example.com. I checked the log (/var/mail/mail.log
) and could find the below
Jul 8 15:38:21 aspi开发者_运维技巧re680 sendmail[15850]: p68A8Lpl015850: to=recipient@example.com, ctladdr=sender@example.com (33/33), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30279, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (p68A8LVH015852 Message accepted for delivery)
Jul 8 15:38:21 aspire680 sm-mta[15854]: p68A8LVH015852: to=, delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=120589, relay=mail.aspiresys.com. [192.168.0.3], dsn=5.1.1, stat=User unknown
Jul 8 15:38:22 aspire680 sm-mta[15854]: p68A8LVH015852: p68A8MVH015854: DSN: User unknown
Jul 8 15:38:22 aspire680 sm-mta[15854]: p68A8MVH015854: to=, delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=30000, relay=mail.aspiresys.com. [192.168.0.3], dsn=5.1.1, stat=User unknown Jul 8 15:38:22 aspire680 sm-mta[15854]: p68A8MVH015854: p68A8MVI015854: return to sender: User unknown Jul 8 15:38:22 aspire680 sm-mta[15854]: p68A8MVI015854: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30000, dsn=2.0.0, stat=Sent
which clearly suggests it has sent the bounce mail to sender@example.com
since recipient@example.com
doesn't exist but I didn't receive any mail. Am I missing something here or what could be the problem. Please advice.
精彩评论