Event handler signalled during execution of the SMTP MAIL command.
OnCommandMAIL is a THasAddress2 event handler property that represents the event handler signalled when executing the SMTP MAIL command using CommandHandlers for the executing client connections.
The SMTP MAIL command is used to initiate a mail transaction for dellivery of mail data to the SMTP server. The SMTP server will then decide if the mail data can be deliverd to mailboxes or passed to another SMTP server. If service extensions were negotiated, using AllowEHLO, the MAIL command may also carry parameters associated with a particular service extension.
The SMTP server provides an internal MAIL command action handler that ensures that the client connection has been identified using the EHLO or HELO command prior to processing arguments in the MAIL command. When no client identification has been provided, the text in the Messages.Greeting.NoHello is sent to the client connection.
If the client connection has been identified to the SMTP server, the command action handler parses the origin email address from TIdCommand.UnparsedParams values found in ASender. When no client identification has been provided, the text in the Messages.Greeting.NoHello is sent to the client connection.
The SMTP server implementation must assign a procedure to the OnCommandMail event handler to allow responding to the THasAddress2 event notification. The event handler is used to validate the email address that will be used in the TIdSMTPServerThread.From property for the threaded client connection, and indicate if the address has been accepted. The email address in EMailAddress is assigned to the From property when Accepted is True. If the email address for the sender is not accepted, the text in Messages.RcpReplies.AddressErrorReply is sent to the client connection.
When OnCommandMail is unassigned, the email address parsed by the command action handler is assigned to the ASender.From property, and the text in Messages.RcpReplies.AddressOKReply is sent to the client connection.
THasAddress2 TIdSMTPServerThread
Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved. Website http://www.indyproject.org. Post feedback to the Indy Documentation newsgroup. |