在RHEL工作站6.3上安装了sendmail和openwebmail后,我可以通过webmail发送电子邮件(cgi-bin / openwebmail / openwebmail.pl),但无法与Perl脚本中的sendmail服务器进行交互,如下所示:
use Net::SMTP;
my $smtpserver = 'mail.server.com';
my $smtpport = 25;
my $smtpuser = 'test';
my $smtppassword = 'test';
my $smtp = Net::SMTP->new($smtpserver, Port=>$smtpport, Timeout => 10, Debug => 1);
die "Could not connect to server!\n" unless $smtp;
$smtp->auth($smtpuser, $smtppassword);
$smtp->mail("Ann");
$smtp->to("hello\@world.com");
$smtp->data();
$smtp->datasend("To: hello\@world.com\n");
$smtp->quit;
在Windows 7上运行此Perl脚本时,输出如下:
Net::SMTP>>> Net::SMTP(2.31)
Net::SMTP>>> Net::Cmd(2.29)
Net::SMTP>>> Exporter(5.64_01)
Net::SMTP>>> IO::Socket::INET(1.31)
Net::SMTP>>> IO::Socket(1.31)
Net::SMTP>>> IO::Handle(1.28)
Net::SMTP=GLOB(0x2be1e80)<<< 220 mail.server.com ESMTP Sendmail 8.14.4/8.14.4
; Fri, 11 Apr 2014 19:48:30 +0800
Net::SMTP=GLOB(0x2be1e80)>>> EHLO localhost.localdomain
Net::SMTP=GLOB(0x2be1e80)<<< 250-mail.server.com Hello [9.110.10.236], please
d to meet you
Net::SMTP=GLOB(0x2be1e80)<<< 250-ENHANCEDSTATUSCODES
Net::SMTP=GLOB(0x2be1e80)<<< 250-PIPELINING
Net::SMTP=GLOB(0x2be1e80)<<< 250-8BITMIME
Net::SMTP=GLOB(0x2be1e80)<<< 250-SIZE
Net::SMTP=GLOB(0x2be1e80)<<< 250-DSN
Net::SMTP=GLOB(0x2be1e80)<<< 250-ETRN
Net::SMTP=GLOB(0x2be1e80)<<< 250-AUTH DIGEST-MD5 PLAIN
Net::SMTP=GLOB(0x2be1e80)<<< 250-DELIVERBY
Net::SMTP=GLOB(0x2be1e80)<<< 250 HELP
Net::SMTP=GLOB(0x2be1e80)>>> AUTH DIGEST-MD5
Net::SMTP=GLOB(0x2be1e80)<<< 334 bm9u...
3VnV5VXB6MlBJeHY5TVE9IixyZWFsbT0iaHV...
Net::SMTP=GLOB(0x2be1e80)>>> YXV0a...
Net::SMTP=GLOB(0x2be1e80)<<< 334 cnNwYXV0axODVhOA==
Net::SMTP=GLOB(0x2be1e80)>>>
Net::SMTP=GLOB(0x2be1e80)<<< 235 2.0.0 OK Authenticated
Net::SMTP=GLOB(0x2be1e80)>>> MAIL FROM:<hello>
Net::SMTP: Unexpected EOF on command channel at E:\tool\smtp.pl line 35
它显示客户端已经过身份验证但在调用&#34; $ smtp-&gt; mail()&#34;后没有收到任何数据,此时服务器似乎关闭了连接。
在服务器端,有一些错误消息写入/ var / log / maillog:
Apr 11 19:48:30 bill sendmail[16761]: AUTH=server, relay=[9.110.10.6], authid=test, mech=DIGEST-MD5, bits=128
Apr 11 19:48:30 bill sendmail[16761]: AUTH: sasl_decode error=-1
Apr 11 19:48:30 bill sendmail[16761]: s3BBmUQj016761: [9.110.10.236] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA
maillog显示身份验证方法是DIGEST-MD5,但是它无法调用sasl_decode。
任何人都可以为这个问题提供任何线索吗?非常感谢。
PS:我的sendmail.mc粘贴在github