Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request | SMTP Proxy #156

Open
KevinBLT opened this issue May 25, 2021 · 3 comments
Open

Request | SMTP Proxy #156

KevinBLT opened this issue May 25, 2021 · 3 comments

Comments

@KevinBLT
Copy link
Contributor

Hello again,

we had the idea of implementing a small "SMTP Proxy" with the following ideas behind it:

Image a company X and Users A,B,C.

Each of users will set there SMTP server as mail.company.domain where this "SMTP Server" is not the real one already but a proxy that can or does perform the following tasks:

  • Sign the the mail with the companies DKIM
  • Put the mail content into a CI Conform HTML Mail template with a custom section for user (Profile picture etc.)
  • If needed BCC the "head" of the worker/user
  • If needed schedule the mail for "review" so an admin can prevent the final sending or approve it

The mail will then be sent (in our case) to the "Real SMTP server" on localhost.
This will enable full featured sending/receiving in any mail client incl. mobile and every sent mail has
our custom design. Another idea was to read and find the "Reply levels" and convert them to a chat style optic with "bubbles" left and right.

Internally: Read the SMTP Lines from TCP put them into a "enough mail message" processs the message and send to the real smtp (using the same credentials).

I will use enough_mail for the sending part but was wondering if this would be a new good feature in general?

What would you say? I would be glad for some small cooperation with the SMTP protocol since you've already implemented the client side of it, I thought it would be a rather easy work to also understand the server side stuff (and I think alle those "decoding" stuff is already in here?)

Thanks in advance

Kevin

@robert-virkus
Copy link
Member

robert-virkus commented May 25, 2021

Hi Kevin,

I like. I had some similar ideas for the client side, ie I want to enable message templates for my mail app. Companies should then be able to specify their own templates similar to how they can already define their company wide signature in an extension.

The benefit of your solution is of course the enforcement and additional checks that can be done.

I wonder how to deal with clients and incoming messages at the same time, ie when you listen on the SMTP port and your DNS records point to the proxy server, then the proxy server will have to deal with incoming mails, too, doesn't it?

Have you checked out offerings like MailChimp, RapidMail or MailJet etc? AFAIK these are all different products than the one you have in mind, but they also share some similarities.

If you want, we can also discuss this 1:1, just send me a message to robert-at-enough-dot-de.

@robert-virkus
Copy link
Member

Forgot to write: converting the plain text part of a message should be simple enough, html messages could become somewhat trickier...

@KevinBLT
Copy link
Contributor Author

KevinBLT commented Jun 8, 2021

I will contact you! :-)

My idea would be to create an alternate Socket and use this in any mail client as SMTP server.
I don't want to to interfere with the mail server.
I personally prefer self hosted solution as we are currently moving all service to private hosting solutions for data security reasons (we have some special customers).

So far as I can see, when the SMTP is read, a mime message can be created by decodeding the data - to get the "normal html" - then use package:html to do some stuff or whatever and forward a standard message via enough_mail. The only "additional" tricky part is "act as smtp server" - so mainly the reverse side of what you've already done and then call decode where encode has been called before. When the message is read internally - we can use your lib as always and I think this fantastic. All our employees have to do is set the smtp server to another address/port and that's all. Image exchange, signing and reformating into our CI mail design is done automatically and every can keep using outlook/apple mail or what ever.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants