Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

SOLVED Incoming email via relay server

Discussion in 'E-mail Discussion' started by eric_fri, Mar 24, 2018.

  1. eric_fri

    eric_fri Member

    Joined:
    Mar 24, 2018
    Messages:
    5
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Canada
    cPanel Access Level:
    DataCenter Provider
    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:
    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
    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
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,794
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. eric_fri

    eric_fri Member

    Joined:
    Mar 24, 2018
    Messages:
    5
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Canada
    cPanel Access Level:
    DataCenter Provider
    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
    Code:
    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.
     
    #3 eric_fri, Mar 26, 2018
    Last edited by a moderator: Apr 2, 2018
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,794
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. eric_fri

    eric_fri Member

    Joined:
    Mar 24, 2018
    Messages:
    5
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Canada
    cPanel Access Level:
    DataCenter Provider
    Thanks, I've opened a ticket
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,794
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice