tadasajon

tadasajon

Receiving email in a phoenix 1.6 app -- should I switch out Swoosh and use Mailman?

I would like to write an elixir/phoenix application that simply serves as an email router – I want it to be able to receive emails, examine who they are from, and then forward them on to whoever they are supposed to go to based on a lookup table I will maintain.

In addition, I don’t want to have to pay for an external service such as SendGrid or some other third-party email solution.

I guess that gen_smtp is what people will advise me to reach for. Since I want to work in Elixir, it looks like I should try Mailman, since it advertises itself as an Elixir wrapper around gen_smtp.

So I’m curious whether I can use Phoenix 1.6 but swap out Swoosh for Mailman. Also, any advice about how I should go about this? Mailman doesn’t really have any docs to speak of. Or should I just try and stick with Swoosh, since I see that it also pulls in gen_smtp in it’s own mix.exs file?

Most Liked

derek-zhou

derek-zhou

Swoosh supports smtp transport too; I use it every day.

For what you are trying to do though, I think popular SMTP servers like exim4 already provides sophisticated rule based forwarding functionality. Polling the mailbox then forward the mail seems like a lot of work; plus I don’t think Swoosh can forward mails in a totally loss-less way. I am not sure about mailman but I would think any time you parsed the mail and re-serialize it out there will be some lost info and additional artifacts. In contrast, exim4 forwarding treats the mail blob as is.

Where Next?

Popular in Questions Top

Tee
can someone please explain to me how Enum.reduce works with maps
New
mgjohns61585
Could someone help me? I’m making my first elixir program, number guessing game. I can’t figure out how to convert the user’s guess from ...
New
shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
vac
Hi, I’m quite new in Elixir and I’m trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and I...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: The documentation above suggests that while ...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New

Other popular topics Top

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 29603 241
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
boundedvariable
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement