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
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.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









