Incoming email via relay server
Hey everyone,
I've setup Proxmox Mail Gateway as a relay mail server with the intent of using it to filter both incoming and outgoing messages for spam. Currently, I have it working correctly with all my outgoing messages by using the smarthost setting in exim.
I can not get the incoming to work correctly. This is what I've tried:
- Set PMG to proxy via the "Relay Domains"
- Setup a transport for the same domain to the correct cPanel server (on its public IP)
- Changed the MX record of the domain I'm testing with to point at my PMG server
- Added the IP of my server into the /etc/alwaysrelay and /etc/trustedmailhosts files
- Disabled CXS
- Added the IP to the exim config via Trusted SMTP IP addresses
- Possibly more, I feel like I've tried so many things and none has worked.
The result I see with every config change is the message is bounced back to the sender email (a gmail account if that matters) immediately, then shortly after a second message.
The first message says:
[QUOTE]This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed
The second message has a LOT of header info added indicating it's been received by both my mail gateway and cPanel, but cPanel has sent it back. I haven't been able to find much in the logs that I've found helpful, but one message I see is [QUOTE] ** eric@mydomain.ca: Too many "Received" headers - suspected mail loop
Counting the duplicate subject lines it looks like the message is processed 10 times. No matter what I've tried I don't receive the message in the final domain and it's bounced back. Does anybody have any thoughts? Cheers, Eric
The second message has a LOT of header info added indicating it's been received by both my mail gateway and cPanel, but cPanel has sent it back. I haven't been able to find much in the logs that I've found helpful, but one message I see is [QUOTE] ** eric@mydomain.ca: Too many "Received" headers - suspected mail loop
Counting the duplicate subject lines it looks like the message is processed 10 times. No matter what I've tried I don't receive the message in the final domain and it's bounced back. Does anybody have any thoughts? Cheers, Eric
-
Hello Eric, You may find the following threads on their support forums to be helpful: How to Config exim with proxmox mail gateway Proxmox Mail Gateway as a relay mail server If that doesn't help, I recommend reaching out to their support team directly for assistance with the setup of their application. Thank you. 0 -
Thanks for the reply. Both of those threads are dealing with outbound mail, which I already have working. I don't have inbound mail working correctly. When I setup my inbound mail to use my PMG it does arrive at cPanel, but cPanel sends it back out. I believe the issue to be cPanel related and not PMG related, but I could be wrong. This is what I see in the logs when cPanel receives the test message I send SMTP connection from [167.***.***.200]:50148 (TCP/IP connection count = 1) 1ezbTk-0004Bh-KH <= my_sending_email@gmail.com H=(mailgateway.mydomain.ca) [167.***.***.200]:50148 P=esmtp S=4043 id=CAJShL5Cp+0Yxu91yPGTi5VnDZySuBAY-3fqwoMaV7N_rJpW31w@mail.gmail.com T="test subject" for my_receiving_email@mydomain.ca SMTP connection from (mailgateway.mydomain.ca) [167.***.***.200]:50148 closed by QUIT cwd=/var/spool/exim 3 args: /usr/sbin/exim -Mc 1ezbTk-0004Bh-KH 1ezbTk-0004Bh-KH 167.***.***.200 in /etc/alwaysrelay trusting from_h_domain of: gmail.com and from_h_localpart: my_sending_email 1ezbTk-0004Bh-KH SMTP connection outbound 1521868353 1ezbTk-0004Bh-KH gmail.com my_receiving_email@mydomain.ca 1ezbTk-0004Bh-KH => my_receiving_email@mydomain.ca R=lookuphost T=remote_smtp H=10.3.37.200 [10.3.37.200] C="250 2.0.0 Ok: queued as 179E48157D" 1ezbTk-0004Bh-KH Completed
It repeats the same exact message (with different ID's) 10 times, then stops. I see the headers in my Gmail message.0 -
Hello, Could you open a support ticket so we can take a closer look and rule out any issues with the cPanel & WHM software itself? Create Support Ticket - Version 68 Documentation - cPanel Documentation Thank you. 0 -
Thanks, I've opened a ticket 0 -
Hello, To update, it looks like updating the email routing setting from "Auto" to "Local" solved the issue. The "Local" setting ensures the domain name exists in the /etc/localdomains file and that local email is correctly routed to the cPanel server. Thank you. 0 -
Sorry to hijack this old topic, but I'm playing with the idea of setting up a PMG for my Cpanel server, like the op here. My question is - wouldn't you have to add all your domains manually to the PMG? For a Cpanel server with hundreds of domains, and resellers that add and remove domains on their own, wouldn't that cause a lot of management overhead? How do you deal with that? 0 -
Sorry to hijack this old topic, but I'm playing with the idea of setting up a PMG for my Cpanel server, like the op here. My question is - wouldn't you have to add all your domains manually to the PMG? For a Cpanel server with hundreds of domains, and resellers that add and remove domains on their own, wouldn't that cause a lot of management overhead? How do you deal with that?
And why would you want to do that anyway? Since PMG is essentially just Spam Assassin + ClamAV.0
Please sign in to leave a comment.
Comments
7 comments