Flolagale / mailin

Artisanal inbound emails for every web app
mailin.io
MIT License
1.95k stars 152 forks source link

Simplesmtp is deprecated!? #23

Closed xpepermint closed 9 years ago

xpepermint commented 10 years ago

From https://github.com/andris9/simplesmtp

This module is deprecated for production use. 
For SMTP servers use Haraka, for SMTP clients use smtp-connection.

We'll have to move to Haraka?

Flolagale commented 10 years ago

crotte.

xpepermint commented 10 years ago

I really liked the library but that's how things are :).

Flolagale commented 10 years ago

Haraka looks awesome but it is not that easy to setup. Mailin until now is really easy, so that would be a key feature. In addition, haraka has a powerful plugin infrastructure. An haraka plugin can hook up to the correct events. So, a possibility is mailin becoming a wrapper for haraka (like it is today a wrapper for simplesmtp somehow) + a plugin to listen to the correct events. Mailin would setup a nicely configured Haraka instance with all the correct plugins loaded. That sound awesome but that is also a major piece of work, almost a rewrite of the actual mailin.

xpepermint commented 10 years ago

Yeah, this will be fun. I'll try Haraka and see what options we have.

Flolagale commented 10 years ago

Nice!

xpepermint commented 10 years ago

@Flolagale Haraka looks veeeeeeeery promising but it would be an overkill for this project. Well... SMTP protocol will not change right ?:) I guess we could stick to that deprecated module until something new comes up.

Flolagale commented 10 years ago

Haha! Ok, thanks for having investigated.

heri16 commented 10 years ago

Switching over to Haraka would be nice. I'm sure the simplesmtp authors knew why the depreciation notice is a must, as simplesmtp will break in the next release of nodejs. We need a good game plan too.

2naive commented 10 years ago

So does anyone has ideas of what to do next? what to use? Fast look over Haraka lets me agree with @xpepermint that it's overkil.

Flolagale commented 10 years ago

I did not find any alternative other than Haraka. Haraka looks awesome and it would enable us to receive and forward emails, however dropping simplesmtp would require a consequent amount of work. @heri16 Why do you say that simplesmtp will break in the next release of node ?

heri16 commented 10 years ago

It's written in the depreciation notice that it will break in the next release.

steffenmllr commented 9 years ago

I ran into the same issue and tried Haraka - it was way to complicated and went with https://github.com/substack/node-smtp-protocol

Flolagale commented 9 years ago

Interesting, I'll have a look at it! For what type of project are you using it?

steffenmllr commented 9 years ago

Something like mailin, parse inbound emails for conversations by a unqiue email and posting them to a REST api. It's very basic so no dkim, spf or spam score and no attachments so far (started working on this yesterday)

Flolagale commented 9 years ago

Ok thanks.

steffenmllr commented 9 years ago

Here is a small gist what works for me, maybe you can use parts of it: https://gist.github.com/steffenmllr/cb3d3af13d0263adf268

@Flolagale Any recommendations for parsing the body and striping the text from the received mail or do you just put a response above this line hint in the mails?

Flolagale commented 9 years ago

I'm note sure to understand your question @steffenmllr. Do you mean in Mailin?

steffenmllr commented 9 years ago

I't about striping the email reply - something like https://github.com/pgherveou/mailstrip (which only supports english ...) but it looks like that this is not a feature in mailin so nevermind :)

Flolagale commented 9 years ago

Ok! mailstrip looks good. If you send the email which is replied to, @Verdier came up with a nice trick which works fairly well for html emails. All you have to do is to start the first email with a <a> mailto tag with nothing inside:

<a href="mailto:dummy@email.com"></a>
<div>
this is my first email
</div

So that the replied email looks like:

<div>
This is the reply to the previous email
</div>
<a href="mailto:dummy@email.com"></a>
<div>
this is my first email
</div

Then when you receive the reply, you can discard everything which is after this tag.

Since there is nothing in the tag, it is not visible and these mailto links are not stripped by most of the email clients. The email client support is hence fairly good.

If you do not send the first email yourself, unfortunately you'll have to write a lot of regexps and unit tests as in mailstrip ;-).

steffenmllr commented 9 years ago

Thanks, that is a really a nice trick! (nobody really wants to write regexps. Ever.)

zeroware commented 9 years ago

Or you can take over the simplesmtp project to be compatible with future version of node ... Haraka is good but as you said it's a heavy dependency.

zeroware commented 9 years ago

Nevermind the author of simplesmtp has created a successor : https://github.com/andris9/smtp-server

Flolagale commented 9 years ago

Awesome! Thanks for the news @zeroware.

8eecf0d2 commented 9 years ago

sooo, any news on https://github.com/andris9/smtp-server integration?

Flolagale commented 9 years ago

Not for the moment, but this is definitely something I'd like to do.

DavidTanner commented 9 years ago

PR #44 updates to use smtp-server

Flolagale commented 9 years ago

Thanks to @DavidTanner mailin 3.0.0+ now uses smtp-server and runs on node ^0.12.0 and iojs.