Cpanel Relay Service

peganet

New Member
Nov 1, 2021
7
1
3
28
Hello there, We receive relay service via Mail.Baby. We output mail from our servers via mail.baby, but we are having difficulty controlling it. Can I position the Proxmox Mail Gateway product in between and control the mail output traffic through Proxmox? How do I configure it for this?
 
Yes, you can.

Cpanel --> Proxmox Mail GW​

Use ROUTERSTART​

Example:
Screenshot_14.png

Proxmox Mail GW --> Mail.Baby (Relay Service)​

Use Smarthost​

Example:

Screenshot_15.png
 
  • Like
Reactions: peganet
Hello,

First, You need copy template file main.cf.in from /var/lib/pmg/templates directory to /etc/pmg/templates directory( you need create it if not exist). For more details here:
https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#pmgconfig_template_engine

REMEMBER: DO NOT edit file /etc/postfix/main.cf directly!

Then, You can try to edit file /etc/pmg/templates/main.cf.in with this article:
https://stafwag.github.io/blog/blog/2018/03/04/postfix-smarthost-with-authentication/

On mail.baby document page, I found an article about this config here:
https://www.mail.baby/tips/mail-baby-on-plesk-linux/

Good luck!
 
  • Like
Reactions: peganet
Hello,

First, You need copy template file main.cf.in from /var/lib/pmg/templates directory to /etc/pmg/templates directory( you need create it if not exist). For more details here:
https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#pmgconfig_template_engine

REMEMBER: DO NOT edit file /etc/postfix/main.cf directly!

Then, You can try to edit file /etc/pmg/templates/main.cf.in with this article:
https://stafwag.github.io/blog/blog/2018/03/04/postfix-smarthost-with-authentication/

On mail.baby document page, I found an article about this config here:
https://www.mail.baby/tips/mail-baby-on-plesk-linux/

Good luck!

Hello,

I defined the postfix settings on PROXMOX Mail GW as mail.baby relay. Now I will do the cpanel settings, but I could not fully understand the "Use ROUTERSTART" part. Can you explain it? Also, how should the SPF record of domain addresses to send mail be, is there an example for this?
 
Hello,

I use this config to relay all emails from cPanel to PMG:

Code:
send_to_smart_host:
driver = manualroute
route_list = !+local_domains proxmox_mail_gateway
transport = dkim_remote_smtp

More informations here: https://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_manualroute_router.html

About SPF, you can follow here:
https://www.mail.baby/tips/spf

Hello there,

Can you describe the places I need to change? For example, if we consider that my proxmox server ip address is 1.1.1.1 and the hostname record is pmg.domain.com, how should the settings be?
 
Hello there,

Can you describe the places I need to change? For example, if we consider that my proxmox server ip address is 1.1.1.1 and the hostname record is pmg.domain.com, how should the settings be?
Hello,

Login to WHM --> Exim Configuration Manager --> Advanced Editor --> Search "Section: ROUTERSTART":
Screenshot_16.png

If your hostname pmg.domain.com point to 1.1.1.1 you can this config:
Code:
send_to_smart_host:
driver = manualroute
route_list = !+local_domains pmg.domain.com
transport = dkim_remote_smtp
 
  • Like
Reactions: peganet
Hello,

Login to WHM --> Exim Configuration Manager --> Advanced Editor --> Search "Section: ROUTERSTART":
View attachment 31025

If your hostname pmg.domain.com point to 1.1.1.1 you can this config:
Code:
send_to_smart_host:
driver = manualroute
route_list = !+local_domains pmg.domain.com
transport = dkim_remote_smtp

Hello there,

Thank you for your help. System running smoothly.
 
  • Like
Reactions: mbrother

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!