class EventMachine::Protocols::SmtpServer
def process_mail_from sender
path in case of delivery problems. All of that is left to the calling application.
the reverse-path (like whether it should be null), and notifying the reverse
We DON'T enforce all the various rules for validating the sender or
We DON'T allow MAIL FROM to be given twice.
negotiation, although that would certainly be reasonable.
We don't currently support any notion of deriving an authentication from the TLS
Requiring AUTH seems to be much more reasonable.
Requiring TLS is touchy, cf RFC2784.
--
def process_mail_from sender if (@@parms[:starttls]==:required and !@state.include?(:starttls)) send_data "550 This server requires STARTTLS before MAIL FROM\r\n" elsif (@@parms[:auth]==:required and !@state.include?(:auth)) send_data "550 This server requires authentication before MAIL FROM\r\n" elsif @state.include?(:mail_from) send_data "503 MAIL already given\r\n" else unless receive_sender sender send_data "550 sender is unacceptable\r\n" else send_data "250 Ok\r\n" @state << :mail_from end end end