PMG relay to external smtp

jose.mejia

New Member
Apr 17, 2023
2
0
1
how to configure pmg so that all outgoing mail is not delivered to the default gateway (internet) otherwise it is delivered to another external smtp
 
do you mean that your email server to be delivered to the PMG server then the PMG server to the client?
 
my email server delivers to the PMG, the PMG must deliver to a sandblast and the sandblast delivers the mail to the Internet.
 
I had a simmelar problem right now.
I thought setting the default relay would do the trick, but it doesn't.

The "deault relay" is only the default relay for assigned relay domains.
It sets the "relay_transport" variable in /etc/postfix/main.cf .

What you are looking for is the variable "relayhost" .
So you have to add to the /etc/postfix/main.cf something like:

Code:
relayhost=[mysandblast.computer.com]:25

I don't know if there is a possibilitie to add usernames ands passworts for transport destinations in the UI, but i don't think so.
So you would have to do that manualy. That would be "smtp_sasl_password_maps"
 
This standard feature should be incorporated into the UI.
At best it would be possible to have several outgoging SMTP-smart hosts, which are used according to the sending domain.
 
This standard feature should be incorporated into the UI.
Unless I'm misunderstanding the request - this is configured in GUI->Configuration->Mail Proxy->Relaying->Smart Host

sender-specific/sender-dependent relaying is not implemented (and it's not planned in the near future)

I hope this helps!
 
OK. I never heard the term smarthost, for the variable "relayhost" or "default_transport" .
Maybe just add "(default_transport)" behind smarthost, so people who are familar with a postfix config would recognice it.
Espacially if there is a "default relay" parameter in the same screen.

Maybe you can rethink the wording in this screen.

best regards
Benedikt

P.S.: Also "smarthost (extern mailserver)" would be a possibility.
 
Last edited:
OK. I never heard the term smarthost,
this is documented - quite visibly in the reference documentation:
https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#_mail_proxy_configuration
(you also get sent there if you click on the Help link in the edit window).

As I think quite a few users expect this behind smarthost (for me it was the first interpretation - maybe because I've been running the postfix config wizard in debian, which has named it that way for a long time...) - and since there have not been too many questions regarding this setting recently I think the current documentation works well.
 
  • Like
Reactions: keeka
I'm trying to get ProtonMail-Bridge working with PMG as it requires auth of username and password which gets passed to port 1025 using local IP of 127.0.0.1 in order for the SMTP portion to work.

I know I can edit the main.cf in postfix but that config file gets over written every time there is a change using the WebGUI. I guess I could get this part working and don't make any changes in the WebGUI that pretains to SMTP.

I've looked at the pmg.conf file and don't see where I can add something like smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd and place to add the username.

if I have to spell out the password in the config file then that's fine because it's all local anyway.
 
Unless I'm misunderstanding the request - this is configured in GUI->Configuration->Mail Proxy->Relaying->Smart Host

sender-specific/sender-dependent relaying is not implemented (and it's not planned in the near future)

I hope this helps!
Isn't this only for incoming emails? If proxy multiple domains, one need incoming relay rules and outoging relay rules including outgoying relay rules to smart host.

E.g. have have two domains, but the OUTGOING Mail has to be sent via two different SMTP relay hosts at to different domain providers.
 
  • Like
Reactions: Darkk

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!