Is there any way to deliver all incoming email to discourse instead of rejecting it?


(Tobias Eigen) #1

Hi all! I’ve set up a new discourse instance for the first time in a while, and have enjoyed the process. The setup process has become so easy and pleasant.

I also set up Straightforward direct-delivery incoming mail and it’s flawless - nice work, @mpalmer and anyone else involved in making that happen!

I am interested in manually handling incoming email that is not otherwise configured to go to a category or group inbox. Is there any way to get that into discourse instead of rejecting it? E.g. to a user inbox, category topic or group inbox?


(Jay Pfaffman) #2

You don’t have a spam filter. You really, really don’t want to be accepting mail from all senders. If you don’t have staged users turned on, what you suggest might not be a disaster.

I was going to suggest that you do it on the postfix side, but then you’d lose the beauty of letting Discourse decide what to do with mail.

My guess is that a plugin could catch all mail that would bounce to direct it somewhere.


(Tobias Eigen) #3

Thanks, Jay! Yes, I understand how it works and agree with you in most circumstances. For now I am just setting things up and want to do alot of testing and figuring things out, and am not interested in sending bounce messages to the senders of spam. I want to see it and delete it as I see fit. I also don’t mind creating staged users who I can also delete as I see fit.


(Stephen) #4

I’m having flashbacks to that time a client asked if Discourse could be used to replace all staff mailboxes.

:dizzy_face:


(Matt Palmer) #5

Set the luser_relay Postfix configuration variable to the e-mail account you wish to send the mystery mail to, and set local_recipient_maps to the empty string. (cf this SF question). How to do that with the mail-receiver container I leave as an exercise in READMEing. :grinning:


(Tobias Eigen) #6

Thanks, Matt! I presume by

you mean reading this:

I tried a few things but am having a trouble making sense of the instructions there - can you tell me where to place the configuration variable in mail-receiver.yml and what it should look like?

Customised Postfix configuration

You can setup any Postfix configuration variables you need by setting env vars of the form POSTCONF_<var> with the value of the variable you want. For example, if you wanted to add a pre-delivery milter, you might use:

-e POSTCONF_smtpd_milters=192.0.2.42:12345

(Jay Pfaffman) #7

Probably more like reading GitHub - discourse/pups: Simple yaml based bootstrapper for Linux machines