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.
精彩评论