{"id":6069,"date":"2016-07-27T08:34:24","date_gmt":"2016-07-27T00:34:24","guid":{"rendered":"http:\/\/rmohan.com\/?p=6069"},"modified":"2016-07-27T08:34:24","modified_gmt":"2016-07-27T00:34:24","slug":"spamdyke","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=6069","title":{"rendered":"spamdyke"},"content":{"rendered":"<p>Installing spamdyke is pretty simple.<\/p>\n<p>1) Have a working qmail installation that runs from tcpserver.  If you can&#8217;t<br \/>\n   send and receive email, stop and go to one of the following sites for help:<br \/>\n     http:\/\/www.lifewithqmail.org\/<br \/>\n     http:\/\/www.qmailrocks.org\/<br \/>\n     http:\/\/www.qmailtoaster.org\/<\/p>\n<p>   If you&#8217;re using QmailToaster, there&#8217;s no need to install spamdyke by hand.<br \/>\n   Use the spamdyke installation script in QmailToaster Plus:<br \/>\n     http:\/\/qtp.qmailtoaster.com\/<\/p>\n<p>2) Unpack the spamdyke tarball somewhere convenient, like \/usr\/local\/src:<br \/>\n     cd \/some\/convenient\/path<br \/>\n     tar -xzvf spamdyke-x.y.z.tgz<\/p>\n<p>3) The fastest way is to change to the &#8220;spamdyke&#8221; directory, run &#8220;configure&#8221;<br \/>\n   and &#8220;make&#8221;.  spamdyke will be compiled with the default options.<br \/>\n     cd spamdyke-x.y.z\/spamdyke<br \/>\n     .\/configure<br \/>\n     make<br \/>\n   You shouldn&#8217;t see any errors or warnings.<\/p>\n<p>   On some older BSD and Solaris installations, the &#8220;configure&#8221; script will<br \/>\n   stop with an error message if the getopt_long() function cannot be found<br \/>\n   in a system library.  This typically means the libgnugetopt package is<br \/>\n   not available.  After it has been installed, the &#8220;configure&#8221; script will<br \/>\n   finish successfully.<\/p>\n<p>   The &#8220;configure&#8221; script accepts several parameters to add or remove some<br \/>\n   features from spamdyke:<br \/>\n     &#8211;disable-tls: compiles spamdyke without TLS support.  By default, the<br \/>\n       &#8220;configure&#8221; script will include TLS support if it detects the OpenSSL<br \/>\n       libraries are installed.<br \/>\n     &#8211;without-debug-output: compiles spamdyke without the messages produced<br \/>\n       when the &#8220;log-level&#8221; option is set to &#8220;debug&#8221;.  This reduces the size of<br \/>\n       the spamdyke binary.  By default, the &#8220;configure&#8221; script will add the<br \/>\n       debug messages to spamdyke.<br \/>\n     &#8211;with-excessive-output: compiles spamdyke with extra debugging output<br \/>\n       that is visible when the &#8220;log-level&#8221; option is set to &#8220;excessive&#8221;.<br \/>\n       By default, the &#8220;configure&#8221; script will not add the excessive messages<br \/>\n       to spamdyke.<br \/>\n     &#8211;with-debug-symbols: compiles spamdyke with debugging symbols so it can<br \/>\n       be debugged with a debugger like gdb.  This option does not add any<br \/>\n       visible output or features; it just increases the size of the spamdyke<br \/>\n       binary.  By default, the &#8220;configure&#8221; script will not add the debugging<br \/>\n       symbols to spamdyke.<br \/>\n     &#8211;with-address-sanitizer: compiles spamdyke with the &#8220;address sanitizer&#8221;<br \/>\n       extension to catch illegal memory accesses and buffer overflows.  This<br \/>\n       requires a fairly new version of gcc and the &#8220;asan&#8221; libraries.  It<br \/>\n       makes spamdyke much bigger and much slower; it is really only useful<br \/>\n       for developers to use during testing.<\/p>\n<p>4) Copy the spamdyke executable to \/usr\/local\/bin:<br \/>\n     su<br \/>\n     cp spamdyke \/usr\/local\/bin\/<\/p>\n<p>5) If you want spamdyke to perform recipient validation and reject invalid<br \/>\n   recipient addresses, you&#8217;ll need to compile and install the spamdyke-qrv<br \/>\n   command as well.<\/p>\n<p>   If you&#8217;re using Plesk, skip this step.  Plesk already does recipient<br \/>\n   validation for you.<\/p>\n<p>   Compiling is very easy:<br \/>\n     cd spamdyke-x.y.z\/spamdyke-qrv<br \/>\n     .\/configure<br \/>\n     make<\/p>\n<p>   Copy the spamdyke-qrv executable to \/usr\/local\/bin:<br \/>\n     su<br \/>\n     cp spamdyke-qrv \/usr\/local\/bin\/<br \/>\n     chown root \/usr\/local\/bin\/spamdyke-qrv<br \/>\n     chmod u+s \/usr\/local\/bin\/spamdyke-qrv<\/p>\n<p>   The &#8220;configure&#8221; script accepts several parameters to add or remove some<br \/>\n   features from spamdyke-qrv:<br \/>\n     &#8211;with-excessive-output: compiles spamdyke-qrv with extra debugging output<br \/>\n       that is visible when the &#8220;-v&#8221; flag is given twice.  By default, the<br \/>\n       &#8220;configure&#8221; script will not add the excessive messages to spamdyke-qrv.<br \/>\n     &#8211;without-vpopmail-support: compiles spamdyke-qrv without extra logic for<br \/>\n       supporting vpopmail installations.  Without the vpopmail logic,<br \/>\n       spamdyke-qrv will report every address within a local domain is valid,<br \/>\n       even when they would otherwise bounce.<br \/>\n     &#8211;with-debug-symbols: compiles spamdyke-qrv with debugging symbols so it<br \/>\n       can be debugged with a debugger like gdb.  This option does not add any<br \/>\n       visible output or features; it just increases the size of the<br \/>\n       spamdyke-qrv binary.  By default, the &#8220;configure&#8221; script will not add<br \/>\n       the debugging symbols to spamdyke-qrv.<br \/>\n     &#8211;with-address-sanitizer: compiles spamdyke-qrv with the &#8220;address<br \/>\n       sanitizer&#8221; extension to catch illegal memory accesses and buffer<br \/>\n       overflows.  This requires a fairly new version of gcc and the &#8220;asan&#8221;<br \/>\n       libraries.  It makes spamdyke-qrv much bigger and much slower; it is<br \/>\n       really only useful for developers to use during testing.<\/p>\n<p>6) Find the script that runs qmail when an incoming connection is established.<\/p>\n<p>   If you followed the instructions at lifewithqmail.org or qmailrocks.org, look<br \/>\n   for:<br \/>\n        \/service\/qmail-smtpd\/run<br \/>\n   If you installed qmail from the Debian packages, look for:<br \/>\n        \/etc\/init.d\/qmail<br \/>\n   If your qmail installation is part of Plesk, look for:<br \/>\n        \/etc\/xinetd.d\/smtp_psa<\/p>\n<p>   Insert the spamdyke command before the &#8220;\/var\/qmail\/bin\/qmail-smtpd&#8221; command.<br \/>\n   Something like this:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n   &#8230; \/usr\/local\/bin\/spamdyke -FLAGS \/var\/qmail\/bin\/qmail-smtpd 2>&#038;1<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n   Sometimes, the spamdyke command should be placed within a variable that is<br \/>\n   substituted into the command line.  If the script includes the rblsmtpd<br \/>\n   command, it can be replaced with the spamdyke command.<\/p>\n<p>   Older installations of qmail may use the &#8220;softlimit&#8221; program as well.  If you<br \/>\n   see softlimit in the sequence of commands, REMOVE IT!  softlimit causes many<br \/>\n   more problems than it could ever possibly solve.<\/p>\n<p>   Most spamdyke installations use a configuration file named<br \/>\n   &#8220;\/etc\/spamdyke.conf&#8221;. This file is not part of the spamdyke installation; it<br \/>\n   must be created by each administrator.  There is a sample configuration file<br \/>\n   in spamdyke&#8217;s &#8220;documentation&#8221; folder to help you get started.<\/p>\n<p>   Special note for Plesk users: starting relaylock before spamdyke can cause<br \/>\n   some (harmless) errors to be logged.  If spamdyke is started before relaylock,<br \/>\n   you shouldn&#8217;t see any errors:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n   server_args = -Rt0 \/usr\/local\/bin\/spamdyke -FLAGS \/var\/qmail\/bin\/relaylock \/var\/qmail\/bin\/qmail-smtpd \/var\/qmail\/bin\/smtp_auth \/var\/qmail\/bin\/true \/var\/qmail\/bin\/cmd5checkpw \/var\/qmail\/bin\/true<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n   Plesk users can also use spamdyke for their SMTPS connections by adding it to<br \/>\n   the \/etc\/xinetd.d\/smtps_psa file.  spamdyke&#8217;s configuration in that file will<br \/>\n   need to include the options &#8220;tls-level&#8221; (set to &#8220;smtps&#8221;) and<br \/>\n   &#8220;tls-certificate-file&#8221;.<\/p>\n<p>   Run the spamdyke command with the &#8220;-h&#8221; option to see the available options and<br \/>\n   read the README.html file for full details.  Please don&#8217;t enable a feature if<br \/>\n   you don&#8217;t understand what it does!<\/p>\n<p>7) Restart qmail.<\/p>\n<p>   If you followed the instructions at lifewithqmail.org or qmailrocks.org:<br \/>\n        svc -d \/service\/qmail-smtpd<br \/>\n        svc -u \/service\/qmail-smtpd<br \/>\n   If you installed qmail from the Debian packages:<br \/>\n        \/etc\/init.d\/qmail restart<br \/>\n   If your qmail installation is part of Plesk:<br \/>\n        killall -HUP xinetd<\/p>\n<p>8) That&#8217;s it!  Watch syslog for any errors (usually \/var\/log\/maillog; Plesk<br \/>\n   reconfigures syslog to save mail system logs in<br \/>\n   \/usr\/local\/psa\/var\/log\/maillog).<\/p>\n<p>9) OPTIONAL: Copy the policy.php.example page from the &#8220;documentation&#8221; directory<br \/>\n   to a website and change spamdyke&#8217;s &#8220;policy-url&#8221; option to give its URL.<br \/>\n   Be sure to test the contact form to make sure it sends messages correctly.<\/p>\n<p>Good luck!  If you have any issues or questions, please send a message to the<br \/>\nspamdyke-users mailing list (the subscription form is at www.spamdyke.org).<\/p>\n<p>The &#8220;utils&#8221; directory contains additional utilities that spamdyke does not<br \/>\nrequire.  If you wish to compile them, change to the &#8220;utils&#8221; folder, then run<br \/>\n&#8220;configure&#8221; and &#8220;make&#8221;:<br \/>\n     cd spamdyke-x.y.z\/utils<br \/>\n     .\/configure<br \/>\n     make<br \/>\nCopy the executables to appropriate locations as needed.  None of them need to<br \/>\nbe in any specific directory to work.  None of them require the presence of the<br \/>\nothers.  spamdyke does not need any of them to function.<\/p>\n<p>EXAMPLE:<br \/>\n  My server runs netqmail-1.05+TLS+viruscan and vpopmail, installed using the<br \/>\n  instructions from lifewithqmail.org.  I put the whitelist, blacklist and<br \/>\n  graylist files in the \/home\/vpopmail directory.  This is not required, I just<br \/>\n  put them there because the qmaild user already owns all the files there.<br \/>\n  Other good locations for them might be \/etc\/spamdyke or \/var\/qmail\/spamdyke.<\/p>\n<p>  My entire \/service\/qmail-smtpd\/run file is:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n#!\/bin\/sh<\/p>\n<p>QMAILDUID=`id -u qmaild`<br \/>\nNOFILESGID=`id -g qmaild`<br \/>\nMAXSMTPD=`cat \/var\/qmail\/control\/concurrencyincoming`<br \/>\nLOCAL=`head -1 \/var\/qmail\/control\/me`<\/p>\n<p>if [ -z &#8220;$QMAILDUID&#8221; -o -z &#8220;$NOFILESGID&#8221; -o -z &#8220;$MAXSMTPD&#8221; -o -z &#8220;$LOCAL&#8221; ]; then<br \/>\necho QMAILDUID, NOFILESGID, MAXSMTPD, or LOCAL is unset in<br \/>\necho \/var\/qmail\/supervise\/qmail-smtpd\/run<br \/>\nexit 1<br \/>\nfi<\/p>\n<p>if [ ! -f \/var\/qmail\/control\/rcpthosts ]; then<br \/>\necho &#8220;No \/var\/qmail\/control\/rcpthosts!&#8221;<br \/>\necho &#8220;Refusing to start SMTP listener because it&#8217;ll create an open relay&#8221;<br \/>\nexit 1<br \/>\nfi<\/p>\n<p>exec \/usr\/local\/bin\/tcpserver -v -R -l &#8220;$LOCAL&#8221; -x \/etc\/tcp.smtp.cdb -c &#8220;$MAXSMTPD&#8221; -u &#8220;$QMAILDUID&#8221; -g &#8220;$NOFILESGID&#8221; 0 smtp \\<br \/>\n        \/usr\/local\/bin\/spamdyke -f \/etc\/spamdyke.conf \\<br \/>\n        \/var\/qmail\/bin\/qmail-smtpd \/home\/vpopmail\/bin\/vchkpw \/bin\/true \\<br \/>\n        2>&#038;1<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>  My \/etc\/spamdyke.conf file contains:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nlog-level=info<br \/>\nmax-recipients=5<br \/>\nidle-timeout-secs=300<br \/>\ngraylist-dir=\/home\/vpopmail\/graylist<br \/>\ngraylist-level=always<br \/>\ngraylist-min-secs=300<br \/>\ngraylist-max-secs=1814400<br \/>\npolicy-url=http:\/\/my.policy.explanation.url\/<br \/>\nreject-empty-rdns<br \/>\nreject-unresolvable-rdns<br \/>\nreject-ip-in-cc-rdns<br \/>\nrdns-whitelist-file=\/home\/vpopmail\/whitelist_rdns<br \/>\nip-whitelist-file=\/home\/vpopmail\/whitelist_ip<br \/>\ngreeting-delay-secs=5<br \/>\ndns-blacklist-entry=b.barracudacentral.org<br \/>\ndns-blacklist-entry=zen.spamhaus.org<br \/>\nrhs-blacklist-entry=fresh.spameatingmonkey.com<br \/>\nreject-sender=no-mx<br \/>\nreject-recipient=same-as-sender<br \/>\ntls-certificate-file=\/var\/qmail\/control\/servercert.pem<br \/>\nconfig-dir=\/etc\/spamdyke.d<br \/>\nconfig-dir=\/etc\/spamdyke.d2<br \/>\nsender-blacklist-file=\/home\/vpopmail\/blacklist_senders<br \/>\nsender-whitelist-file=\/home\/vpopmail\/whitelist_senders<br \/>\nrecipient-blacklist-file=\/home\/vpopmail\/blacklist_recipients<br \/>\nrecipient-whitelist-file=\/home\/vpopmail\/whitelist_recipients<br \/>\nip-in-rdns-keyword-blacklist-file=\/home\/vpopmail\/blacklist_keywords<br \/>\nip-blacklist-file=\/home\/vpopmail\/blacklist_ip<br \/>\nrdns-blacklist-dir=\/home\/vpopmail\/blacklist_rdns.d<br \/>\nheader-blacklist-file=\/home\/vpopmail\/blacklist_headers<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Installing spamdyke is pretty simple.<\/p>\n<p>1) Have a working qmail installation that runs from tcpserver. If you can&#8217;t send and receive email, stop and go to one of the following sites for help: http:\/\/www.lifewithqmail.org\/ http:\/\/www.qmailrocks.org\/ http:\/\/www.qmailtoaster.org\/<\/p>\n<p> If you&#8217;re using QmailToaster, there&#8217;s no need to install spamdyke by hand. Use the spamdyke installation script in [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6069"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6069"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6069\/revisions"}],"predecessor-version":[{"id":6070,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6069\/revisions\/6070"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6069"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6069"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}