简体   繁体   English

通过sendmail服务器发送邮件时出现sasl_decode错误

[英]Hit sasl_decode error while sending mail through sendmail server

Having installed sendmail and openwebmail on RHEL workstation 6.3, I can send email through webmail(cgi-bin/openwebmail/openwebmail.pl), but failed to interact with sendmail server in Perl script as following: 在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;

While running this Perl script on Windows 7, the output is below: 在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

It showed that client got authenticated but didn't received any data after invoking "$smtp->mail()", it seems server closed the connection at this point. 它表明客户端已通过身份验证,但在调用“ $ smtp-> mail()”后未收到任何数据,这似乎服务器已关闭连接。

On the server side, there were some error messages written into /var/log/maillog: 在服务器端,有一些错误消息写入/ 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 showed authentication method is DIGEST-MD5, but it's failed to invoke sasl_decode. maillog显示认证方法为DIGEST-MD5,但无法调用sasl_decode。

Anyone can give any clue for this problem? 任何人都可以为这个问题提供任何线索吗? Thanks a lot. 非常感谢。

PS: my sendmail.mc is pasted at github PS:我的sendmail.mc粘贴在github上

Here I made some guess that the old versions is with bugs. 在这里,我猜测旧版本存在错误。 Please check this CPAN RT 请检查此CPAN RT

https://rt.cpan.org/Public/Bug/Display.html?id=58002 https://rt.cpan.org/Public/Bug/Display.html?id=58002

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM