# $Id: Portfile 33389 2008-01-26 05:51:46Z ryandesign@macports.org $ PortSystem 1.0 # Probably does not work on Mac OSX < 10.3 name qmail-spamcontrol version 2.4.18 revision 1 categories mail maintainers yahoo.com:compconsultant platforms darwin description Qmail, enhanced Spamcontrol version long_description Robust, popular mail system. extract.mkdir yes variant relaymailfrom {} variant noreqbrackets {} variant noverp {} variant moreipme {} variant bigtodo {} homepage http://www.fehcom.de/qmail/spamcontrol.html master_sites http://www.fehcom.de/qmail/spamcontrol/:spamcontrol \ http://cr.yp.to/software/:qmail \ http://qmail.site2nd.org/:qmail \ http://qmail-mirror.jms1.net/:qmail \ http://www.qmail.org/:qmail \ distfiles qmail-1.03.tar.gz:qmail \ spamcontrol-2418_tgz.bin:spamcontrol \ checksums qmail-1.03.tar.gz \ md5 622f65f982e380dbe86e6574f3abcb7c \ sha1 18fb960481291a0503e93a94df3f6094edb7f27a \ rmd160 b851f273f1d365d38efd949b1efcf35768ffa30f \ spamcontrol-2418_tgz.bin \ md5 a5502cd69e573a2753e532bce8fb6c3a \ sha1 b2329b412a88ca2072cfb5e430efd1dd8a410b64 \ rmd160 4306ff09148332f5ad4cb1a3ff3b5da74b888d79 \ worksrcdir qmail-1.03 patchfiles patch-dns.c.diff \ patch-strerr_sys.c.diff configure.cflags -O2 -include /usr/include/errno.h -c build.target setup-patch destroot.cmd ./install-destroot # A whole lot of keepdirs, Qmail creates lots of required, empty directories destroot.keepdirs ${destroot}${prefix}/var/qmail/control \ ${destroot}${prefix}/var/qmail/users \ ${destroot}${prefix}/var/qmail/queue/pid \ ${destroot}${prefix}/var/qmail/queue/bounce \ ${destroot}${prefix}/var/qmail/queue/info/0 \ ${destroot}${prefix}/var/qmail/queue/info/1 \ ${destroot}${prefix}/var/qmail/queue/info/2 \ ${destroot}${prefix}/var/qmail/queue/info/3 \ ${destroot}${prefix}/var/qmail/queue/info/4 \ ${destroot}${prefix}/var/qmail/queue/info/5 \ ${destroot}${prefix}/var/qmail/queue/info/6 \ ${destroot}${prefix}/var/qmail/queue/info/7 \ ${destroot}${prefix}/var/qmail/queue/info/8 \ ${destroot}${prefix}/var/qmail/queue/info/9 \ ${destroot}${prefix}/var/qmail/queue/info/10 \ ${destroot}${prefix}/var/qmail/queue/info/11 \ ${destroot}${prefix}/var/qmail/queue/info/12 \ ${destroot}${prefix}/var/qmail/queue/info/13 \ ${destroot}${prefix}/var/qmail/queue/info/14 \ ${destroot}${prefix}/var/qmail/queue/info/15 \ ${destroot}${prefix}/var/qmail/queue/info/16 \ ${destroot}${prefix}/var/qmail/queue/info/17 \ ${destroot}${prefix}/var/qmail/queue/info/18 \ ${destroot}${prefix}/var/qmail/queue/info/19 \ ${destroot}${prefix}/var/qmail/queue/info/20 \ ${destroot}${prefix}/var/qmail/queue/info/21 \ ${destroot}${prefix}/var/qmail/queue/info/22 \ ${destroot}${prefix}/var/qmail/queue/remote/0 \ ${destroot}${prefix}/var/qmail/queue/remote/1 \ ${destroot}${prefix}/var/qmail/queue/remote/2 \ ${destroot}${prefix}/var/qmail/queue/remote/3 \ ${destroot}${prefix}/var/qmail/queue/remote/4 \ ${destroot}${prefix}/var/qmail/queue/remote/5 \ ${destroot}${prefix}/var/qmail/queue/remote/6 \ ${destroot}${prefix}/var/qmail/queue/remote/7 \ ${destroot}${prefix}/var/qmail/queue/remote/8 \ ${destroot}${prefix}/var/qmail/queue/remote/9 \ ${destroot}${prefix}/var/qmail/queue/remote/10 \ ${destroot}${prefix}/var/qmail/queue/remote/11 \ ${destroot}${prefix}/var/qmail/queue/remote/12 \ ${destroot}${prefix}/var/qmail/queue/remote/13 \ ${destroot}${prefix}/var/qmail/queue/remote/14 \ ${destroot}${prefix}/var/qmail/queue/remote/15 \ ${destroot}${prefix}/var/qmail/queue/remote/16 \ ${destroot}${prefix}/var/qmail/queue/remote/17 \ ${destroot}${prefix}/var/qmail/queue/remote/18 \ ${destroot}${prefix}/var/qmail/queue/remote/19 \ ${destroot}${prefix}/var/qmail/queue/remote/20 \ ${destroot}${prefix}/var/qmail/queue/remote/21 \ ${destroot}${prefix}/var/qmail/queue/remote/22 \ ${destroot}${prefix}/var/qmail/queue/local/0 \ ${destroot}${prefix}/var/qmail/queue/local/1 \ ${destroot}${prefix}/var/qmail/queue/local/2 \ ${destroot}${prefix}/var/qmail/queue/local/3 \ ${destroot}${prefix}/var/qmail/queue/local/4 \ ${destroot}${prefix}/var/qmail/queue/local/5 \ ${destroot}${prefix}/var/qmail/queue/local/6 \ ${destroot}${prefix}/var/qmail/queue/local/7 \ ${destroot}${prefix}/var/qmail/queue/local/8 \ ${destroot}${prefix}/var/qmail/queue/local/9 \ ${destroot}${prefix}/var/qmail/queue/local/10 \ ${destroot}${prefix}/var/qmail/queue/local/11 \ ${destroot}${prefix}/var/qmail/queue/local/12 \ ${destroot}${prefix}/var/qmail/queue/local/13 \ ${destroot}${prefix}/var/qmail/queue/local/14 \ ${destroot}${prefix}/var/qmail/queue/local/15 \ ${destroot}${prefix}/var/qmail/queue/local/16 \ ${destroot}${prefix}/var/qmail/queue/local/17 \ ${destroot}${prefix}/var/qmail/queue/local/18 \ ${destroot}${prefix}/var/qmail/queue/local/19 \ ${destroot}${prefix}/var/qmail/queue/local/20 \ ${destroot}${prefix}/var/qmail/queue/local/21 \ ${destroot}${prefix}/var/qmail/queue/local/22 \ ${destroot}${prefix}/var/qmail/queue/mess/0 \ ${destroot}${prefix}/var/qmail/queue/mess/1 \ ${destroot}${prefix}/var/qmail/queue/mess/2 \ ${destroot}${prefix}/var/qmail/queue/mess/3 \ ${destroot}${prefix}/var/qmail/queue/mess/4 \ ${destroot}${prefix}/var/qmail/queue/mess/5 \ ${destroot}${prefix}/var/qmail/queue/mess/6 \ ${destroot}${prefix}/var/qmail/queue/mess/7 \ ${destroot}${prefix}/var/qmail/queue/mess/8 \ ${destroot}${prefix}/var/qmail/queue/mess/9 \ ${destroot}${prefix}/var/qmail/queue/mess/10 \ ${destroot}${prefix}/var/qmail/queue/mess/11 \ ${destroot}${prefix}/var/qmail/queue/mess/12 \ ${destroot}${prefix}/var/qmail/queue/mess/13 \ ${destroot}${prefix}/var/qmail/queue/mess/14 \ ${destroot}${prefix}/var/qmail/queue/mess/15 \ ${destroot}${prefix}/var/qmail/queue/mess/16 \ ${destroot}${prefix}/var/qmail/queue/mess/17 \ ${destroot}${prefix}/var/qmail/queue/mess/18 \ ${destroot}${prefix}/var/qmail/queue/mess/19 \ ${destroot}${prefix}/var/qmail/queue/mess/20 \ ${destroot}${prefix}/var/qmail/queue/mess/21 \ ${destroot}${prefix}/var/qmail/queue/mess/22 post-extract { # Merge Spamcontrol source with Qmail source foreach file [glob ${worksrcpath}/qmail-1.03/*] { file rename ${file} ${worksrcpath}/ } file delete ${worksrcpath}/qmail-1.03 # Create an install file to install into destroot since # destroot is not supported by qmail file copy ${worksrcpath}/conf-qmail ${worksrcpath}/conf-destroot reinplace "s|\/var\/qmail|${destroot}${prefix}/var/qmail|g" \ ${worksrcpath}/conf-destroot file copy ${worksrcpath}/install.c ${worksrcpath}/install-destroot.c # Change live install dir to reflect the prefix reinplace "s|\/var\/qmail|${prefix}/var/qmail|g" \ ${worksrcpath}/conf-qmail } post-patch { # Apply Spamcontrol patches foreach file [glob ${worksrcpath}/*.patch] { system "patch -p2 <${file}" } # Append our commands for making a destroot installer # This is because Spamcontrol and us needs to patch Makefile system "cat ${filespath}/append-Makefile >>${worksrcpath}/Makefile" # Handle the variants, disable via source code define change foreach file [glob ${worksrcpath}/*c] { if {![variant_isset relaymailfrom]} { reinplace "s|^#define RELAYMAILFROM|\/* #define RELAYMAILFROM *\/|g" \ ${file} } if {[variant_isset noreqbrackets]} { reinplace "s|^#define REQBRACKETS|\/* #define REQBRACKETS *\/|g" \ ${file} } if {[variant_isset noverp]} { reinplace "s|^#define VERP|\/* #define VERP *\/|g" \ ${file} } if {![variant_isset moreipme]} { reinplace "s|^#define MOREIPME|\/* #define MOREIPME *\/|g" \ ${file} } if {![variant_isset bigtodo]} { reinplace "s|^#define BIGTODO|\/* #define BIGTODO *\/|g" \ ${file} } } } configure { # The qmail users and groups are required before compilation addgroup qmail gid=2107 addgroup nofiles gid=2108 adduser alias uid=7790 gid=[existsgroup nofiles] realname=Qmail-alias-user home=${prefix}/var/qmail shell=/usr/bin/true adduser qmaild uid=7791 gid=[existsgroup nofiles] realname=Qmail-SMTP-user home=${prefix}/var/qmail shell=/usr/bin/true adduser qmaill uid=7792 gid=[existsgroup nofiles] realname=Qmail-log-user home=${prefix}/var/qmail shell=/usr/bin/true adduser qmailp uid=7793 gid=[existsgroup nofiles] realname=Qmail-password-user home=${prefix}/var/qmail shell=/usr/bin/true adduser qmailq uid=7794 gid=[existsgroup qmail] realname=Qmail-queue-user home=${prefix}/var/qmail shell=/usr/bin/true adduser qmailr uid=7795 gid=[existsgroup qmail] realname=Qmail-remote-user home=${prefix}/var/qmail shell=/usr/bin/true adduser qmails uid=7796 gid=[existsgroup qmail] realname=Qmail-send-user home=${prefix}/var/qmail shell=/usr/bin/true } post-destroot { # Minimal requirements per Qmail install doc touch ${destroot}${prefix}/var/qmail/alias/.qmail-postmaster touch ${destroot}${prefix}/var/qmail/alias/.qmail-mailer-daemon touch ${destroot}${prefix}/var/qmail/alias/.qmail-root # Create the log directories file mkdir ${destroot}${prefix}/var/log/qmail file mkdir ${destroot}${prefix}/var/log/qmail/smtpd system "chown -R qmaill ${destroot}${prefix}/var/log/qmail" touch ${destroot}${prefix}/var/log/qmail/smtpd/.turd_qmail-spamcontrol # Copy example files file mkdir ${destroot}${prefix}/var/qmail/samples file copy ${filespath}/README.txt ${destroot}${prefix}/var/qmail/samples/README.txt file copy ${filespath}/qmailctl.in ${destroot}${prefix}/var/qmail/samples/qmailctl file copy ${filespath}/run.in ${destroot}${prefix}/var/qmail/samples/run file copy ${filespath}/qmail-send-run.in ${destroot}${prefix}/var/qmail/samples/qmail-send-run file copy ${filespath}/qmail-send-log-run.in ${destroot}${prefix}/var/qmail/samples/qmail-send-log-run file copy ${filespath}/qmail-smtpd-run.in ${destroot}${prefix}/var/qmail/samples/qmail-smtpd-run file copy ${filespath}/qmail-smtpd-log-run.in ${destroot}${prefix}/var/qmail/samples/qmail-smtpd-log-run reinplace "s%@PREFIX@%${prefix}%g" \ ${destroot}${prefix}/var/qmail/samples/qmailctl \ ${destroot}${prefix}/var/qmail/samples/run \ ${destroot}${prefix}/var/qmail/samples/qmail-send-run \ ${destroot}${prefix}/var/qmail/samples/qmail-send-log-run \ ${destroot}${prefix}/var/qmail/samples/qmail-smtpd-run \ ${destroot}${prefix}/var/qmail/samples/qmail-smtpd-log-run # Additional Spamcontrol files file mkdir ${destroot}${prefix}/var/qmail/scripts file copy ${worksrcpath}/qmail-alias2recipients ${destroot}${prefix}/var/qmail/scripts file copy ${worksrcpath}/qmail-users2recipients ${destroot}${prefix}/var/qmail/scripts file copy ${worksrcpath}/qmail-pwd2recipients ${destroot}${prefix}/var/qmail/scripts file copy ${worksrcpath}/qmail-vpopmail2recipients ${destroot}${prefix}/var/qmail/scripts file copy ${worksrcpath}/conf-spamcontrol ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/ucspi-ssl-0.70_ucspitls-0.4.patch_ ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/clamav-0.90.1_output.patch_ ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/Makefile.djbdns ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/badmailfrom ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/badmimetypes ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/badloadertypes ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/badrcptto ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/tarpitcount ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/install_spamcontrol.sh ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/README_spamcontrol.html ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/README.wildmat ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/README.moreipme ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/README.bigtodo ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/README.qmailqueue ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/README.bouncemaxbytes ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/README.doublebouncetrim ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/README.recipients ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/README.djbdns ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/INSTALL.spamcontrol ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/HISTORY.spamcontrol ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/FILES.spamcontrol ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/LICENSE.spamcontrol ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/TODO.spamcontrol ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/RELEASE_22.spamcontrol ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/RELEASE_23.spamcontrol ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/RELEASE_24.spamcontrol ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/LOGGING.spamcontrol ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/SMTPREPLY.spamcontrol ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/README.mav ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/PROPOSAL.mav ${destroot}${prefix}/var/qmail/doc file copy ${worksrcpath}/README.clamav ${destroot}${prefix}/var/qmail/doc # User must run this file copy ${worksrcpath}/config-fast ${destroot}${prefix}/var/qmail/scripts/config-fast # Per Qmail install doc file copy ${destroot}/${prefix}/var/qmail/boot/home ${destroot}${prefix}/var/qmail/rc # Variant causes more empty directories to be required if {[variant_isset bigtodo]} { touch ${destroot}${prefix}/var/qmail/queue/todo/0/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/todo/1/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/todo/2/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/todo/3/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/todo/4/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/todo/5/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/todo/6/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/todo/7/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/todo/8/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/todo/9/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/todo/10/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/todo/11/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/todo/12/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/todo/13/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/todo/14/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/todo/15/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/todo/16/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/todo/17/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/todo/18/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/todo/19/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/todo/20/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/todo/21/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/todo/22/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/intd/0/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/intd/1/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/intd/2/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/intd/3/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/intd/4/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/intd/5/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/intd/6/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/intd/7/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/intd/8/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/intd/9/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/intd/10/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/intd/11/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/intd/12/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/intd/13/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/intd/14/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/intd/15/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/intd/16/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/intd/17/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/intd/18/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/intd/19/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/intd/20/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/intd/21/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/intd/22/.turd_qmail-spamcontrol } if {![variant_isset bigtodo]} { touch ${destroot}${prefix}/var/qmail/queue/todo/.turd_qmail-spamcontrol touch ${destroot}${prefix}/var/qmail/queue/intd/.turd_qmail-spamcontrol } } post-install { ui_msg "\n To control qmail, highly recommended are the daemontools and ucspi-tcp ports A good reference for setting up qmail is www.lifewithqmail.org This port includes some sample files based on the Life with Qmail web site They can be found in ${prefix}/var/qmail/samples Also look at www.fehcom.de/qmail/spamcontrol.html for further info The fehcom site has doc for all the stuff added to the base qmail software There are numerous configuration options to qmail, please read all the doc! ****************************** For now, you must run ${prefix}/var/qmail/scripts/config-fast your.domain.name to set up some files for your mail server. your.domain.name should point to this machine you are installing qmail on. ****************************** \n" } post-activate { # Remove the turd files system "cd ${prefix}/var/qmail; find . -name .turd_qmail-spamcontrol -delete" system "rm ${destroot}${prefix}/var/log/qmail/smtpd/.turd_qmail-spamcontrol" }