Sendmail使用命令行,但不在perl脚本中

时间:2017-11-14 17:40:44

标签: perl unix sendmail mason

我有一个托管托管包的域名。我可以通过mason-and-perl构建的页面发送邮件,其逻辑如下:

use Mail::Sendmail;
my %mail = ( To => $email,
        From => 'webmaster@mydomain.com',
        Message => $body,
        Subject => 'Password Reset for mydomain.com',
        'content-type' => 'text/html; charset="iso-8859-1"',
     );
$mail{smtp} = 'mail.mydomain.com';

sendmail(%mail) or die $Mail::Sendmail::error;
debug( $Mail::Sendmail::log );

当我尝试在我从头设置的服务器上执行此操作时,日志看起来很干净,但消息永远不会到达其预定目的地。

奇怪的是sendmail在命令行中运行,所以(我认为)这意味着smtp服务器工作正常。

以下是两次尝试的日志:

命令行:

Nov 14 19:49:59 server sendmail[11372]: vAEGnwGK011372: from=root, size=23, class=0, nrcpts=1, msgid=<201711141649.vAEGnwGK011372@server.mydomain.com>, relay=root@localhost
Nov 14 19:49:59 server sendmail[11373]: vAEGnxdo011373: from=<root@server.mydomain.com>, size=334, class=0, nrcpts=1, msgid=<201711141649.vAEGnwGK011372@server.mydomain.com>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Nov 14 19:49:59 server sendmail[11372]: vAEGnwGK011372: to=firstname.lastname@emaildomain.com, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=30023, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (vAEGnxdo011373 Message accepted for delivery)
Nov 14 19:50:00 server sendmail[11375]: STARTTLS=client, relay=email-com.mail.protection.outlook.com., version=TLSv1/SSLv3, verify=FAIL, cipher=ECDHE-RSA-AES256-SHA384, bits=256/256
Nov 14 19:50:01 server sendmail[11375]: vAEGnxdo011373: to=<firstname.lastname@emaildomain.com>, ctladdr=<root@server.mydomain.com> (0/0), delay=00:00:02, xdelay=00:00:02, mailer=esmtp, pri=120334, relay=email-com.mail.protection.outlook.com. [XX.XX.XX.XX], dsn=2.0.0, stat=Sent (<201711141649.vAEGnwGK011372@server.mydomain.com> [InternalId=123750892719011, Hostname=...PR0501MB1308.namprd05.prod.outlook.com] 7738 bytes in 0.240, 31.455 KB/sec Queued mail for delivery)

脚本:

Nov 14 19:00:27 server sendmail[11010]: vAEG0Qdl011010: from=<webmaster@mydomain.com>, size=440, class=0, nrcpts=1, msgid=<201711141600.vAEG0Qdl011010@server.mydomain.com>, proto=SMTP, daemon=MTA, relay=server.mydomain.com [198.91.92.82]
Nov 14 19:00:27 server sendmail[11012]: STARTTLS=client, relay=email-com.mail.protection.outlook.com., version=TLSv1/SSLv3, verify=FAIL, cipher=ECDHE-RSA-AES256-SHA384, bits=256/256
Nov 14 19:00:29 server sendmail[11012]: vAEG0Qdl011010: to=<firstname.lastname@emaildomain.com>, delay=00:00:02, xdelay=00:00:02, mailer=esmtp, pri=120440, relay=email-com.mail.protection.outlook.com. [XX.XX.XX.XX], dsn=2.0.0, stat=Sent (<201711141600.vAEG0Qdl011010@server.mydomain.com> [InternalId=122694330745044, Hostname=...PR0501MB1300.namprd05.prod.outlook.com] 7870 bytes in 0.238, 32.251 KB/sec Queued mail for delivery)

对我而言,接力是不同的。这是根本原因吗?

0 个答案:

没有答案