errorCodex - Computer Questions & Solutions Forum


  errorCodex - Computer Questions & Solutions Forum » Blue Screen » Basic How-tos

Basic How-tos Help Us Noobs by Sharing Your Wisdom

Reply
 
Thread Tools
  #1  
Old 23 November 2009, 20:26
Miraenda's Avatar
Miraenda Miraenda is offline
Mime Stalker
 
Join Date: Nov 2009
Location: Coralville Iowa
Age: 37
Posts: 75
Miraenda has disabled reputation
Default Setting up DKIMProxy on a cPanel Server

Installing DKIMProxy

In root shell on the server, run the following commands (you must be root user to do this):
Code:
wget http://downloads.sourceforge.net/dkimproxy/dkimproxy-1.2.tar.gz
tar xzf dkim*
cd dkim*
To install, you need one Perl Module that is missing called Net::Server, so install it using cPan:
Code:
/scripts/perlinstaller Net::Server
Now, create the working directory for the script to run from:
Code:
mkdir /usr/local/dkimproxy
Copy the contents for the extracted dkimproxy to this new directory:
Code:
cp -R /root/setup/dkimp*/* /usr/local/dkimproxy/
Change to the directory and install the script:
Code:
cd /usr/local/dkimproxy
./configure --prefix=/usr/local/dkimproxy
make && make install
Copy exim.conf and add some tweaks in it for DKIMProxy to work with it:
Code:
cp /etc/exim.conf /root/setup/exim.conf.bak090912
vi /etc/exim.conf
At top of file, add the following (use port 587 if that is your alternate SMTP port only):
Code:
local_interfaces = 0.0.0.0 : 127.0.0.1.10028
daemon_smtp_ports = 25 : 465 : 587
tls_on_connect_ports = 465
Change this line
Code:
tls_advertise_hosts = *
to
Code:
tls_advertise_hosts = 0.0.0.0.25
In routers section
Code:
dkimproxy:
driver = manualroute
condition = "${if eq {$interface_port}{10028} {0}{1}}"
transport = dkimproxy_smtp
route_list = "* localhost byname"
self = send
In transports section
Code:
dkimproxy_smtp:
driver = smtp
port = 10027
allow_localhost
Save the file with :wq and then copy the initialization script to /etc/init.d/:
Code:
cp /usr/local/dkimproxy/sample-dkim-init-script.sh /etc/init.d/dkimproxy
Create some needed directories (etc, bin) in the dkimproxy location:
Code:
cd /usr/local/dkimproxy
mkdir etc
mkdir bin
Copy the sample scripts to the necessary locations:
Code:
cp /usr/local/dkimproxy/scripts/dkimproxy_out.conf.example /usr/local/dkimproxy/etc/dkimproxy_out.conf
cp /usr/local/dkimproxy/scripts/dkimproxy_in.conf.example /usr/local/dkimproxy/etc/dkimproxy_in.conf
Add the dkim user to run dkimproxy processes:
Code:
adduser -d /usr/local/dkimproxy dkim
passwd -l dkim
Install Domain Keys using the cPanel script on your domains:
Code:
for i in `ls /var/cpanel/users` ;do /usr/local/cpanel/bin/domain_keys_installer $i ;done
Copy the key to the path needed for dkimproxy:
Code:
cp /var/cpanel/domain_key*/private/domain.com /usr/local/dkimproxy/etc/domain.com.key
Above, replace domain.com with your actual domain name.

Copy the rest of the dkim scripts to /usr/local/dkimproxy/bin, /usr/local/bin and /usr/bin:
Code:
cp /usr/local/dkimproxy/scripts/dkim* /usr/local/dkimproxy/bin/
cp /usr/local/dkimproxy/bin/dkim* /usr/local/bin/
cp /usr/local/dkimproxy/bin/dkim* /usr/bin/
Of note, I couldn't determine whether /usr/local/bin or /usr/bin is where these should be, and it doesn't seem to add the right scripts when installing, so I copied them to both basically above.

Edit the configuration script for outgoing dkimproxy mail:
Code:
vi /usr/local/dkimproxy/etc/dkimproxy_out.conf
In this part, change domain.com to your domain needing this setup:
Code:
# specify what domains DKIMproxy can sign for (comma-separated, no spaces)
domain domain.com
Change the path to where you installed the key above (this was /usr/local/dkimproxy/lunaradmin.com.key for my server):
Code:
# specify location of the private key
keyfile /usr/local/dkimproxy/etc/domain.com.key
Change from selector1 to default as this is what cPanel uses for the beginning of the DNS entry name for the DomainKeys record:
Code:
# specify the selector (i.e. the name of the key record put in DNS)
selector default
Save the file with :wq and then copy the fille:
Code:
cp /usr/local/dkimproxy/etc/dkimproxy_out.conf /usr/local/etc/
Finally, start dkimproxy service:
Code:
/etc/init.d/dkimproxy start
For some reason, the lib files didn't create on my one installation with this error occurring:
Code:
Starting outbound DKIM-proxy (dkimproxy.out)...Can't locate 
MySmtpServer.pm in @INC (@INC contains: ../lib /usr/lib/perl5/5.8.8/i686-linux 
/usr/lib/perl5/5.8.8 /usr/lib/perl5/site_perl/5.8.8/i686-linux 
/usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.5 
/usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 
/usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.1 
/usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl . ../lib) 
at /usr/local/dkimproxy/bin/dkimproxy.out line 45.
BEGIN failed--compilation aborted at /usr/local/dkimproxy/bin/dkimproxy.out 
line 45. failed.
So, copy the lib files to /usr/local/lib:
Code:
mkdir /usr/local/lib/MSDW && mkdir /usr/local/lib/MSDW/SMTP
cd /usr/local/dkimproxy/lib
cp LookupMap.pm /usr/local/lib/
cp MySmtpServer.pm /usr/local/lib/
cp MySmtpProxyServer.pm /usr/local/lib/
cd MSDW/SMTP
cp Client.pm /usr/lib/MSDW/SMTP
cp Server.pm /usr/lib/MSDW/SMTP
Then again try to start it:
Code:
/etc/init.d/dkimproxy start
It should start this time. Now, set up dkimproxy to auto start on reboots:
Code:
chkconfig dkimproxy on
Configure the paths for it to daemonize:
Code:
/usr/local/bin/dkimproxy.out --conf_file=/usr/local/etc/dkimproxy_out.conf --daemonize
Copy the exim initialization script:
Code:
cd /etc/init.d/ && cp exim /root/setup/exim.bak091123
Edit the script:
Code:
vi exim
Comment out the following lines:
Code:
if [ "`grep 'daemon_smtp_port.* 465' $EXIMCFG`" = "" ]; then
echo -n "Starting exim-smtps: "
# TMPDIR=/tmp $DAEMONIZE /usr/sbin/exim -tls-on-connect -bd -oX 465
# echo $RESULT
fi
Comment out these alternate port ones as well (if you have exim running on an alternate port like 587):
Code:
if [ "$ALTPORT" != "" -a "`grep \"daemon_smtp_port.* $ALTPORT\" /etc/exim.conf`" = "" ]; then

 echo -n “Starting exim-$ALTPORT: ”

# TMPDIR=/tmp $DAEMONIZE /usr/sbin/exim -bd -oX $ALTPORT

# echo $RESULT

 fi
Save the file with :wq, then stop and start exim:
Code:
/etc/init.d/exim stop
killall -9 exim
/etc/init.d/exim start
Send a test email to the authenticator script you did before at check-auth@verifier.port25.com to see if it passes for domain keys and dkim now. It should. You can also try the following other tests to check:
http://www.myiptest.com/staticpages/...Validator-test
http://www.brandonchecketts.com/emailtest.php

A lot of thanks go to the author at http://blog.wpkg.org/2009/03/28/sett...nkeys-signing/ who created a fantastic how-to that I used part of for this installation.
__________________
Miraenda
~ Ex uno disce omnes ~
Reply With Quote
  #2  
Old 3 December 2009, 05:44
mike.shine mike.shine is offline
Junior Member
 
Join Date: Dec 2009
Posts: 1
mike.shine is on a distinguished road
Default Re: Setting up DKIMProxy on a cPanel Server

Thanks for the detailed description. I was bit confused how to install this proxy in my dedicated server
Reply With Quote
  #3  
Old 3 December 2009, 07:14
Miraenda's Avatar
Miraenda Miraenda is offline
Mime Stalker
 
Join Date: Nov 2009
Location: Coralville Iowa
Age: 37
Posts: 75
Miraenda has disabled reputation
Default Re: Setting up DKIMProxy on a cPanel Server

You are very welcome. If you do have any issues at all, just let met know.
__________________
Miraenda
~ Ex uno disce omnes ~
Reply With Quote
  #4  
Old 21 March 2010, 12:47
cheikhrasta cheikhrasta is offline
Junior Member
 
Join Date: Mar 2010
Posts: 1
cheikhrasta is on a distinguished road
Default Re: Setting up DKIMProxy on a cPanel Server

sorry for my English, I followed all the steps and create and copy the files in / usr / local / lib / but I still have errors :
Starting inbound DKIM-proxy (dkimproxy.in)...Can't locate MySmtpServer.pm in @INC
(@INC contains: ../lib /usr/local/lib/perl5/5.8.8/i686-linux /usr/local/lib/
perl5/5.8.8 /usr/local/lib/perl5/site_perl/5.8.8/i686-linux /usr/local/lib/
perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl . ../lib) at
/usr/local/dkimproxy/bin/dkimproxy.in line 45.
BEGIN failed--compilation aborted at /usr/local/dkimproxy/bin/dkimproxy.in line 45.
failed.

thank you in advance for your help
Reply With Quote
  #5  
Old 22 March 2010, 08:07
Miraenda's Avatar
Miraenda Miraenda is offline
Mime Stalker
 
Join Date: Nov 2009
Location: Coralville Iowa
Age: 37
Posts: 75
Miraenda has disabled reputation
Default Re: Setting up DKIMProxy on a cPanel Server

Do a find in your installation of MySmtpServer.pm file and re-copy it into /usr/local/lib again. It should be in /usr/local/dkimproxy/lib/MySmtpServer.pm and /root/setup/dkimproxy-*/lib/MySmtpServer.pm locations.
__________________
Miraenda
~ Ex uno disce omnes ~
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 15:19.


A vBSkinworks Design
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.