All,

Attached is a patch for the SMTPHandler.java.  It's intended to
accomplish a number of goals:

i) Reorganize the code so that it is both more modular (for the moment,
smaller method bodies) and more encapsulated (a number of helper methods
were added to hide member variables).

ii) Improve compliance with RFC 2821 by appropriately rejecting those
commands that should have no arguments (RSET, QUIT, DATA) when they are
sent with arguments by a client.

iii) Added methods for HELP, VRFY, and EXPN.  These methods don't do
anything at the moment - but they give us a more complete basis to work
with in line with the RFC.  Debates over whether/how to support VRFY and
EXPN can wait until the next version.  To be good netizens we should
probably implement HELP.

iv) Moved all constant SMTP command text strings into static variables,
to prevent typo problems.

v) Changed the internal 'state' hash table so it is correct - it now
only holds data that is specific to a particular MAIL-RCPT-DATA
transaction.  Extraneous keys for this table have been removed.  Data
that is not specific to such a transaction has now been moved to member
variables.

vi) Potentially incorrect parsing code in the main parseCommand method
was moved to the appropriate 'do' method.  This ensures correct parsing
of incoming command lines.  The 'do' methods now provide a uniform
interface (except for doUnknownCommand)

vii) Moved MESG_FAILED state check up a level, to parseCommand.  This
highlights the potential bug here (try sending a message that exceeds
the server size limit that contains a line starting with a recognized
SMTP command).  This bug will be filed and will be addressed in the next
version.

This code (or a minor variant of it) has been running on my server for
days.

Any comments, questions, or critiques are welcome.

--Peter

Attachment: SMTPHandler.java.diff
Description: Binary data

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to