开发者

Refuse SMTP messages over a certain size with IdSMTPServer on Delphi 2006

I'm using Delphi 2006 and the TIdSMTPServer component (Version 10.1.5) to set up a SMTP server. This works fine, but I don't want to accept messages that are above a certain size.

Is there a way to interogate the size of the incoming message before the server receives 开发者_如何学JAVAit and refuse it?


There's no guaranteed way. A client is not required to supply any size info.

However, RFC 1870 describes an SMTP extension that allows this to happen. It requires that both server and client supports it.

I'm not sure about your particular version of Indy, but it seems that TIdSMTPServer does supports the extension in the Indy version that's bundled with D2010. Look for the MaxMsgSize property.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜