我正在使用Postfix与外部服务器通信并发送邮件。 每次当我尝试使用Postfix发送邮件时,我得到这个错误:
(host mx2.seznam.cz[77.75.76.32] said: 451 Local Error (in reply to end of DATA command))
经过一段时间的debugging,我得到了SMTP转录:
220 2.0.0 Seznam SMTP server waiting for your HELO/EHLO EHLO alpha.tbedrich.cz 250-Email.Seznam.cz - Email zdarma na cely zivot ESMTP 250-8BITMIME 250-SIZE 18000000 250-ENHANCEDSTATUSCODES 250 X-SZNEXTENSIONS MAIL FROM:<[email protected]> SIZE=1007 250 2.1.0 Ok <[email protected]> RCPT TO:<[email protected]> 250 2.1.5 Ok <[email protected]> DATA 354 Start mail input; end with <CRLF>.<CRLF> Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com [209.85.217.176]) by alpha.tbedrich.cz (Postfix) with ESMTPSA id 8520F401DB for <[email protected]>; Thu, 27 Aug 2015 19:09:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tbedrich.cz; s=mail; t=1440695377; bh=CG6CavtqSpj8fj6WkmsWGRsGNN0Qa3sWp3MV/1BiTCY=; h=From:Date:Subject:To:From; b=GtnSxBgTLQsBIjn0DTUAm7zgfiIUOJjunmWHeCLSEit+QqyaGy63QzLd4yvzJYNNW 6Fpc2LySSMB3QfxvhNOaxZZaP1aBUVaqH8nGulPgKeC5B67HgKGIpIP8o8F8oEDZyc G7TPnXC6zA62Nr5FzSlmMYpWwQh4HR2RYEJDvFrU= Received: by lbbtg9 with SMTP id tg9so15579426lbb.1 for <[email protected]>; Thu, 27 Aug 2015 10:09:36 -0700 (PDT)a X-Received: by 10.152.21.231 with SMTP id y7mr2710607lae.63.1440695376852; Thu, 27 Aug 2015 10:09:36 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?B?VG9tw6HFoSBCZWTFmWljaA==?= <[email protected]> Date: Thu, 27 Aug 2015 17:09:27 +0000 Message-ID: <CALS8Sqg8HQVmHt2UOiLfRMmkHyzzD2G2nKGPhqnh=3hjKW=NOA@mail.gmail.com> Subject: test To: [email protected] Content-Type: multipart/alternative; boundary=089e0158aea02abfcc051e4e0861 --089e0158aea02abfcc051e4e0861 Content-Type: text/plain; charset=UTF-8 --089e0158aea02abfcc051e4e0861 Content-Type: text/html; charset=UTF-8 <div dir="ltr"><br></div> --089e0158aea02abfcc051e4e0861-- . 451 Local Error 502 5.5.1 Command ' by ' not implemented. 502 5.5.1 Command ' for' not implemented. 502 5.5.1 Command 'DKIM' not implemented. 502 5.5.1 Command ' t=1' not implemented. 502 5.5.1 Command ' h=F' not implemented. 502 5.5.1 Command ' b=G' not implemented. 502 5.5.1 Command ' 6F' not implemented. 502 5.5.1 Command ' G7' not implemented. 502 5.5.1 Command 'Rece' not implemented. 502 5.5.1 Command ' ' not implemented. 502 5.5.1 Command 'X-Re' not implemented. 502 5.5.1 Command ' Thu' not implemented. 502 5.5.1 Command 'MIME' not implemented. 502 5.5.1 Command 'From' not implemented. 502 5.5.1 Command 'Date' not implemented. 502 5.5.1 Command 'Mess' not implemented. 502 5.5.1 Command 'Subj' not implemented. 502 5.5.1 Command 'To: ' not implemented. 502 5.5.1 Command 'Cont' not implemented. 501 Command too short. 502 5.5.1 Command '--08' not implemented. 502 5.5.1 Command 'Cont' not implemented. 501 Command too short. 501 Command too short. 501 Command too short. 502 5.5.1 Command '--08' not implemented. 502 5.5.1 Command 'Cont' not implemented. 501 Command too short. 502 5.5.1 Command '<div' not implemented. 501 Command too short. 502 5.5.1 Command '--08' not implemented. 501 Command too short. QUIT
为什么外国服务器不了解通信? 我没有看到有什么不好的地方。
收件人的邮件服务器给你的线索:
451 Local Error
这意味着他们的服务器有问题,您应该稍后再尝试。
从你的日志看来,他们的邮件服务器可能在接收到第一行邮件内容后出现问题,并且之后的电子邮件中的每一行都被解释为一个新的命令 – 失败了,因为它们不是有效的SMTP命令。
我猜你已经做了一个电子邮件内容的复制粘贴; 如果您一次只粘贴一行而不是整个电子邮件,那么您会在第一行之后立即收到错误消息,而您将不会收到其余的错误消息,这会使问题变得很多清晰。
由于这是他们的邮件服务器有问题,而不是你的,所以没有什么可以解决它。 你必须等待,或者打电话给他们。
这似乎是一个CR + LF问题。 你确定你发送的两个控制字符的行结束在数据? 不是每个MTA都对此敏感,AFAIK。
我不认为这是Postfix应该做的改变,而是一个原始的应用程序(一个生成的消息)。 尝试将消息保存在UNIX(LF-only)文件中,然后运行cat file |sendmail -i -t ,然后使用todos file将文件转换为DOS格式(CR + LF),然后再次cat file |sendmail -i -t 。 检查邮件日志。 这个testing应该告诉你问题是否在这里。
从评论部分展开声明
SMTP交易涉及两方,发件人和收件人。 两个服务器彼此交谈时必须达成一致。 当一个服务器抱怨上面的协议不一致时,他们要么是你的服务器 , 要么是他们的configuration错误 。
要debugging它,尝试发送电子邮件到另一台服务器。 如果你是这个问题,那么你将无法与其他人交谈。 也尝试通过另一个邮件服务器发送电子邮件到您的接收器。 如果另一台服务器也有同样的问题,那么接收器可能configuration错误。