Tk Library Source Code

View Ticket
Login
Ticket UUID: 479482
Title: RFC: new smtpd module.
Type: Patch Version: None
Submitter: patthoyts Created on: 2001-11-08 08:22:58
Subsystem: None Assigned To: patthoyts
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2001-11-18 05:04:47
Resolution: Accepted Closed By: patthoyts
    Closed on: 2001-11-17 22:04:47
Description:
I am submitting a skeleton Simple Mail Transfer
Protocol daemon (smtpd) for inclusion into tcllib. This
was written to permit testing of mail sending software
(SOAP over SMTP) on the windows platform but may have
other uses.

The skeleton talks SMTP and will accept mail subject to
validation of the host, sender and recipients. Once
received the mail is passed to a user-specified
delivery procedure for processing.

I suggest creating a new subdirectory under
tcllib/modules as has been done for the ftp/ftpd
client/server packages.

Comments please!
User Comments: patthoyts added on 2001-11-18 05:04:47:
Logged In: YES 
user_id=202636

New code committed with an ammended manual page.

patthoyts added on 2001-11-15 16:36:50:
Logged In: YES 
user_id=202636

I'll deal with the documentation issues.

>*   We should extend this module to allow several
>    independent servers running on different ports.

I guess so.

>*   Another place for validation might be after all
>    mail headers in the message are read. For example
>    missing To:/From:, whatever ..

The RFC says that a mail transfer is complete once the DATA
command has been completed (ie: once we receive the final
'.' on its own. Issuing a DATA without having previously
issued both MAIL and RCPT commands is an error and the
client is sent 503 Bad sequence. I should be noted that SMTP
connections are stateful so the following sequence is permitted:
HELO bogus
MAIL From: me
RCPT To: aku
DATA
mail
.
DATA
more
.

Sending two messages to 'aku'. RSET is used to reset the
state (ie: forget any sender/recpient addresses.)

I'll add the above to the documentation too then :)

andreas_kupries added on 2001-11-13 05:48:54:
Logged In: YES 
user_id=75003

Questions I believe should be answered in the documentation.

When executing "smtpd::stop", what happens to existing 
connections ? Are they closed forcibly, or keep on running, 
or ... ?

When any of the callbacks throws an error, is that error 
message delivered to the SMTP client or is that purely 
internal, for example logging ?

When are the callbacks called ? Deliver is clear, but are 
validate host/sender/recipients called them moment when 
this information is available, or only when all of the 
infomration was gathered ? Can we assume a specific order 
for the callbacks ? Can the deliver callback deny message 
transport by throwing an error ?

----

Notes for future development.

*   We should extend this module to allow several
    independent servers running on different ports.

*   Another place for validation might be after all
    mail headers in the message are read. For example
    missing To:/From:, whatever ...

patthoyts added on 2001-11-08 15:24:38:

File Added - 13008: smtpd.n

patthoyts added on 2001-11-08 15:23:57:

File Added - 13007: example.tcl

patthoyts added on 2001-11-08 15:23:00:

File Added - 13006: smtpd.tcl

Attachments: