The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

/scripts/posteximup help

Discussion in 'E-mail Discussions' started by morrow95, Apr 23, 2011.

  1. morrow95

    morrow95 Well-Known Member

    Joined:
    Oct 8, 2006
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    6
    Just added DKIM signing to all my emails. I needed to edit the exim.conf file from :

    Code:
    remote_smtp:
     driver = smtp
     interface = ${if exists {/etc/mailips}{${lookup{$sender_address_domain}lsearch*{/etc/mailips}{$value}{}}}{}}
     helo_data = ${if exists {/etc/mailhelo}{${lookup{$sender_address_domain}lsearch*{/etc/mailhelo}{$value}{$primary_hostn
     ame}}}{$primary_hostname}}
     
    to

    Code:
    remote_smtp:
     driver = smtp
     # dkim added below this - dkim_domain was changed from your_domain_name.com
     dkim_domain=$sender_address_domain
     dkim_selector=mail
     dkim_private_key=/usr/local/cpanel/etc/exim/dkim.key
     interface = ${if exists {/etc/mailips}{${lookup{$sender_address_domain}lsearch*{/etc/mailips}{$value}{}}}{}}
     helo_data = ${if exists {/etc/mailhelo}{${lookup{$sender_address_domain}lsearch*{/etc/mailhelo}{$value}{$primary_hostname}}}{$primary_hostname}}
     # before dkim added - interface = ${if exists {/etc/mailips}{${lookup{$sender_address_domain}lsearch*{/etc/mailips}{$value}{}}}{}}
     # before dkim added - helo_data = ${if exists {/etc/mailhelo}{${lookup{$sender_address_domain}lsearch*{/etc/mailhelo}{$value}{$primary_hostname}}}{$primary_hostname}}
     
    Works perfect! The problem is that this will be overwritten by cpanel/whm if there is an update. So I logged into WHM and was going to modify through the exim advanced editor, but it doesn't support changing of the remote_smtp transport. So I am stuck. I contacted cpanel support and they gave me the following response :

    1. Create a file named /scripts/posteximup

    2. Give it permissions of 0700

    3. Place code inside that file that will change the remote_smtp transport
    to the one you wish to use. This can be shell scripting, or perl, or any other
    language you'd like.

    The "posteximup" hook is documented here:

    Service script hooks
    cPanel & WHM Script Hooks

    Basically it just says this:

    ~~~~~~~~~~~~~~~~~~~~~~~~~~
    Runs after Exim updates
    (post /scripts/eximup)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~

    , but they cannot give me the code to do what I want. Doing such a thing is way over my head and languages I am not familiar with in any way.

    Can anyone help out with this? I need to keep DKIM intact, but if exim will just wipe it away on any upgrade that defeats the whole thing...

    thanks!
     
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    The easiest would like be to do something like this:

    1. Create a working version of /etc/exim.conf that contains the DKIM configuration you need
    2. Create a backup of what you did in step 1, for example:
    Code:
        mkdir /root/my_configs
        cp /etc/exim.conf /root/my_configs
    
    3. Create a simple posteximup that copies your backup to /etc. For example:
    Code:
        touch /scripts/posteximup
        chmod 0700 /scripts/posteximup
        echo "echo \"Updating exim.conf to support DKIM\"; cp -f /root/my_configs/exim.conf /etc"
    
    4. Test the script by running /scripts/eximup --force

    You should have the working exim.conf file in place after running eximup. There are some flaws with the above, like if we drastically alter the exim configuration files. However this easy method should work until we release version 11.32, with DKIM support.
     
  3. raghav

    raghav Registered

    Joined:
    Mar 7, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator

    "Followed all the steps this is the error i am getting/ Plz help

    Error message from syntax check:
    2012-03-06 23:26:02 Exim configuration error in line 1165 of /etc/exim.conf.buildtest.work.jRc38kDTtlB_xqHq:
    option setting expected: {$primary_hostname}}}"
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Hello,

    We have DKIM in 11.32, which is available in EDGE and CURRENT tiers. Have you considered switching to CURRENT tier to have DKIM added to exim without needing to make manual changes? You can change the tier in WHM > Update Preferences area.

    Thanks!
     
Loading...

Share This Page