Personalizza la configurazione di Postfix per la consegna diretta

I’ve just set up a trial Discourse service using Digital Ocean and Mailgun for outgoing e-mail. I have a domain registered with a suitable MX record pointing to the Digital Ocean IP address. Outgoing and incoming e-mail works correctly with Discourse. Replies to topics generate outgoing e-mails to those with notifications set and test users can reply to these e-mails and the posts appear in Discourse. All good so far.

I tried to add the POSTCONF_always_bcc: option as above but it doesn’t seem to work - I suspect the ‘mail-receiver’ part of Discourse is unable to properly send the e-mail via Mailgun, even though the ‘app’ part knows how to - app.yml has the username and password of the Mailgun server in it but I’ve not seen any examples of how to put this information in the mail-receiver settings file.

I know the always_bcc option is being read and acted upon as if I type:

./launcher enter mail-receiver

then run

mailq

I can see a test message I sent message sitting on the queue trying to be delivered. In the “-Sender/Recipient-------” column it has the address from which my test message came, the words “(unknown mail transport error)” and then the e-mail address that I had in the always_bcc setting.

I had hoped to somehow filter incoming messages so that if a message was sent to postmaster@mydomain or admin@mydomain it would get resent out on the public internet, via Mailgun, to my gmail address and not sent to Discourse for processing. This may be what user @satonotdead was trying to do.

Any hints appreciated on how to do this!