关于SMTP HELO/EHLO的问题

demo01043003 2012-09-20 03:14:07
根据RFC 2821 HELO/EHLO 后面应该接着 设备的FQDN(完全域名)或者 IP ,在网上搜到的开源的ssmtp.c中,是这样实现的:

/* If user supplied username and password, then try ELHO */
if(auth_user) {
outbytes += smtp_write(sock, "EHLO %s", hostname);
}
else {
outbytes += smtp_write(sock, "HELO %s", hostname);
}

上面的hostname是同个gethostname函数得到的,我的机子中获取到的是:loalhost,可是这里的loalhost是FQDN吗??这个应该只是主机名,

而百度百科中FQDN是一个系统的完整名称而非其主机名称,如果是这样那么我的设备中的完全域名怎么获取呢???
如果后面接的是IP的话,是不是得公网IP,本地IP不可以??

望大家帮我解疑一下,十分感谢。
...全文
2394 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
guaguaguaguaxi 2012-09-21
  • 打赏
  • 举报
回复
我也遇到同样的问题,不知道HELO/EHLO后面应该接着什么,语法上是

ehlo = "EHLO" SP Domain CRLF
helo = "HELO" SP Domain CRLF

这个Domain,应该填写什么,什么格式,IP的话本地IP可以吗??
一、数据前过滤   数据前过滤是指在smtp会话中,data指令发送前进行的过滤。在这个阶段,有四种不同子阶段的过滤:smtp连接时过滤、helo/ehlo指令过滤、mail from指令过滤和rcpt to指令过滤。根据这四个子阶段接收到的信息的不同,他们也分别称作smtp客户端限制、helo/ehlo主机名限制、发送者地址限制和接收者地址限制。   过滤默认是在rcpt to指令后生效的,这是因为一些windows上的邮件客户端不处理在rcpt to指令前的过滤动作。能通过将smtpd_delay_reject设置为no来使过滤动作即时生效。这个参数还影响了在不同的指令上能使用的过滤规则参数。   1、过滤规则   这四个子阶段的过滤是分别通过四个设置语句来指定过滤规则的。他们都接收一系列的规则参数列表,参数间能用空格或逗号分隔开。在默认状态下smtpd_delay_reject的值是yes,他们能接受所有支持的规则,不过需在rcpt to指令后才能全部生效;如果把smtpd_delay_reject设置为no,他们只能接受五个公共的规则参数、之前子阶段的过滤规则参数和该子阶段的规则参数。   他们接受的公共的规则参数如下: o permit 允许该连接进行。该规则通常置于规则列表的最后面使规则更清晰。 o defer 通知客户端目前不能继续会话,稍后再进行smtp连接请求。这常用于服务器需要进行一些dns检查,不过(由于dns查询超时)没有及时获得结果时,通知客户端稍后再进行连接。该规则通常置于规则列表的最后面使规则更清晰。 o reject 拒绝该连接请求。在这个阶段就断开了连接,有效的节约了垃圾邮件造成的带宽和处理能力的浪费。该规则通常置于规则列表的最后面使规则更清晰。 拒绝动作默认不会在匹配了拒绝规则后就即时断开连接,而是在rcpt to指令处理完之后再断开的,这是由于一些windows上有缺陷的邮件程式不处理在rcpt to指令前的发回的拒绝状态码。能通过smtpd_delay_reject设置为no来即时发送拒绝状态码断开连接。 reject_code指定了拒绝的返回状态码(默认是554)。 o warn_if_reject 改动其后规则的拒绝动作为警告,即如果其后存在满足拒绝的条件,并不实际拒绝,而是发出一条警告信息(reject_warning)到日志文件中(通常是/var/log/maillog)。他常用于在实际运行的邮件服务器上测试邮件过滤规则。
Clever Internet .NET Suite 6.0.26.0
.NET可用于VS2002/2003/2005,包括源代码

Version 6.0.26.0 (8 February 2007)

Implemented Features:

HTTP Client - HTTPS (SSL / TLS) protocol, NTLM and Negotiate authentication were implemented.
FTP Server - SSL / TLS support, Virtual File System were implemented.
FTP Client - SSL / TLS support, the ability to set FTP file attributes and permissions were added.
POP3 Server - SSL / TLS support, NTLM, APOP and CRAM-MD5 authentication methods, File System message storage were implemented.
POP3 Client - SSL / TLS support, NTLM and CRAM-MD5 authentication methods were implemented.
SMTP Server - SSL / TLS support, NTLM, USER/PASS and CRAM-MD5 authentication methods, File System message storage were implemented.
SMTP Client - SSL / TLS support and NTLM authentication method were added.
IMAP Client - SSL / TLS support, NTLM authentication method, obtaingin the server Capability list were implemented, the FETCH command was improved.
NNTP Client - SSL / TLS support was added.
WebDAV Client - manages remote files and folders on a web server.
HTML Parser - the ability to parse HTML Meta Tags was added: Title, Author, Description, Keywords, etc.
GZip compressor component - provides compressing / uncompressing feature when transmitting data over the Internet, storing data in to a file, database and many more.
Trace Logger - provides logging functionality for storing debug information and tracing your code.


Fixed Bugs:


HTTP Client - problems with changing the request method from POST to GET when redirecting to another location were fixed.
Http Client - the ReceiveProgress event did not work on small-size resources - fixed.
SMTP Client - HELO / EHLO mode was improved.
MailMessage - the messages with international texts were decoded incorrectly (the character set field was ignored) - fixed.
MailMessage - creating attachments with 'audio' and 'video' content-type.
VS 2005 toolbox registration was implemented.

23,120

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧