diff --git a/mail/dspam-devel/Makefile b/mail/dspam-devel/Makefile index 527d2ba98d13..7e5304992aea 100644 --- a/mail/dspam-devel/Makefile +++ b/mail/dspam-devel/Makefile @@ -6,32 +6,61 @@ # PORTNAME= dspam -PORTVERSION= 2.10.6 +PORTVERSION= 3.0.0 CATEGORIES= mail MASTER_SITES= http://www.nuclearelephant.com/projects/dspam/sources/ MAINTAINER= rob@debank.tv COMMENT= A server-side bayesian spam filter -OPTIONS= MYSQL "Use MySQL and not db4 as database" off \ - MYSQL_COMPRESS "Compress dspam <--> MySQL" off \ - MAILDROP "Use Maildrop as local delivery agent" off \ - PROCMAIL "Use Procmail as local delivery agent" off \ - SENDMAIL_LDA "Use Sendmail as local delivery agent" off \ - SENDMAIL "Play nice with sendmail server" off \ - QMAIL "Play nice with Qmail mail server" off \ - ENABLE_SPAM_DELIVERY "Deliver messages marked as spam" off \ - SIGNATURE_HEADERS "Put signatures in the header" off \ - WHITELIST "Automatic whitelisting of ham" off \ - OPT_IN "Enable opt in" off \ - TRUSTED_USERS "Disable trusted user security" off \ - TUM "Enables TuM (Train until Mature)" off \ - ALT_BAYESIAN "Enable alternative-bayesian" on \ - NO_BIAS "Disable bias" off \ - VIRT_USERS "Enable virtual users (needs MYSQL)" off \ - SAT "Enable spam source address logging" off \ - VERBOSE_DEBUG "Enable verbose debug" off +## debug / log options +OPTIONS= NO_CONFLICTS "DO NOT conflict with dspam-2.x" off +OPTIONS+= DEBUG "Enable debug in DSPAM_HOME/dspam.debug" on +OPTIONS+= VERBOSE_DEBUG "Enable verbose debug" on +OPTIONS+= USER_LOGGING "Log mail in DSPAM_HOME/data/user/user.log" on +OPTIONS+= SYSTEM_LOGGING "Log some info DSPAM_HOME/system.log" on +OPTIONS+= SAT "Log spam source addresses to syslog" on +## algorithm options +OPTIONS+= TRAD_BAYES "Enable traditional-bayesian" on +OPTIONS+= ALT_BAYES "Enable alternative-bayesian" on +OPTIONS+= RNB "Use Robinson Naive Bayesian calculation" off +OPTIONS+= CHI_SQUARE "Use Fisher-Robinson Inv Chi-Square" off +OPTIONS+= RPV "Use Robinson technique combining p-values" off +OPTIONS+= TEST_COND "More inoculous results rapidly, risk fps" on +OPTIONS+= NO_BIAS "No bias toward innocent mail" off +OPTIONS+= WHITELIST "Automatic whitelisting of ham" off +OPTIONS+= NEURAL_NET "Enable neural networking" off +## run-time configure options +OPTIONS+= HOMEDIR_DOT "Dot files in ~/USER not DSPAM_HOME" off +OPTIONS+= OPT_IN "Run only for users with .dspam" off +OPTIONS+= TRUSTED_USERS "Disable trusted user security" off +## mesage taging options +OPTIONS+= SPAM_SUBJ "Prepends SPAM to the Subject header" off +OPTIONS+= SIGNATURE_HEADERS "Put signatures IDs in the header" off +OPTIONS+= WEBMAIL "Only with mail stored server-side" off +## back-end +OPTIONS+= MYSQL "Use MySQL as back-end" off +OPTIONS+= MYSQL_COMPRESS "Compress dspam <--> MySQL" off +OPTIONS+= POSTGRESQL73 "Use PostgreSQL v.7.3 as back-end" off +OPTIONS+= POSTGRESQL74 "Use PostgreSQL v.7.4 as back-end" off +#OPTIONS+= PGSQL_INSTALLED "You have the client installed" on +OPTIONS+= ORACLE "Use Oracle as back-end (BROKEN)" off +OPTIONS+= VIRT_USERS "Enable virtual users (needs SQL back-end)" off +OPTIONS+= LONG_USERNAMES "Usernames longer that OS supports" off +OPTIONS+= LARGE_SCALE "File structure for large scale" off +OPTIONS+= DOMAIN_SCALE "File structure for multiple domains" off +OPTIONS+= SIGNATURE_ATACH "Put server-side signature in mails" off +## MTA and LDA +OPTIONS+= MAILDROP "Use Maildrop as local delivery agent" off +OPTIONS+= PROCMAIL "Use Procmail as local delivery agent" off +OPTIONS+= SENDMAIL_LDA "Use Sendmail as local delivery agent" off +OPTIONS+= SENDMAIL "Play nice with sendmail server" off +OPTIONS+= QMAIL "Play nice with Qmail mail server" off +OPTIONS+= BROKEN_ERR_CODES "99=spam, 0=not, other=error (qmailish)" off +OPTIONS+= BROKEN_MTA "Enable if MTA pases ^M to dspam" off +OPTIONS+= CGI "Install CGI (pulls in apache)" off +USE_GNOME= pkgconfig USE_LIBTOOL_VER=13 USE_REINPLACE= yes INSTALLS_SHLIB= yes @@ -47,6 +76,115 @@ WITH_SIGNATURE_LIFE?= 28 .include +.if !defined(WITH_NO_CONFLICTS) +CONFLICTS= dspam-2* +.endif + +.if defined(WITHOUT_DEBUG) +CONFIGURE_ARGS+= --disable-debug +.else +CONFIGURE_ARGS+= --enable-debug +.endif + +.if defined(WITHOUT_VERBOSE_DEBUG) +CONFIGURE_ARGS+= --disable-verbose-debug +.else +CONFIGURE_ARGS+= --enable-verbose-debug +.endif + +.if defined(WITHOUT_SYSTEM_LOGGING) +CONFIGURE_ARGS+= --disable-system-logging +.else +CONFIGURE_ARGS+= --enable-logging +.endif + +.if defined(WITH_USER_LOGGING) +CONFIGURE_ARGS+= --disable-user-logging +.else +CONFIGURE_ARGS+= --enable-user-logging +.endif + +.if !defined(WITHOUT_SAT) +CONFIGURE_ARGS+= --enable-source-address-tracking +.endif + +.if defined(WITHOUT_TRAD_BAYES) +CONFIGURE_ARGS+= --disable-traditional-bayesian +.else +CONFIGURE_ARGS+= --enable-traditional-bayesian +.endif + +.if defined(WITHOUT_ALT_BAYES) +CONFIGURE_ARGS+= --disable-alternative-bayesian +.else +CONFIGURE_ARGS+= --enable-alternative-bayesian +.endif + +.if defined(WITH_RNB) +CONFIGURE_ARGS+= --enable-robinson +.else +CONFIGURE_ARGS+= --disable-robinson +.endif + +.if defined(WITH_CHI_SQUARE) +CONFIGURE_ARGS+= --enable-robinson +.else +CONFIGURE_ARGS+= --disable-robinson +.endif + +.if defined(WITH_RPV) +CONFIGURE_ARGS+= --enable-robinson-pvalues +.else +CONFIGURE_ARGS+= --disable-robinson-pvalues +.endif + +.if defined(WITHOUT_TEST_COND) +CONFIGURE_ARGS+= --disable-test-conditional +.else +CONFIGURE_ARGS+= --enable-test-conditional +.endif + +.if defined(WITH_NO_BIAS) +CONFIGURE_ARGS+= --disable-bias +.endif + +.if defined(WITH_WHITELIST) +CONFIGURE_ARGS+= --enable-whitelist +.endif + +.if defined(WITH_NEURAL_NET) +CONFIGURE_ARGS+= --enable-neural-networking +#NEED_M_P=. @${TRUE} +.endif + +.if defined(WITH_HOMEDIR_DOT) +CONFIGURE_ARGS+= --enable-homedir-dotfiles +.endif + +.if defined(WITH_OPT_IN) +CONFIGURE_ARGS+= --enable-opt-in +.endif + +.if defined(WITH_TRUSTED_USERS) +CONFIGURE_ARGS+= --disable-trusted-user-security +.endif + +.if defined(WITH_SPAM_SUBJ) +CONFIGURE_ARGS+= --enable-spam-subject +.endif + +.if defined(WITH_SIGNATURE_HEADERS) +CONFIGURE_ARGS+= --enable-signature-headers +.endif + +.if defined(SIGNATURE_ATACH) +CONFIGURE_ARGS+= --enable-signature-attachments +.endif + +.if defined(WITH_WEBMAIL) +CONFIGURE_ARGS+= --enable-webmail +.endif + .if defined(WITH_MYSQL) USE_MYSQL= yes CONFIGURE_ARGS+= --with-storage-driver=mysql_drv \ @@ -54,40 +192,86 @@ CONFIGURE_ARGS+= --with-storage-driver=mysql_drv \ --with-mysql-libraries=${LOCALBASE}/lib/mysql PLIST_SUB+= DB4="@comment " PLIST_SUB+= MYSQL="" +PLIST_SUB+= PGSQL="@comment " SED_SCRIPT+= -e 's,%%MYSQL%%,,g' -.else +SED_SCRIPT+= -e '/%%PGSQL%%/D' +.if defined(WITH_MYSQL_COMPRESS) +CONFIGURE_ARGS+= --enable-client-compression +.endif +.endif + +.if defined(WITH_POSTGRESQL73) +LIB_DEPENDS+= pq.3:${PORTSDIR}/databases/postgresql73 +#BUILD_DEPENDS= ${LIB_DEPENDS} +CONFIGURE_ARGS+= --with-storage-driver=pgsql_drv \ + --with-pgsql-includes=${LOCALBASE}/include \ + --with-pgsql-libraries=${LOCALBASE}/lib +PLIST_SUB+= DB4="@comment " +PLIST_SUB+= MYSQL="@comment " +PLIST_SUB+= PGSQL="" +SED_SCRIPT+= -e '/%%MYSQL%%/D' +SED_SCRIPT+= -e 's,%%PGSQL%%,,g' +.endif + +.if defined(WITH_POSTGRESQL74) +LIB_DEPENDS+= ecpg.4:${PORTSDIR}/databases/postgresql7 +#BUILD_DEPENDS= ${LIB_DEPENDS} +CONFIGURE_ARGS+= --with-storage-driver=pgsql_drv \ + --with-pgsql-includes=${LOCALBASE}/include \ + --with-pgsql-libraries=${LOCALBASE}/lib +PLIST_SUB+= DB4="@comment " +PLIST_SUB+= MYSQL="@comment " +PLIST_SUB+= PGSQL="" +SED_SCRIPT+= -e '/%%MYSQL%%/D' +SED_SCRIPT+= -e 's,%%PGSQL%%,,g' +.endif + +.if defined(WITH_ORACLE) +BUILD_DEPENDS+= ${LOCALBASE}/oracle7/rdbms/lib/libnlsrtl3.a:${PORTSDIR}/databases/oracle7-client +CONFIGURE_ARGS+= --with-storage-driver=ora_drv \ + --with-oracle-home= ${LOCALBASE}/oracle7 +.endif + +.if defined(WITH_VIRT_USERS) +CONFIGURE_ARGS+= --enable-virtual-users +#NEED_M_P=. @${TRUE} +.endif + +.if !(defined(WITH_MYSQL) || defined(WITH_POSTGRESQL73) || defined(WITH_POSTGRESQL74) || defined(WITH_ORACLE)) LIB_DEPENDS+= db41.1:${PORTSDIR}/databases/db41 CONFIGURE_ARGS+= --with-db4-includes=${LOCALBASE}/include/db41 PLIST_SUB+= DB4="" PLIST_SUB+= MYSQL="@comment " +PLIST_SUB+= PGSQL="@comment " SED_SCRIPT+= -e '/%%MYSQL%%/D' +SED_SCRIPT+= -e '/%%PGSQL%%/D' .endif -.if defined(WITH_MYSQL_COMPRESS) -CONFIGURE_ARGS+= --enable-client-compression +.if defined(WITH_LONG_USERNAMES) +CONFIGURE_ARGS+= --enable-long-usernames .endif - -.if defined(DSPAM_USERDIR) -CONFIGURE_ARGS+=--with-userdir=${DSPAM_USERDIR} -.else -CONFIGURE_ARGS+=--with-userdir=${PREFIX}/etc/dspam +.if defined(WITH_LARGE_SCALE) +CONFIGURE_ARGS+= --enable-large-scale +.endif +.if defined(WITH_DOMAIN_SCALE) +CONFIGURE_ARGS+= --enable-domain-scale .endif .if defined(WITH_MAILDROP) RUN_DEPENDS+= maildrop:${PORTSDIR}/mail/maildrop -CONFIGURE_ARGS+= --with-local-delivery-agent='${LOCALBASE}/bin/maildrop $u' +CONFIGURE_ARGS+= --with-delivery-agent='${LOCALBASE}/bin/maildrop $u' .endif .if defined(WITH_PROCMAIL) RUN_DEPENDS+= procmail:${PORTSDIR}/mail/procmail -CONFIGURE_ARGS+= --with-local-delivery-agent='${LOCALBASE}/bin/procmail $u' +CONFIGURE_ARGS+= --with-delivery-agent='${LOCALBASE}/bin/procmail $u' .endif .if defined(WITH_SENDMAIL_LDA) && exists(/usr/sbin/sendmail) -CONFIGURE_ARGS+= --with-local-delivery-agent=/usr/sbin/sendmail +CONFIGURE_ARGS+= --with-delivery-agent=/usr/sbin/sendmail .else .if defined(WITH_SENDMAIL_LDA) && exists(${LOCALBASE}/sbin/sendmail) -CONFIGURE_ARGS+= --with-local-delivery-agent='${LOCALBASE}/sbin/sendmail' +CONFIGURE_ARGS+= --with-delivery-agent='${LOCALBASE}/sbin/sendmail' .endif .endif @@ -99,59 +283,53 @@ CONFIGURE_ARGS+= --with-dspam-mode=4511 CONFIGURE_ARGS+= --with-dspam-mode=4511 .endif +.if defined(WITH_BROKEN_ERR_CODES) +CONFIGURE_ARGS+= --enable-broken-return-codes +.endif + +.if defined(DSPAM_HOME) +CONFIGURE_ARGS+=--with-dspam-home=${DSPAM_HOME} +.else +CONFIGURE_ARGS+=--with-dspam-home=${PREFIX}/etc/dspam +.endif + +# --with-dspam-home=DIR Specify directory where per-user dictionaries +# --with-dspam-home-mode=MODE Set access mode for DSPAM_HOME +# --with-dspam-home-owner=OWNER Set owner for DSPAM_HOME +# --with-dspam-home-group=GROUP Set group for DSPAM_HOME + +# --with-dspam-mode=MODE Set access mode for dspam binary +# --with-dspam-owner=OWNER Set owner for dspam binary +# --with-dspam-group=GROUP Set group for dspam binary + +.if defined(WITH_BROKEN_MTA) +CONFIGURE_ARGS+= --enable-broken-mta +.endif + .if defined(WITH_SIGNATURE_LIFE) CONFIGURE_ARGS+= --with-signature-life=${WITH_SIGNATURE_LIFE} .endif -.if defined(WITH_ENABLE_SPAM_DELIVERY) -CONFIGURE_ARGS+= --enable-spam-delivery +.if defined(QUARANTINE_AGENT) +CONFIGURE_ARGS+= --with-quarantine-agent=${QUARANTINE_AGENT} .endif -.if defined(WITH_SIGNATURE_HEADERS) -CONFIGURE_ARGS+= --enable-signature-headers +.if defined(WITH_CGI) +RUN_DEPENDS+= ${LOCALBASE}/etc/apache/httpd.conf:${PORTSDIR}/${APACHE_PORT} .endif -.if defined(WITH_WHITELIST) -CONFIGURE_ARGS+= --enable-whitelist -.endif +MAN1= dspam.1 dspam_clean.1 dspam_corpus.1 dspam_dump.1 dspam_merge.1 dspam_stats.1 -.if defined(WITH_OPT_IN) -CONFIGURE_ARGS+= --enable-opt-in -.endif +DOCS= CHANGELOG README LICENSE RELEASE.NOTES -.if defined(WITH_TRUSTED_USERS) -CONFIGURE_ARGS+= --disable-trusted-user-security -.endif - -.if defined(WITH_TUM) -CONFIGURE_ARGS+= --enable-tum -.endif - -.if defined(WITH_ALT_BAYESIAN) -CONFIGURE_ARGS+= --enable-alternative-bayesian -.endif - -.if defined(WITH_NO_BIAS) -CONFIGURE_ARGS+= --disable-bias -.endif - -.if defined(WITH_VIRT_USERS) -CONFIGURE_ARGS+= --enable-virtual-users -.endif - -.if defined(WITH_SAT) -CONFIGURE_ARGS+= --enable-source-address-tracking -.endif - -.if defined(WITH_VERBOSE_DEBUG) -CONFIGURE_ARGS+= --enable-verbose-debug -.endif - -DOCS= CHANGE README +pre-everything:: + @${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL post-patch: @${REINPLACE_CMD} -e 's|%%LIBTOOLFLAGS%%|${LIBTOOLFLAGS}|g ; \ s|-ldb-4.1|-ldb41|g' ${WRKSRC}/configure + @${REINPLACE_CMD} -e 's|(libdir)/pkgconfig|(prefix)/libdata/pkgconfig|' \ + ${WRKSRC}/Makefile.in pre-configure: .if defined(WITH_MAILDROP) && (defined(WITH_PROCMAIL) || defined(WITH_SENDMAIL_LDA)) @@ -162,17 +340,27 @@ pre-configure: @${ECHO_CMD} "You can only use one local delivery agent at once." @${FALSE} .endif -.if !defined(WITH_MYSQL) && (defined(WITH_MYSQL_COMPRESS) || defined(WITH_VIRT_USERS)) - @${ECHO_CMD} "You need MySQL support to use this feature." +.if defined(WITH_NEURAL_NET) && !(defined(WITH_MYSQL) || defined(WITH_POSTGRESQL)) + @${ECHO_CMD} "You need MySQL or POSTGRESQL to use neural networking." + @${FALSE} +.endif +.if defined(WITH_VIRT_USERS) && !(defined(WITH_MYSQL) || defined(WITH_POSTGRESQL) || defined(WITH_ORACLE)) + @${ECHO_CMD} "You need MySQL, POSTGRESQL or ORACLE for virtual users." @${FALSE} .endif post-install: .if defined(WITH_MYSQL) - @${MKDIR} ${EXAMPLESDIR} + @${MKDIR} ${EXAMPLESDIR}/mysql cd ${WRKSRC}/tools.mysql_drv && \ - ${INSTALL_DATA} README *.sql* ${EXAMPLESDIR} - ${INSTALL_DATA} ${FILESDIR}/mysql.data ${EXAMPLESDIR} + ${INSTALL_DATA} README *.sql* ${EXAMPLESDIR}/mysql + ${INSTALL_DATA} ${FILESDIR}/mysql.data ${EXAMPLESDIR}/mysql +.endif +.if defined(WITH_POSTGRESQL73) || defined(WITH_POSTGRESQL74) + ${MKDIR} ${EXAMPLESDIR}/pgsql + cd ${WRKSRC}/tools.pgsql_drv && \ + ${INSTALL_DATA} README *.sql ${EXAMPLESDIR}/pgsql + ${INSTALL_DATA} ${FILESDIR}/pgsql.data ${EXAMPLESDIR}/pgsql .endif .if !defined(NOPORTDOCS) @${MKDIR} ${DOCSDIR} diff --git a/mail/dspam-devel/distinfo b/mail/dspam-devel/distinfo index ebe59a898f95..fa51ea3a0540 100644 --- a/mail/dspam-devel/distinfo +++ b/mail/dspam-devel/distinfo @@ -1,2 +1,2 @@ -MD5 (dspam-2.10.6.tar.gz) = ddb40d26cc923d7569d48b3072e61715 -SIZE (dspam-2.10.6.tar.gz) = 485466 +MD5 (dspam-3.0.0.tar.gz) = f5b568e8fea50faaf4c1fcabee177934 +SIZE (dspam-3.0.0.tar.gz) = 575382 diff --git a/mail/dspam-devel/files/README.cgi b/mail/dspam-devel/files/README.cgi new file mode 100644 index 000000000000..b30a5c731821 --- /dev/null +++ b/mail/dspam-devel/files/README.cgi @@ -0,0 +1,56 @@ +DSPAM CGI + + The CGI will need to function in the same group as the dspam agent. The + best way to do this is to create a separate virtualhost specifically for + the CGI and assign it to run in the MTA group. If you are using + procmail, additional configuration may also be necessary (see below). + Please note that Apache users running under suexec do NOT take on the + identity of the groups specified in /etc/group; e.g. you will need to + specifically assign the group in httpd.conf. + + NOTE: Because the DSPAM CGI is a script, DSPAM will not retain its + privileges when called. If you are running procmail, this will become + a problem as procmail requires root privileges to deliver. The easiest + hack around this is to create a procmail.dspam binary and make it + setuid root, then make it executable only by the mail group (or + whatever group DSPAM and the CGI run in). + + The DSPAM CGI has a minimal configuration inside the dspam.cgi file. You'll + want to check dspam.cgi and make sure all of the settings are correct. In + most cases, the only that will be necessary to change are the large-scale + or domain-scale flags. + + Once you've configured the CGI, there are two more things you'll want to do. + + 1. Edit templates/nav_performance.html + Change yourdomain to whatever your domain name is. + + 2. Make any changes to default.prefs. This will set the default preferences + for a user. The file should reflect your system wide defaults. An example + is provided in the cgi directory... + +trainingMode=TEFT +spamAction=quarantine +spamSubject=[SPAM] +enableBNR=on +enableWhitelist=on + + By default, the parameters specified on the commandline will be used. If, + however, a preference is found for the particular user those preferences + will override the commandline. As a result, you'll want to remove any + options from the CGI that you don't want users to set (possibly + training mode). + + If you plan on leaving DSPAM's logging function enabled, and would like to + produce pretty graphs for your users, the graph.cgi script requires the + following be installed on your machine: + + - GD Graphics Library (http://www.boutell.com/gd/) + - The following PERL modules: + (http://www.perl.com/CPAN/modules/by-module/GD/) + + . GD + . GD-Graph3d + . GDGraph + . GDTextUtil + diff --git a/mail/dspam-devel/files/convert2db.sql b/mail/dspam-devel/files/convert2db.sql new file mode 100644 index 000000000000..489965907a7c --- /dev/null +++ b/mail/dspam-devel/files/convert2db.sql @@ -0,0 +1,16 @@ +alter table dspam_stats add spam_learned int; +alter table dspam_stats add innocent_learned int; +alter table dspam_stats add spam_classified int; +alter table dspam_stats add innocent_classified int; +update dspam_stats set spam_learned = total_spam; +update dspam_stats set innocent_learned = total_innocent; +update dspam_stats set spam_classified = 0, innocent_classified = 0; +alter table dspam_stats drop column total_spam; +alter table dspam_stats drop column total_innocent; +alter table dspam_stats add spam_misclassified int; +alter table dspam_stats add innocent_misclassified int; +update dspam_stats set spam_misclassified = spam_misses; +update dspam_stats set innocent_misclassified = false_positives; +alter table dspam_stats drop column spam_misses; +alter table dspam_stats drop column false_positives; + diff --git a/mail/dspam-devel/files/modify2db.sql b/mail/dspam-devel/files/modify2db.sql new file mode 100644 index 000000000000..d387b5c7ddf6 --- /dev/null +++ b/mail/dspam-devel/files/modify2db.sql @@ -0,0 +1,12 @@ +alter table dspam_stats add spam_learned int; +alter table dspam_stats add innocent_learned int; +alter table dspam_stats add spam_classified int; +alter table dspam_stats add innocent_classified int; +update dspam_stats set spam_learned = total_spam; +update dspam_stats set innocent_learned = total_innocent; +update dspam_stats set spam_classified = 0, innocent_classified = 0; +alter table dspam_stats add spam_misclassified int; +alter table dspam_stats add innocent_misclassified int; +update dspam_stats set spam_misclassified = spam_misses; +update dspam_stats set innocent_misclassified = false_positives; + diff --git a/mail/dspam-devel/files/patch-configure b/mail/dspam-devel/files/patch-configure index cb3208b2c46a..7cb007066691 100644 --- a/mail/dspam-devel/files/patch-configure +++ b/mail/dspam-devel/files/patch-configure @@ -1,6 +1,6 @@ ---- configure.orig Wed Nov 26 14:35:34 2003 -+++ configure Thu Dec 11 14:00:18 2003 -@@ -7548,7 +7548,8 @@ +--- configure.orig Sat Jul 3 14:18:37 2004 ++++ configure Sat Jul 3 14:18:57 2004 +@@ -19272,7 +19272,8 @@ # This can be used to rebuild libtool when needed diff --git a/mail/dspam-devel/files/patch-dspam.c b/mail/dspam-devel/files/patch-dspam.c deleted file mode 100644 index 8bfb29d8adc2..000000000000 --- a/mail/dspam-devel/files/patch-dspam.c +++ /dev/null @@ -1,17 +0,0 @@ ---- dspam.c.orig Fri Apr 2 18:34:35 2004 -+++ dspam.c Mon Apr 26 23:59:03 2004 -@@ -2422,12 +2422,12 @@ - i++; - } - } -- arg = strsep (&margs, " "); -- -+ - if (arg != NULL) { - strlcat (args, a, sizeof(args)); - strlcat (args, " ", sizeof (args)); - } -+ arg = strsep (&margs, " "); - } - free (mmargs); - diff --git a/mail/dspam-devel/files/pgsql.data b/mail/dspam-devel/files/pgsql.data new file mode 100644 index 000000000000..bb564dca581b --- /dev/null +++ b/mail/dspam-devel/files/pgsql.data @@ -0,0 +1,5 @@ +/tmp + +username +password +dspam_database diff --git a/mail/dspam-devel/files/sync_db.sql b/mail/dspam-devel/files/sync_db.sql new file mode 100644 index 000000000000..5c82303510e4 --- /dev/null +++ b/mail/dspam-devel/files/sync_db.sql @@ -0,0 +1,3 @@ + +update dspam_stats set spam_misclassified = spam_misses; +update dspam_stats set innocent_misclassified = false_positives; diff --git a/mail/dspam-devel/pkg-install b/mail/dspam-devel/pkg-install new file mode 100644 index 000000000000..8fc42a5f9027 --- /dev/null +++ b/mail/dspam-devel/pkg-install @@ -0,0 +1,61 @@ +#!/bin/sh + +# $FreeBSD$ + +PATH=/bin:/usr/sbin + +upgradewarning() { + echo " + + ======================================================================= + Note for upgraders from dspam 2.x: + - DSPAM v3.0 has moved many features out to the commandline. + - Other configure-time arguments have also been changed or removed. + - The stucture of the database (MySQL, Oracle) has changed; if you use + one of this the PKGMESSAGE will tell you what do do. + + While this port tries his best to help you with the upgrade, be sure + to read the section UPGRADING of 1.1 INSTALLATION - UPGRADING from + %%PORTDOCS%%/%%DOCSDIR%%/README. Because of the command line changes you + risk to have all you mails going to the bit bucket with NO WARNING. + + Do not continue to install this port without shutting down your MTA + and/or disableing dspam (if you are installing in the same place). + If you whant to test the new version, install with PREFIX != /usr/local + and choose WITH_NO_CONFLICT in the OPTIONS menu; otherwise if you have + dspam-2.x this port will refuse to install. + ======================================================================== +" + sleep 3 +} + +featurewarning() { + echo " + + Known issues: + - WITH_ORACLE does not configure. + - the new POP3 Proxy integration is not yet handled by this port + - due to the removal of postgress client port from the Ports Tree + if you choose WITH_POSTRESQL Postgresql 7.3 will be installed; if you + plan to use a server on another machine do: + 1. Hit Ctrl+C now. + 2. Go in databases/postgresql73 and make -DWITHOUT_SERVER install + 3. Come back here and make install + - the cgi part is really untested and requires more work + - some changes from rc2 are not merged yet. + - no supplimantary {platform|MTA|LDA,etc.} documentaion is in yet + - qmail dspam-filter (http://sourceforge.net/projects/dspam-filter/) + is not yet integrated. + " + sleep 8 +} + +case $2 in +PRE-INSTALL) + upgradewarning + featurewarning + ;; +UPGRADEWARNING) + upgradewarning + ;; +esac diff --git a/mail/dspam-devel/pkg-message b/mail/dspam-devel/pkg-message index e46eb3a3d43b..f7e266347c5a 100644 --- a/mail/dspam-devel/pkg-message +++ b/mail/dspam-devel/pkg-message @@ -1,8 +1,9 @@ + -------------------------------------------------------------------- See the file %%DOCSDIR%%/README for advice about how to configure DSPAM with your MTA. Examples are provided for - sendmail, exim and other popular MTAs. + sendmail, postfix, exim and courier MTAs. %%MYSQL%% %%MYSQL%% See %%EXAMPLESDIR%%/README %%MYSQL%% for instructions on how to configure MySQL @@ -12,5 +13,24 @@ %%MYSQL%% contains an example configuration for use with MySQL. %%MYSQL%% Edit and install as %%MYSQL%% %%LOCALBASE%%/etc/dspam/mysql.data +%%MYSQL%% To modify an existing database use and use it with dspam 3.x: +%%MYSQL%% [ TO BE WRITTEN ] +%%MYSQL%% dspam versions use +%%MYSQL%% %%EXAMPLESDIR%%/convert2db.sql +%%MYSQL%% To modify the existing db and use it with both versions use +%%MYSQL%% +%%MYSQL%% +%%MYSQL%% +%%PGSQL%% +%%PGSQL%% See %%EXAMPLESDIR%%/README +%%PGSQL%% for instructions on how to configure PostrgreSQL +%%PGSQL%% for use with DSPAM. +%%PGSQL%% [ To add a nice tutorial on this ] +%%PGSQL%% [ To add a nice turorial on converting a MySQL DB ] +%%PGSQL%% %%EXAMPLESDIR%%/pgsql.data +%%PGSQL%% contains an example configuration for use with PostgreSQL. +%%PGSQL%% Edit and install as +%%PGSQL%% %%LOCALBASE%%/etc/dspam/pgsql.data +%%PGSQL%% -------------------------------------------------------------------- diff --git a/mail/dspam-devel/pkg-plist b/mail/dspam-devel/pkg-plist index aa3ae292a98f..4c4b2f007d5f 100644 --- a/mail/dspam-devel/pkg-plist +++ b/mail/dspam-devel/pkg-plist @@ -1,28 +1,43 @@ -@comment $FreeBSD$ bin/dspam -bin/dspam_2mysql -bin/dspam_dump +bin/dspam_2sql bin/dspam_clean bin/dspam_corpus bin/dspam_crc +bin/dspam_dump bin/dspam_genaliases bin/dspam_merge -bin/dspam_ngstats -%%DB4%%bin/dspam_purge -%%DB4%%bin/dspam_purge.libdb4 bin/dspam_stats -%%DB4%%bin/libdb4_purge -lib/libdspam.so -lib/libdspam.so.4 +include/dspam/buffer.h +include/dspam/decode.h +include/dspam/error.h +include/dspam/lht.h +include/dspam/libdspam.h +include/dspam/libdspam_objects.h +include/dspam/nodetree.h +include/dspam/storage_driver.h lib/libdspam.a +lib/libdspam.so +lib/libdspam.so.5 +libdata/pkgconfig/dspam.pc +%%PORTDOCS%%%%DOCSDIR%%/CHANGELOG +%%PORTDOCS%%%%DOCSDIR%%/LICENSE %%PORTDOCS%%%%DOCSDIR%%/README -%%PORTDOCS%%%%DOCSDIR%%/CHANGE +%%PORTDOCS%%%%DOCSDIR%%/RELEASE.NOTES %%PORTDOCS%%@dirrm %%DOCSDIR%% -%%MYSQL%%%%EXAMPLESDIR%%/README -%%MYSQL%%%%EXAMPLESDIR%%/mysql.data -%%MYSQL%%%%EXAMPLESDIR%%/mysql_objects.sql.space.optimized -%%MYSQL%%%%EXAMPLESDIR%%/mysql_objects.sql.speed.optimized -%%MYSQL%%%%EXAMPLESDIR%%/purge.sql -%%MYSQL%%%%EXAMPLESDIR%%/virtual_users.sql +%%MYSQL%%%%EXAMPLESDIR%%/mysql/README +%%MYSQL%%%%EXAMPLESDIR%%/mysql/mysql.data +%%MYSQL%%%%EXAMPLESDIR%%/mysql/mysql_objects.sql.space.optimized +%%MYSQL%%%%EXAMPLESDIR%%/mysql/mysql_objects.sql.speed.optimized +%%MYSQL%%%%EXAMPLESDIR%%/mysql/purge.sql +%%MYSQL%%%%EXAMPLESDIR%%/mysql/virtual_users.sql +%%MYSQL%%@dirrm %%EXAMPLESDIR%%/mysql %%MYSQL%%@dirrm %%EXAMPLESDIR%% +%%PGSQL%%%%EXAMPLESDIR%%/pgsql/README +%%PGSQL%%%%EXAMPLESDIR%%/pgsql/pgsql.data +%%PGSQL%%%%EXAMPLESDIR%%/pgsql/pgsql_objects.sql +%%PGSQL%%%%EXAMPLESDIR%%/pgsql/purge.sql +%%PGSQL%%%%EXAMPLESDIR%%/pgsql/virtual_users.sql +%%PGSQL%%@dirrm %%EXAMPLESDIR%%/pgsql +%%PGSQL%%@dirrm %%EXAMPLESDIR%% +@dirrm include/dspam @dirrm etc/dspam diff --git a/mail/dspam/Makefile b/mail/dspam/Makefile index 527d2ba98d13..7e5304992aea 100644 --- a/mail/dspam/Makefile +++ b/mail/dspam/Makefile @@ -6,32 +6,61 @@ # PORTNAME= dspam -PORTVERSION= 2.10.6 +PORTVERSION= 3.0.0 CATEGORIES= mail MASTER_SITES= http://www.nuclearelephant.com/projects/dspam/sources/ MAINTAINER= rob@debank.tv COMMENT= A server-side bayesian spam filter -OPTIONS= MYSQL "Use MySQL and not db4 as database" off \ - MYSQL_COMPRESS "Compress dspam <--> MySQL" off \ - MAILDROP "Use Maildrop as local delivery agent" off \ - PROCMAIL "Use Procmail as local delivery agent" off \ - SENDMAIL_LDA "Use Sendmail as local delivery agent" off \ - SENDMAIL "Play nice with sendmail server" off \ - QMAIL "Play nice with Qmail mail server" off \ - ENABLE_SPAM_DELIVERY "Deliver messages marked as spam" off \ - SIGNATURE_HEADERS "Put signatures in the header" off \ - WHITELIST "Automatic whitelisting of ham" off \ - OPT_IN "Enable opt in" off \ - TRUSTED_USERS "Disable trusted user security" off \ - TUM "Enables TuM (Train until Mature)" off \ - ALT_BAYESIAN "Enable alternative-bayesian" on \ - NO_BIAS "Disable bias" off \ - VIRT_USERS "Enable virtual users (needs MYSQL)" off \ - SAT "Enable spam source address logging" off \ - VERBOSE_DEBUG "Enable verbose debug" off +## debug / log options +OPTIONS= NO_CONFLICTS "DO NOT conflict with dspam-2.x" off +OPTIONS+= DEBUG "Enable debug in DSPAM_HOME/dspam.debug" on +OPTIONS+= VERBOSE_DEBUG "Enable verbose debug" on +OPTIONS+= USER_LOGGING "Log mail in DSPAM_HOME/data/user/user.log" on +OPTIONS+= SYSTEM_LOGGING "Log some info DSPAM_HOME/system.log" on +OPTIONS+= SAT "Log spam source addresses to syslog" on +## algorithm options +OPTIONS+= TRAD_BAYES "Enable traditional-bayesian" on +OPTIONS+= ALT_BAYES "Enable alternative-bayesian" on +OPTIONS+= RNB "Use Robinson Naive Bayesian calculation" off +OPTIONS+= CHI_SQUARE "Use Fisher-Robinson Inv Chi-Square" off +OPTIONS+= RPV "Use Robinson technique combining p-values" off +OPTIONS+= TEST_COND "More inoculous results rapidly, risk fps" on +OPTIONS+= NO_BIAS "No bias toward innocent mail" off +OPTIONS+= WHITELIST "Automatic whitelisting of ham" off +OPTIONS+= NEURAL_NET "Enable neural networking" off +## run-time configure options +OPTIONS+= HOMEDIR_DOT "Dot files in ~/USER not DSPAM_HOME" off +OPTIONS+= OPT_IN "Run only for users with .dspam" off +OPTIONS+= TRUSTED_USERS "Disable trusted user security" off +## mesage taging options +OPTIONS+= SPAM_SUBJ "Prepends SPAM to the Subject header" off +OPTIONS+= SIGNATURE_HEADERS "Put signatures IDs in the header" off +OPTIONS+= WEBMAIL "Only with mail stored server-side" off +## back-end +OPTIONS+= MYSQL "Use MySQL as back-end" off +OPTIONS+= MYSQL_COMPRESS "Compress dspam <--> MySQL" off +OPTIONS+= POSTGRESQL73 "Use PostgreSQL v.7.3 as back-end" off +OPTIONS+= POSTGRESQL74 "Use PostgreSQL v.7.4 as back-end" off +#OPTIONS+= PGSQL_INSTALLED "You have the client installed" on +OPTIONS+= ORACLE "Use Oracle as back-end (BROKEN)" off +OPTIONS+= VIRT_USERS "Enable virtual users (needs SQL back-end)" off +OPTIONS+= LONG_USERNAMES "Usernames longer that OS supports" off +OPTIONS+= LARGE_SCALE "File structure for large scale" off +OPTIONS+= DOMAIN_SCALE "File structure for multiple domains" off +OPTIONS+= SIGNATURE_ATACH "Put server-side signature in mails" off +## MTA and LDA +OPTIONS+= MAILDROP "Use Maildrop as local delivery agent" off +OPTIONS+= PROCMAIL "Use Procmail as local delivery agent" off +OPTIONS+= SENDMAIL_LDA "Use Sendmail as local delivery agent" off +OPTIONS+= SENDMAIL "Play nice with sendmail server" off +OPTIONS+= QMAIL "Play nice with Qmail mail server" off +OPTIONS+= BROKEN_ERR_CODES "99=spam, 0=not, other=error (qmailish)" off +OPTIONS+= BROKEN_MTA "Enable if MTA pases ^M to dspam" off +OPTIONS+= CGI "Install CGI (pulls in apache)" off +USE_GNOME= pkgconfig USE_LIBTOOL_VER=13 USE_REINPLACE= yes INSTALLS_SHLIB= yes @@ -47,6 +76,115 @@ WITH_SIGNATURE_LIFE?= 28 .include +.if !defined(WITH_NO_CONFLICTS) +CONFLICTS= dspam-2* +.endif + +.if defined(WITHOUT_DEBUG) +CONFIGURE_ARGS+= --disable-debug +.else +CONFIGURE_ARGS+= --enable-debug +.endif + +.if defined(WITHOUT_VERBOSE_DEBUG) +CONFIGURE_ARGS+= --disable-verbose-debug +.else +CONFIGURE_ARGS+= --enable-verbose-debug +.endif + +.if defined(WITHOUT_SYSTEM_LOGGING) +CONFIGURE_ARGS+= --disable-system-logging +.else +CONFIGURE_ARGS+= --enable-logging +.endif + +.if defined(WITH_USER_LOGGING) +CONFIGURE_ARGS+= --disable-user-logging +.else +CONFIGURE_ARGS+= --enable-user-logging +.endif + +.if !defined(WITHOUT_SAT) +CONFIGURE_ARGS+= --enable-source-address-tracking +.endif + +.if defined(WITHOUT_TRAD_BAYES) +CONFIGURE_ARGS+= --disable-traditional-bayesian +.else +CONFIGURE_ARGS+= --enable-traditional-bayesian +.endif + +.if defined(WITHOUT_ALT_BAYES) +CONFIGURE_ARGS+= --disable-alternative-bayesian +.else +CONFIGURE_ARGS+= --enable-alternative-bayesian +.endif + +.if defined(WITH_RNB) +CONFIGURE_ARGS+= --enable-robinson +.else +CONFIGURE_ARGS+= --disable-robinson +.endif + +.if defined(WITH_CHI_SQUARE) +CONFIGURE_ARGS+= --enable-robinson +.else +CONFIGURE_ARGS+= --disable-robinson +.endif + +.if defined(WITH_RPV) +CONFIGURE_ARGS+= --enable-robinson-pvalues +.else +CONFIGURE_ARGS+= --disable-robinson-pvalues +.endif + +.if defined(WITHOUT_TEST_COND) +CONFIGURE_ARGS+= --disable-test-conditional +.else +CONFIGURE_ARGS+= --enable-test-conditional +.endif + +.if defined(WITH_NO_BIAS) +CONFIGURE_ARGS+= --disable-bias +.endif + +.if defined(WITH_WHITELIST) +CONFIGURE_ARGS+= --enable-whitelist +.endif + +.if defined(WITH_NEURAL_NET) +CONFIGURE_ARGS+= --enable-neural-networking +#NEED_M_P=. @${TRUE} +.endif + +.if defined(WITH_HOMEDIR_DOT) +CONFIGURE_ARGS+= --enable-homedir-dotfiles +.endif + +.if defined(WITH_OPT_IN) +CONFIGURE_ARGS+= --enable-opt-in +.endif + +.if defined(WITH_TRUSTED_USERS) +CONFIGURE_ARGS+= --disable-trusted-user-security +.endif + +.if defined(WITH_SPAM_SUBJ) +CONFIGURE_ARGS+= --enable-spam-subject +.endif + +.if defined(WITH_SIGNATURE_HEADERS) +CONFIGURE_ARGS+= --enable-signature-headers +.endif + +.if defined(SIGNATURE_ATACH) +CONFIGURE_ARGS+= --enable-signature-attachments +.endif + +.if defined(WITH_WEBMAIL) +CONFIGURE_ARGS+= --enable-webmail +.endif + .if defined(WITH_MYSQL) USE_MYSQL= yes CONFIGURE_ARGS+= --with-storage-driver=mysql_drv \ @@ -54,40 +192,86 @@ CONFIGURE_ARGS+= --with-storage-driver=mysql_drv \ --with-mysql-libraries=${LOCALBASE}/lib/mysql PLIST_SUB+= DB4="@comment " PLIST_SUB+= MYSQL="" +PLIST_SUB+= PGSQL="@comment " SED_SCRIPT+= -e 's,%%MYSQL%%,,g' -.else +SED_SCRIPT+= -e '/%%PGSQL%%/D' +.if defined(WITH_MYSQL_COMPRESS) +CONFIGURE_ARGS+= --enable-client-compression +.endif +.endif + +.if defined(WITH_POSTGRESQL73) +LIB_DEPENDS+= pq.3:${PORTSDIR}/databases/postgresql73 +#BUILD_DEPENDS= ${LIB_DEPENDS} +CONFIGURE_ARGS+= --with-storage-driver=pgsql_drv \ + --with-pgsql-includes=${LOCALBASE}/include \ + --with-pgsql-libraries=${LOCALBASE}/lib +PLIST_SUB+= DB4="@comment " +PLIST_SUB+= MYSQL="@comment " +PLIST_SUB+= PGSQL="" +SED_SCRIPT+= -e '/%%MYSQL%%/D' +SED_SCRIPT+= -e 's,%%PGSQL%%,,g' +.endif + +.if defined(WITH_POSTGRESQL74) +LIB_DEPENDS+= ecpg.4:${PORTSDIR}/databases/postgresql7 +#BUILD_DEPENDS= ${LIB_DEPENDS} +CONFIGURE_ARGS+= --with-storage-driver=pgsql_drv \ + --with-pgsql-includes=${LOCALBASE}/include \ + --with-pgsql-libraries=${LOCALBASE}/lib +PLIST_SUB+= DB4="@comment " +PLIST_SUB+= MYSQL="@comment " +PLIST_SUB+= PGSQL="" +SED_SCRIPT+= -e '/%%MYSQL%%/D' +SED_SCRIPT+= -e 's,%%PGSQL%%,,g' +.endif + +.if defined(WITH_ORACLE) +BUILD_DEPENDS+= ${LOCALBASE}/oracle7/rdbms/lib/libnlsrtl3.a:${PORTSDIR}/databases/oracle7-client +CONFIGURE_ARGS+= --with-storage-driver=ora_drv \ + --with-oracle-home= ${LOCALBASE}/oracle7 +.endif + +.if defined(WITH_VIRT_USERS) +CONFIGURE_ARGS+= --enable-virtual-users +#NEED_M_P=. @${TRUE} +.endif + +.if !(defined(WITH_MYSQL) || defined(WITH_POSTGRESQL73) || defined(WITH_POSTGRESQL74) || defined(WITH_ORACLE)) LIB_DEPENDS+= db41.1:${PORTSDIR}/databases/db41 CONFIGURE_ARGS+= --with-db4-includes=${LOCALBASE}/include/db41 PLIST_SUB+= DB4="" PLIST_SUB+= MYSQL="@comment " +PLIST_SUB+= PGSQL="@comment " SED_SCRIPT+= -e '/%%MYSQL%%/D' +SED_SCRIPT+= -e '/%%PGSQL%%/D' .endif -.if defined(WITH_MYSQL_COMPRESS) -CONFIGURE_ARGS+= --enable-client-compression +.if defined(WITH_LONG_USERNAMES) +CONFIGURE_ARGS+= --enable-long-usernames .endif - -.if defined(DSPAM_USERDIR) -CONFIGURE_ARGS+=--with-userdir=${DSPAM_USERDIR} -.else -CONFIGURE_ARGS+=--with-userdir=${PREFIX}/etc/dspam +.if defined(WITH_LARGE_SCALE) +CONFIGURE_ARGS+= --enable-large-scale +.endif +.if defined(WITH_DOMAIN_SCALE) +CONFIGURE_ARGS+= --enable-domain-scale .endif .if defined(WITH_MAILDROP) RUN_DEPENDS+= maildrop:${PORTSDIR}/mail/maildrop -CONFIGURE_ARGS+= --with-local-delivery-agent='${LOCALBASE}/bin/maildrop $u' +CONFIGURE_ARGS+= --with-delivery-agent='${LOCALBASE}/bin/maildrop $u' .endif .if defined(WITH_PROCMAIL) RUN_DEPENDS+= procmail:${PORTSDIR}/mail/procmail -CONFIGURE_ARGS+= --with-local-delivery-agent='${LOCALBASE}/bin/procmail $u' +CONFIGURE_ARGS+= --with-delivery-agent='${LOCALBASE}/bin/procmail $u' .endif .if defined(WITH_SENDMAIL_LDA) && exists(/usr/sbin/sendmail) -CONFIGURE_ARGS+= --with-local-delivery-agent=/usr/sbin/sendmail +CONFIGURE_ARGS+= --with-delivery-agent=/usr/sbin/sendmail .else .if defined(WITH_SENDMAIL_LDA) && exists(${LOCALBASE}/sbin/sendmail) -CONFIGURE_ARGS+= --with-local-delivery-agent='${LOCALBASE}/sbin/sendmail' +CONFIGURE_ARGS+= --with-delivery-agent='${LOCALBASE}/sbin/sendmail' .endif .endif @@ -99,59 +283,53 @@ CONFIGURE_ARGS+= --with-dspam-mode=4511 CONFIGURE_ARGS+= --with-dspam-mode=4511 .endif +.if defined(WITH_BROKEN_ERR_CODES) +CONFIGURE_ARGS+= --enable-broken-return-codes +.endif + +.if defined(DSPAM_HOME) +CONFIGURE_ARGS+=--with-dspam-home=${DSPAM_HOME} +.else +CONFIGURE_ARGS+=--with-dspam-home=${PREFIX}/etc/dspam +.endif + +# --with-dspam-home=DIR Specify directory where per-user dictionaries +# --with-dspam-home-mode=MODE Set access mode for DSPAM_HOME +# --with-dspam-home-owner=OWNER Set owner for DSPAM_HOME +# --with-dspam-home-group=GROUP Set group for DSPAM_HOME + +# --with-dspam-mode=MODE Set access mode for dspam binary +# --with-dspam-owner=OWNER Set owner for dspam binary +# --with-dspam-group=GROUP Set group for dspam binary + +.if defined(WITH_BROKEN_MTA) +CONFIGURE_ARGS+= --enable-broken-mta +.endif + .if defined(WITH_SIGNATURE_LIFE) CONFIGURE_ARGS+= --with-signature-life=${WITH_SIGNATURE_LIFE} .endif -.if defined(WITH_ENABLE_SPAM_DELIVERY) -CONFIGURE_ARGS+= --enable-spam-delivery +.if defined(QUARANTINE_AGENT) +CONFIGURE_ARGS+= --with-quarantine-agent=${QUARANTINE_AGENT} .endif -.if defined(WITH_SIGNATURE_HEADERS) -CONFIGURE_ARGS+= --enable-signature-headers +.if defined(WITH_CGI) +RUN_DEPENDS+= ${LOCALBASE}/etc/apache/httpd.conf:${PORTSDIR}/${APACHE_PORT} .endif -.if defined(WITH_WHITELIST) -CONFIGURE_ARGS+= --enable-whitelist -.endif +MAN1= dspam.1 dspam_clean.1 dspam_corpus.1 dspam_dump.1 dspam_merge.1 dspam_stats.1 -.if defined(WITH_OPT_IN) -CONFIGURE_ARGS+= --enable-opt-in -.endif +DOCS= CHANGELOG README LICENSE RELEASE.NOTES -.if defined(WITH_TRUSTED_USERS) -CONFIGURE_ARGS+= --disable-trusted-user-security -.endif - -.if defined(WITH_TUM) -CONFIGURE_ARGS+= --enable-tum -.endif - -.if defined(WITH_ALT_BAYESIAN) -CONFIGURE_ARGS+= --enable-alternative-bayesian -.endif - -.if defined(WITH_NO_BIAS) -CONFIGURE_ARGS+= --disable-bias -.endif - -.if defined(WITH_VIRT_USERS) -CONFIGURE_ARGS+= --enable-virtual-users -.endif - -.if defined(WITH_SAT) -CONFIGURE_ARGS+= --enable-source-address-tracking -.endif - -.if defined(WITH_VERBOSE_DEBUG) -CONFIGURE_ARGS+= --enable-verbose-debug -.endif - -DOCS= CHANGE README +pre-everything:: + @${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL post-patch: @${REINPLACE_CMD} -e 's|%%LIBTOOLFLAGS%%|${LIBTOOLFLAGS}|g ; \ s|-ldb-4.1|-ldb41|g' ${WRKSRC}/configure + @${REINPLACE_CMD} -e 's|(libdir)/pkgconfig|(prefix)/libdata/pkgconfig|' \ + ${WRKSRC}/Makefile.in pre-configure: .if defined(WITH_MAILDROP) && (defined(WITH_PROCMAIL) || defined(WITH_SENDMAIL_LDA)) @@ -162,17 +340,27 @@ pre-configure: @${ECHO_CMD} "You can only use one local delivery agent at once." @${FALSE} .endif -.if !defined(WITH_MYSQL) && (defined(WITH_MYSQL_COMPRESS) || defined(WITH_VIRT_USERS)) - @${ECHO_CMD} "You need MySQL support to use this feature." +.if defined(WITH_NEURAL_NET) && !(defined(WITH_MYSQL) || defined(WITH_POSTGRESQL)) + @${ECHO_CMD} "You need MySQL or POSTGRESQL to use neural networking." + @${FALSE} +.endif +.if defined(WITH_VIRT_USERS) && !(defined(WITH_MYSQL) || defined(WITH_POSTGRESQL) || defined(WITH_ORACLE)) + @${ECHO_CMD} "You need MySQL, POSTGRESQL or ORACLE for virtual users." @${FALSE} .endif post-install: .if defined(WITH_MYSQL) - @${MKDIR} ${EXAMPLESDIR} + @${MKDIR} ${EXAMPLESDIR}/mysql cd ${WRKSRC}/tools.mysql_drv && \ - ${INSTALL_DATA} README *.sql* ${EXAMPLESDIR} - ${INSTALL_DATA} ${FILESDIR}/mysql.data ${EXAMPLESDIR} + ${INSTALL_DATA} README *.sql* ${EXAMPLESDIR}/mysql + ${INSTALL_DATA} ${FILESDIR}/mysql.data ${EXAMPLESDIR}/mysql +.endif +.if defined(WITH_POSTGRESQL73) || defined(WITH_POSTGRESQL74) + ${MKDIR} ${EXAMPLESDIR}/pgsql + cd ${WRKSRC}/tools.pgsql_drv && \ + ${INSTALL_DATA} README *.sql ${EXAMPLESDIR}/pgsql + ${INSTALL_DATA} ${FILESDIR}/pgsql.data ${EXAMPLESDIR}/pgsql .endif .if !defined(NOPORTDOCS) @${MKDIR} ${DOCSDIR} diff --git a/mail/dspam/distinfo b/mail/dspam/distinfo index ebe59a898f95..fa51ea3a0540 100644 --- a/mail/dspam/distinfo +++ b/mail/dspam/distinfo @@ -1,2 +1,2 @@ -MD5 (dspam-2.10.6.tar.gz) = ddb40d26cc923d7569d48b3072e61715 -SIZE (dspam-2.10.6.tar.gz) = 485466 +MD5 (dspam-3.0.0.tar.gz) = f5b568e8fea50faaf4c1fcabee177934 +SIZE (dspam-3.0.0.tar.gz) = 575382 diff --git a/mail/dspam/files/README.cgi b/mail/dspam/files/README.cgi new file mode 100644 index 000000000000..b30a5c731821 --- /dev/null +++ b/mail/dspam/files/README.cgi @@ -0,0 +1,56 @@ +DSPAM CGI + + The CGI will need to function in the same group as the dspam agent. The + best way to do this is to create a separate virtualhost specifically for + the CGI and assign it to run in the MTA group. If you are using + procmail, additional configuration may also be necessary (see below). + Please note that Apache users running under suexec do NOT take on the + identity of the groups specified in /etc/group; e.g. you will need to + specifically assign the group in httpd.conf. + + NOTE: Because the DSPAM CGI is a script, DSPAM will not retain its + privileges when called. If you are running procmail, this will become + a problem as procmail requires root privileges to deliver. The easiest + hack around this is to create a procmail.dspam binary and make it + setuid root, then make it executable only by the mail group (or + whatever group DSPAM and the CGI run in). + + The DSPAM CGI has a minimal configuration inside the dspam.cgi file. You'll + want to check dspam.cgi and make sure all of the settings are correct. In + most cases, the only that will be necessary to change are the large-scale + or domain-scale flags. + + Once you've configured the CGI, there are two more things you'll want to do. + + 1. Edit templates/nav_performance.html + Change yourdomain to whatever your domain name is. + + 2. Make any changes to default.prefs. This will set the default preferences + for a user. The file should reflect your system wide defaults. An example + is provided in the cgi directory... + +trainingMode=TEFT +spamAction=quarantine +spamSubject=[SPAM] +enableBNR=on +enableWhitelist=on + + By default, the parameters specified on the commandline will be used. If, + however, a preference is found for the particular user those preferences + will override the commandline. As a result, you'll want to remove any + options from the CGI that you don't want users to set (possibly + training mode). + + If you plan on leaving DSPAM's logging function enabled, and would like to + produce pretty graphs for your users, the graph.cgi script requires the + following be installed on your machine: + + - GD Graphics Library (http://www.boutell.com/gd/) + - The following PERL modules: + (http://www.perl.com/CPAN/modules/by-module/GD/) + + . GD + . GD-Graph3d + . GDGraph + . GDTextUtil + diff --git a/mail/dspam/files/convert2db.sql b/mail/dspam/files/convert2db.sql new file mode 100644 index 000000000000..489965907a7c --- /dev/null +++ b/mail/dspam/files/convert2db.sql @@ -0,0 +1,16 @@ +alter table dspam_stats add spam_learned int; +alter table dspam_stats add innocent_learned int; +alter table dspam_stats add spam_classified int; +alter table dspam_stats add innocent_classified int; +update dspam_stats set spam_learned = total_spam; +update dspam_stats set innocent_learned = total_innocent; +update dspam_stats set spam_classified = 0, innocent_classified = 0; +alter table dspam_stats drop column total_spam; +alter table dspam_stats drop column total_innocent; +alter table dspam_stats add spam_misclassified int; +alter table dspam_stats add innocent_misclassified int; +update dspam_stats set spam_misclassified = spam_misses; +update dspam_stats set innocent_misclassified = false_positives; +alter table dspam_stats drop column spam_misses; +alter table dspam_stats drop column false_positives; + diff --git a/mail/dspam/files/modify2db.sql b/mail/dspam/files/modify2db.sql new file mode 100644 index 000000000000..d387b5c7ddf6 --- /dev/null +++ b/mail/dspam/files/modify2db.sql @@ -0,0 +1,12 @@ +alter table dspam_stats add spam_learned int; +alter table dspam_stats add innocent_learned int; +alter table dspam_stats add spam_classified int; +alter table dspam_stats add innocent_classified int; +update dspam_stats set spam_learned = total_spam; +update dspam_stats set innocent_learned = total_innocent; +update dspam_stats set spam_classified = 0, innocent_classified = 0; +alter table dspam_stats add spam_misclassified int; +alter table dspam_stats add innocent_misclassified int; +update dspam_stats set spam_misclassified = spam_misses; +update dspam_stats set innocent_misclassified = false_positives; + diff --git a/mail/dspam/files/patch-configure b/mail/dspam/files/patch-configure index cb3208b2c46a..7cb007066691 100644 --- a/mail/dspam/files/patch-configure +++ b/mail/dspam/files/patch-configure @@ -1,6 +1,6 @@ ---- configure.orig Wed Nov 26 14:35:34 2003 -+++ configure Thu Dec 11 14:00:18 2003 -@@ -7548,7 +7548,8 @@ +--- configure.orig Sat Jul 3 14:18:37 2004 ++++ configure Sat Jul 3 14:18:57 2004 +@@ -19272,7 +19272,8 @@ # This can be used to rebuild libtool when needed diff --git a/mail/dspam/files/patch-dspam.c b/mail/dspam/files/patch-dspam.c deleted file mode 100644 index 8bfb29d8adc2..000000000000 --- a/mail/dspam/files/patch-dspam.c +++ /dev/null @@ -1,17 +0,0 @@ ---- dspam.c.orig Fri Apr 2 18:34:35 2004 -+++ dspam.c Mon Apr 26 23:59:03 2004 -@@ -2422,12 +2422,12 @@ - i++; - } - } -- arg = strsep (&margs, " "); -- -+ - if (arg != NULL) { - strlcat (args, a, sizeof(args)); - strlcat (args, " ", sizeof (args)); - } -+ arg = strsep (&margs, " "); - } - free (mmargs); - diff --git a/mail/dspam/files/pgsql.data b/mail/dspam/files/pgsql.data new file mode 100644 index 000000000000..bb564dca581b --- /dev/null +++ b/mail/dspam/files/pgsql.data @@ -0,0 +1,5 @@ +/tmp + +username +password +dspam_database diff --git a/mail/dspam/files/sync_db.sql b/mail/dspam/files/sync_db.sql new file mode 100644 index 000000000000..5c82303510e4 --- /dev/null +++ b/mail/dspam/files/sync_db.sql @@ -0,0 +1,3 @@ + +update dspam_stats set spam_misclassified = spam_misses; +update dspam_stats set innocent_misclassified = false_positives; diff --git a/mail/dspam/pkg-install b/mail/dspam/pkg-install new file mode 100644 index 000000000000..8fc42a5f9027 --- /dev/null +++ b/mail/dspam/pkg-install @@ -0,0 +1,61 @@ +#!/bin/sh + +# $FreeBSD$ + +PATH=/bin:/usr/sbin + +upgradewarning() { + echo " + + ======================================================================= + Note for upgraders from dspam 2.x: + - DSPAM v3.0 has moved many features out to the commandline. + - Other configure-time arguments have also been changed or removed. + - The stucture of the database (MySQL, Oracle) has changed; if you use + one of this the PKGMESSAGE will tell you what do do. + + While this port tries his best to help you with the upgrade, be sure + to read the section UPGRADING of 1.1 INSTALLATION - UPGRADING from + %%PORTDOCS%%/%%DOCSDIR%%/README. Because of the command line changes you + risk to have all you mails going to the bit bucket with NO WARNING. + + Do not continue to install this port without shutting down your MTA + and/or disableing dspam (if you are installing in the same place). + If you whant to test the new version, install with PREFIX != /usr/local + and choose WITH_NO_CONFLICT in the OPTIONS menu; otherwise if you have + dspam-2.x this port will refuse to install. + ======================================================================== +" + sleep 3 +} + +featurewarning() { + echo " + + Known issues: + - WITH_ORACLE does not configure. + - the new POP3 Proxy integration is not yet handled by this port + - due to the removal of postgress client port from the Ports Tree + if you choose WITH_POSTRESQL Postgresql 7.3 will be installed; if you + plan to use a server on another machine do: + 1. Hit Ctrl+C now. + 2. Go in databases/postgresql73 and make -DWITHOUT_SERVER install + 3. Come back here and make install + - the cgi part is really untested and requires more work + - some changes from rc2 are not merged yet. + - no supplimantary {platform|MTA|LDA,etc.} documentaion is in yet + - qmail dspam-filter (http://sourceforge.net/projects/dspam-filter/) + is not yet integrated. + " + sleep 8 +} + +case $2 in +PRE-INSTALL) + upgradewarning + featurewarning + ;; +UPGRADEWARNING) + upgradewarning + ;; +esac diff --git a/mail/dspam/pkg-message b/mail/dspam/pkg-message index e46eb3a3d43b..f7e266347c5a 100644 --- a/mail/dspam/pkg-message +++ b/mail/dspam/pkg-message @@ -1,8 +1,9 @@ + -------------------------------------------------------------------- See the file %%DOCSDIR%%/README for advice about how to configure DSPAM with your MTA. Examples are provided for - sendmail, exim and other popular MTAs. + sendmail, postfix, exim and courier MTAs. %%MYSQL%% %%MYSQL%% See %%EXAMPLESDIR%%/README %%MYSQL%% for instructions on how to configure MySQL @@ -12,5 +13,24 @@ %%MYSQL%% contains an example configuration for use with MySQL. %%MYSQL%% Edit and install as %%MYSQL%% %%LOCALBASE%%/etc/dspam/mysql.data +%%MYSQL%% To modify an existing database use and use it with dspam 3.x: +%%MYSQL%% [ TO BE WRITTEN ] +%%MYSQL%% dspam versions use +%%MYSQL%% %%EXAMPLESDIR%%/convert2db.sql +%%MYSQL%% To modify the existing db and use it with both versions use +%%MYSQL%% +%%MYSQL%% +%%MYSQL%% +%%PGSQL%% +%%PGSQL%% See %%EXAMPLESDIR%%/README +%%PGSQL%% for instructions on how to configure PostrgreSQL +%%PGSQL%% for use with DSPAM. +%%PGSQL%% [ To add a nice tutorial on this ] +%%PGSQL%% [ To add a nice turorial on converting a MySQL DB ] +%%PGSQL%% %%EXAMPLESDIR%%/pgsql.data +%%PGSQL%% contains an example configuration for use with PostgreSQL. +%%PGSQL%% Edit and install as +%%PGSQL%% %%LOCALBASE%%/etc/dspam/pgsql.data +%%PGSQL%% -------------------------------------------------------------------- diff --git a/mail/dspam/pkg-plist b/mail/dspam/pkg-plist index aa3ae292a98f..4c4b2f007d5f 100644 --- a/mail/dspam/pkg-plist +++ b/mail/dspam/pkg-plist @@ -1,28 +1,43 @@ -@comment $FreeBSD$ bin/dspam -bin/dspam_2mysql -bin/dspam_dump +bin/dspam_2sql bin/dspam_clean bin/dspam_corpus bin/dspam_crc +bin/dspam_dump bin/dspam_genaliases bin/dspam_merge -bin/dspam_ngstats -%%DB4%%bin/dspam_purge -%%DB4%%bin/dspam_purge.libdb4 bin/dspam_stats -%%DB4%%bin/libdb4_purge -lib/libdspam.so -lib/libdspam.so.4 +include/dspam/buffer.h +include/dspam/decode.h +include/dspam/error.h +include/dspam/lht.h +include/dspam/libdspam.h +include/dspam/libdspam_objects.h +include/dspam/nodetree.h +include/dspam/storage_driver.h lib/libdspam.a +lib/libdspam.so +lib/libdspam.so.5 +libdata/pkgconfig/dspam.pc +%%PORTDOCS%%%%DOCSDIR%%/CHANGELOG +%%PORTDOCS%%%%DOCSDIR%%/LICENSE %%PORTDOCS%%%%DOCSDIR%%/README -%%PORTDOCS%%%%DOCSDIR%%/CHANGE +%%PORTDOCS%%%%DOCSDIR%%/RELEASE.NOTES %%PORTDOCS%%@dirrm %%DOCSDIR%% -%%MYSQL%%%%EXAMPLESDIR%%/README -%%MYSQL%%%%EXAMPLESDIR%%/mysql.data -%%MYSQL%%%%EXAMPLESDIR%%/mysql_objects.sql.space.optimized -%%MYSQL%%%%EXAMPLESDIR%%/mysql_objects.sql.speed.optimized -%%MYSQL%%%%EXAMPLESDIR%%/purge.sql -%%MYSQL%%%%EXAMPLESDIR%%/virtual_users.sql +%%MYSQL%%%%EXAMPLESDIR%%/mysql/README +%%MYSQL%%%%EXAMPLESDIR%%/mysql/mysql.data +%%MYSQL%%%%EXAMPLESDIR%%/mysql/mysql_objects.sql.space.optimized +%%MYSQL%%%%EXAMPLESDIR%%/mysql/mysql_objects.sql.speed.optimized +%%MYSQL%%%%EXAMPLESDIR%%/mysql/purge.sql +%%MYSQL%%%%EXAMPLESDIR%%/mysql/virtual_users.sql +%%MYSQL%%@dirrm %%EXAMPLESDIR%%/mysql %%MYSQL%%@dirrm %%EXAMPLESDIR%% +%%PGSQL%%%%EXAMPLESDIR%%/pgsql/README +%%PGSQL%%%%EXAMPLESDIR%%/pgsql/pgsql.data +%%PGSQL%%%%EXAMPLESDIR%%/pgsql/pgsql_objects.sql +%%PGSQL%%%%EXAMPLESDIR%%/pgsql/purge.sql +%%PGSQL%%%%EXAMPLESDIR%%/pgsql/virtual_users.sql +%%PGSQL%%@dirrm %%EXAMPLESDIR%%/pgsql +%%PGSQL%%@dirrm %%EXAMPLESDIR%% +@dirrm include/dspam @dirrm etc/dspam