Advertisement
d34n

ListMailPRO v1.88 DKIM Mod

Jan 8th, 2014
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. DKIM Wizard: http://www.port25.com/support/domainkeysdkim-wizard/
  2. - Enter a domain and choose a selector to get your public and private keys
  3. - Create the two DNS records containing the public key
  4. - Note: The test seen on that site won't work with LMP implementation. To test DKIM, send to Yahoo or gmail and check message source/headers for a DKIM "pass" message.
  5.  
  6. Get php-dkim: http://downloads.sourceforge.net/project/php-dkim/php-dkim/v1.0/php-dkim.zip
  7.  
  8. Unzip php-dkim.zip
  9.  
  10. Modify dkim-cfg-dist.php:
  11. a) Change this:
  12. //$open_SSL_pub="-----BEGIN PUBLIC KEY-----
  13. //... copy & paste your public key
  14. //-----END PUBLIC KEY-----" ;
  15. to this, with your public key:
  16. $open_SSL_pub="YOUR PUBLIC KEY" ;
  17.  
  18. b) Change this:
  19. //$open_SSL_priv="" ;
  20. to this, with your private key:
  21. $open_SSL_priv="YOUR PRIVATE KEY" ;
  22.  
  23. c) Change $DKIM_d='example.com' ; to contain your domain
  24.  
  25. d) Change $DKIM_s='test' ; to contain your selector
  26.  
  27. Rename dkim-cfg.dist.php to dkim-cfg.php
  28.  
  29. Copy dkim.php and dkim-cfg.php to ListMailPRO folder
  30.  
  31. Modify ListMailPRO:
  32.  
  33. *** admin.php Line 827-829 ***
  34.  
  35. // domail!!!
  36. require('dkim.php'); // DKIM MOD
  37. function domail($sendq='',$sendt='',$xid='',$batch){
  38.  
  39. *** admin.php Line 1387+ ***
  40.  
  41. $header .="X-LMP-Recipient: $email";
  42.  
  43. // BEGIN DKIM MOD
  44. if($smtpsend) $header .= "$crlf$crlf";
  45.  
  46. if(($htmsg && $htmail && !$textonly) || $fatt){
  47. $body = "This is a multipart message in MIME format.$crlf$crlf$body";
  48. }
  49. /* above changes were needed because we had incorrectly appended the 'multipart' string to the header not the body, which affected DKIM signing the proper body length with HTML mail */
  50. // END MOD
  51.  
  52. if($timedebug) $time = mtime() - $stime;
  53.  
  54. *** admin.php Line 1695+ ***
  55.  
  56. // data - both send methods
  57. if(!$error){
  58. // start data
  59. // BEGIN DKIM MOD
  60. $header = str_replace("\r\n","\n",$header);
  61. $header = str_replace("\n","\r\n",$header);
  62. $body = str_replace("\r\n","\n",$body);
  63. $body = str_replace("\n","\r\n",$body);
  64. $dkim = AddDKIM($header,$xsubj,$body);
  65. $header = $dkim.$header;
  66. $body = str_replace("\r\n.","\r\n..",$body);
  67. $themesg = $header.$body;
  68. $xmsg = str_replace('<','&lt;',$themesg);
  69. $xmsg = str_replace('>','&gt;',$xmsg);
  70. // END MOD
  71.  
  72. if($smtp_debug) logwrite($bugf,"> SENT DATA\r\n");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement