Hi All,
I also have a similar set up for my F&F mail service, fully configured with PMG, so, very simple:
SMTP mail from internet > PMG > LocalMailServer for incoming
and
LocalMailServer > PMG > SMTP2GO Smarthost (for verification etc.) for outgoing
Initially, I used PMG to receive only - and that worked fine for a few months.
I finally got around to sending via PMG. (Using all of the suggestions above)
... and good guide:
https://www.caretech.io/2018/10/06/how-to-use-proxmox-mail-gateway-with-an-authenticated-smarthost/
(But see below)
However, as soon as I did that, my mail server started complaining about authentication errors, and PMG started queuing the incoming mail.
---> Either I got the smarthost authenticating outgoing, and mail server rejecting incoming, or vice-versa.
Finally realised:
Some guides (I found 2) recommended the server auth file (in my case
smtp_auth
) should contain something like (but here using SMTP2GO):
mail.smtp2go.com:2525 SMTP2GOUsername:SMTP2GOPassword
...and this is what caused the either-or side effect. The auth file should contain
[mail.smtp2go.com]:2525 SMTP2GOUsername:SMTP2GOPassword
WITH the square brackets around the server name.
Had me pulling hair for hours. (And I can ill afford that!)
---
Note that there are 3 'levels' of the main.cf file:
/etc/postfix/main.cf
- you can try out your edits to this file by performing a systemctl restart postfix.
However, this file WILL get overwritten from
/etc/pmg/templates.main.cf.in
if you change any critical settings in the GUI that require a PMG restart
So, once you have tested your postfix changes, copy them over to
/etc/pmg/templates/main.cf.in
and they will then be copied back to
/etc/postfix/main.cf
on any PMG restart.
However! if you upgrade PMG, even the template file will get 'reset' to a default state.
So keep a copy of your changes and be prepared to re-apply them to the template after an update.
There is also another 'master' copy of the template in:
/var/lib/pmg/templates
. I understand this is used to create
/etc/pmg/templates/main.cf.in
I have not tried editing this file, but maybe doing so could give a more update-proof configuration. YMMV.