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!

Rewrite From: header to match actual sender for 1 domain?

Discussion in 'E-mail Discussion' started by Benjamin D., Oct 20, 2017.

  1. Benjamin D.

    Benjamin D. Well-Known Member

    Joined:
    Jan 28, 2016
    Messages:
    116
    Likes Received:
    13
    Trophy Points:
    18
    Location:
    Canada
    cPanel Access Level:
    Root Administrator
    I've been using WHM > Exim Configuration Manager > "EXPERIMENTAL: Rewrite From: header to match actual sender" for years. It works quite good in disabling most of the inbound to outbound spoofing done by malicious scripts (and users?!)

    I'm now trying to accommodate a new client that has an Exchange Server and that thing smells like sh** from a mile away. It basically cannot send emails with anything else than a single username, effectively rendering that thing dependent on a semi-open email relaying host, which I'm not. What I mean is Exchange relies on the fact that a single username, say user@domain.com is supposed to be able to relay emails as user@domain.com, user2@domain.com, user3@domain.com all with the same account.

    The "Rewrite From: header" functionality breaks this retarded Exchange technology, so what we are now looking for a way to make that rule specific to some domains or selectively ignoring some domains as a way to accommodate this client... or I'll lose him and lose the money that goes with it.

    Anybody can help? Thx
     
  2. Benjamin D.

    Benjamin D. Well-Known Member

    Joined:
    Jan 28, 2016
    Messages:
    116
    Likes Received:
    13
    Trophy Points:
    18
    Location:
    Canada
    cPanel Access Level:
    Root Administrator
    Anybody? I'm looking maybe for a generic exim config rewrite rule to put after the "begin rewrite" line.

    REWRITE RULE CONDITIONS I NEED:

    1) PHP scripts cannot forge FROM headers as an account's domain the script does not originate from. This is already achieved by cPanel's "Rewrite From Header" tweak.

    2) External SMTP users can only forge FROM headers as the account's domain they authenticated with, meaning they could send FROM any-user@their-domain-only.com. This is against cPanel's "Rewrite From Header" tweak.

    So I need a combination/adaptation of cPanel's tweak to allow for the 2 conditions at once.

    ANY HELP IS APPRECIATED and could be beneficial to potentially thousands of other web server owners who are looking for the same solution.
     
  3. Benjamin D.

    Benjamin D. Well-Known Member

    Joined:
    Jan 28, 2016
    Messages:
    116
    Likes Received:
    13
    Trophy Points:
    18
    Location:
    Canada
    cPanel Access Level:
    Root Administrator
    Ended up writing my own Perl script and annexing it to WHM's "Rewrite From: header" tweak. Problem solved.
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    I'm glad to see you were able to find a suitable solution. Feel free to share the Perl script here if you'd like, as it may help other users facing the same situation.

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Benjamin D.

    Benjamin D. Well-Known Member

    Joined:
    Jan 28, 2016
    Messages:
    116
    Likes Received:
    13
    Trophy Points:
    18
    Location:
    Canada
    cPanel Access Level:
    Root Administrator
    I'll think about it. I'm not very impressed with the license fees I'm continually paying and yet having to actually learn how to code Perl and spend 2 hours to develop what looks like, to me, quite mandatory functionality lacking in WHM.
     
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