[cl-smtp-devel] Patch to support sending raw messages
Hans Hübner
hans at huebner.org
Sun Mar 23 18:26:04 UTC 2008
Hi,
I recently spent some time with cl-smtp to make it support sending raw
messages - I am using cl-mime for my message composition purposes, and
I did not want to extend cl-smtp to support yet more headers.
While at it, I refactored cl-smtp a bit:
- Sending a command and checking the response is in the SMTP-COMMAND function
- SMTP protocol handling and message composition is separated a bit
- Some error reporting is now done through specific condition classes.
This makes it possible to handle invalid recipients programmatically
without having to re-send the whole message (cl-smtp did not report
which recipient failed)
- Some docstrings and comments have been added
- I fixed STARTTLS so that an EHLO command is sent after STARTTLS.
This is required by some servers to switch them into ESMTP mode
- Determination of the AUTH protocol is now automatic, by reading the
features list sent by the server as a response to the EHLO command.
The new WITH-SMTP-MAIL macro is what I am now using to send my raw
messages. The rest of the API is mostly unchanged (except that the
method specified in the AUTHENTICATION argument is now ignored).
When I was finished with my initial hacking round today, I found that
some of the changes overlap with what Anton Vodonosov has recently
posted. My bad! I have then added his functionality to support raw
TLS in addition to STARTTLS. The SSL keyword argument may now either
be NIL (no TLS), T or :STARTTLS (use STARTTLS as before) or :TLS for
raw TLS. What I did not find in his patch was the mentioned change in
CR/LF handling. I'd like to fix that, too, but I would want to do
that on the stream level rather than requiring the message to be all
in memory.
One could certainly spend more time with enhancing cl-smtp. Before
further hacking, I'd like to hear if anyone else has needs or plans
and if Jan would agree to update cl-smtp with these changes.
Please review and let me know what you think. Thanks!
-Hans
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cl-smtp.diff
Type: application/octet-stream
Size: 27221 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cl-smtp-devel/attachments/20080323/85f6e342/attachment.obj>
More information about the cl-smtp-devel
mailing list