jhickner / smtp-mail

Making it easy to send SMTP email from Haskell
BSD 3-Clause "New" or "Revised" License
75 stars 32 forks source link

Add TLS support #2

Closed joeyadams closed 9 years ago

joeyadams commented 11 years ago

I'm just creating this ticket to prevent duplicated work. I'm working on TLS support right now.

First, I'm going to make a pure interface to the SMTP functionality by using a beautiful dependency injection technique:

class Monad m => MonadSMTP m where
    putCrLf :: ByteString -> m ()
    throwSMTPError :: SMTPError -> m a

The protocol functions (sendCommand, etc.) will be in the MonadSMTP class:

sendCommand :: MonadSMTP m => Command -> m (ReplyCode, ByteString)

And the caller will provide a MonadSMTP instance that provides all of the requested capabilities.

This has several benefits:

jhickner commented 11 years ago

This sounds great! I'll be looking forward to your pull request.

alevy commented 10 years ago

I'm assuming this never happened?

shoooe commented 9 years ago

@alevy Apparently not.

jhickner commented 9 years ago

This fork has has seen a lot more development progress. Check it out, it may have what you're looking for: https://github.com/avieth/smtp-mail