Separate smtp settings for immediate and queued emails?

AI-generated summary

The discussion revolves around having separate SMTP settings for immediate and queued emails in Discourse. Chandra asks if it’s possible to route emails with different priorities using two separate SMTP server settings. pfaffman suggests that a plugin might be needed, but an alternative approach is to create a custom mail server that determines email importance and treats it accordingly. He also mentions that solving the problem with postfix would be his preferred approach, but it would be a complex task. codinghorror states that dual SMTP is not a feasible solution.

However, Chandra discovers a working setup using postfix’s header checks to filter and relay messages through different SMTP servers. This approach requires two SMTP servers for normal and priority emails, as well as edits to three postfix config files. A link to a relevant guide is provided: https://marcelog.github.io/articles/configure_postfix_forward_email_regex_subject_transport_relay.html.

Password emails and personal messages for example, need to be delivered immediately, while newsletter emails can be drip fed over a long period. Currently all emails fall in the same queue, if the mail server has a queue.

Is it possible to have two separate smtp server settings defined to route both types of mails with different priorities?

Thanks.

1 Like

You could need a plugin. It will not be easy.

If you really want to do that, I think your best bet would be to create your own mail server that accepted all the mail, determined if it was important or not, and then treated it accordingly.

3 Likes

Thanks. I use postfix with a queue right now.
I don’t think it offers prioritization of emails now or that it is going to be easy to do it.

1 Like

I have no idea how to do it with postfix, but if you were going to pay me money to solve the problem, I’d start on the postfix side, not the discourse side. (I am not asking for money to solve the problem; it’s the kind of job that I’d set an obscenely high
rate for and then be sorry when the client accepted the bid! :wink: )

6 Likes

No, this has been asked before, dual SMTP is not in the cards.

3 Likes

With chat notifications now adding to emails that need delivered quickly, I dug a little further and have a nice working setup. Here are some pointers to anyone who needs this.

Postfix offers header checks to filter and relay messages through different smtp servers. So all it needs is two smtp servers for normal & priority emails; and edits to three postfix config files.

2 Likes