freebsd-ports/mail/qmail-scanner/files/patch-configure
Florent Thoumie eea57626a4 - Fix spamd socket option parsing.
PR:		ports/78102
Submitted by:	Will Saxon <wills@housing.ufl.edu>
Approved by:	maintainer timeout (2 months)
2005-06-01 19:23:58 +00:00

146 lines
6.3 KiB
Plaintext

--- ./configure.orig Mon Oct 18 21:26:55 2004
+++ ./configure Mon Jan 31 09:07:22 2005
@@ -1,13 +1,6 @@
#!/bin/sh
#
-#Pipe into bash if it's present
-
-if [ "`bash --version 2>&1|grep 'GNU bash'`" != "" -a "$BASH_VERSION" = "" ]; then
- exec bash $0 $*
- exit
-fi
-
umask 007
OLD_LANG="$LANG"
@@ -51,6 +44,12 @@
#reset all English to en_GB
QSLANG="en_GB"
fi
+
+QSLANG=`echo $QSLANG|sed 's/\..*//'`
+if [ "$QSLANG" = "ja_JP" ]; then
+ #reset all Japanese to ja_JP.EUC
+ QSLANG="ja_JP.EUC"
+fi
if [ ! -d "./locale/$QSLANG" ]; then
echo "
@@ -87,7 +86,8 @@
QUARANTINE_PASSWORD_PROTECTED="0"
DESCRIPTIVE_HEADERS="0"
NOTIFY_ADDRESSES="psender,nmlvadm"
-USERNAME="$USER"
+ADMIN_MAIL="$USER"
+ADMIN_REALNAME="System Anti-Virus Administrator"
MANUAL_INSTALL="0"
INSTALLIT="0"
DONOTCONFIRM="0"
@@ -100,13 +100,17 @@
while [ -n "$1" ]
do
+
+
case $1 in
--qs-user) if [ "$2" != "" ] ; then shift ; fi ; QS_USER="$1" ;;
--spooldir) if [ "$2" != "" ] ; then shift ; fi ; AS_QQ="$1" ;;
--qmaildir) if [ "$2" != "" ]; then shift ; fi ; QMAILDIR="$1" ;;
--bindir) if [ "$2" != "" ] ; then shift ; fi ; BINDIR="$1" ;;
- --user|--admin) if [ "$2" != "" ] ; then shift ; fi ; USERNAME="$1" ;;
- --domain) if [ "$2" != "" ] ; then shift ; fi ; MAILDOMAIN="$1" ;;
+ --admin|--user) if [ "$2" != "" ] ; then shift ; fi ; ADMIN_MAIL=`echo $1 | sed 's/@/\\\\@/'` ;;
+ --admin-realname) if [ "$2" != "" ] ; then shift ; fi ; ADMIN_REALNAME="$1" ;;
+ --spams-redirect) if [ "$2" != "" ] ; then shift ; fi ; SPAMS_REDIRECT=`echo $1 | sed 's/@/\\\\@/'` ;;
+ --spams-tosuffix) if [ "$2" != "" ] ; then shift ; fi ; SPAMS_TOSUFFIX="$1" ;;
--notify) if [ "$2" != "" ]; then shift ; fi ; NOTIFY_ADDRESSES="$1" ;;
--batch) DONOTCONFIRM="1" ; if [ "$2" != "" -a "`echo $2|grep '\-'`" = "" ] ; then shift ; fi ;;
--silent-viruses) if [ "$2" != "" ]; then shift ; fi ; FIND_SILENT_VIRUSES="$1" ;;
@@ -138,9 +142,17 @@
--spooldir <spooldir> defaults to $AS_QQ/
--bindir <installdir> where to install qmail-scanner-queue.pl
Defaults to /var/qmail/bin/
- --admin <username> user to Email alerts to (default: $USERNAME)
- --domain <domain name> "user"@"domain" makes up Email address
- to Email alerts to.
+ --admin <email> email to send alerts to (default: $ADMIN_MAIL)
+ --admin-realname <...> realname for sending alerts
+ Defaults to "$ADMIN_REALNAME"
+ nb: use '_' instead of ' ' (sorry for inconvenience)
+ --spams-redirect <email> email to redirect detected spams to
+ Defaults to empty (no redirection)
+ --spams-tosuffix <suffix> suffix to alter recipient with
+ i.e. recipient user@domain
+ will be transform into user-suffix@domain
+ Defaults to empty (do not alter recipients)
+ nb: 'spams-admin' option has precedence on this
--scanners <list of installed content scanners>
Defaults to "auto" - will use
whatever scanners are found on system.
@@ -910,7 +922,7 @@
#Test to see if spamc is calling Unix sockets instead of TCP
SPAMD_SOCKET=`ps -ef 2>/dev/null|egrep 'spamd.*socket'|grep -v grep|sed -e 's/^.*socketpath=//'|awk '{print $1}'`
if [ "$SPAMD_SOCKET" = "" ]; then
- SPAMD_SOCKET=`ps aux 2>/dev/null|egrep 'spamd.*socket'|grep -v grep|sed -e 's/^.*socketpath=//'|awk '{print $1}'`
+ SPAMD_SOCKET=`ps auxwww 2>/dev/null|egrep 'spamd.*socket'|grep -v grep|sed -e 's/^.*socketpath[\ |=]//'|awk '{print $1}'`
fi
if [ "$SPAMD_SOCKET" != "" -a -S "$SPAMD_SOCKET" ]; then
SPAMC_BINARY="$SPAMC_BINARY -U $SPAMD_SOCKET"
@@ -1005,9 +1017,14 @@
MAILDOMAIN=${MAILDOMAIN:-$FQDN}
LOCAL_DOMAINS_ARRAY=${LOCAL_DOMAINS_ARRAY:-$MAILDOMAIN}
-CMDLINE="$0 --spooldir $AS_QQ --qmaildir $QMAILDIR --bindir $BINDIR --qmail-queue-binary $QMAILQUEUE_BIN --admin $USERNAME --domain $MAILDOMAIN --notify $NOTIFY_ADDRESSES --local-domains $LOCAL_DOMAINS_ARRAY --silent-viruses $SILENT_VIRUSES --lang $QSLANG --debug $DEBUG_LEVEL --unzip $FORCE_UNZIP --block-password-protected $QUARANTINE_PASSWORD_PROTECTED --add-dscr-hdrs $DESCRIPTIVE_HEADERS --archive $ARCHIVEIT --redundant $REDUNDANT --log-details $LOG_DETAILS --log-crypto $LOG_CRYPTO --fix-mime $FIX_MIME --ignore-eol-check $DISABLE_EOL_CHECK --scanners \"$SCANNERS\""
-
+CMDLINE="$0 --spooldir $AS_QQ --qmaildir $QMAILDIR --bindir $BINDIR --qmail-queue-binary $QMAILQUEUE_BIN --admin $ADMIN_MAIL --admin-realname \"$ADMIN_REALNAME\" --domain $MAILDOMAIN --notify $NOTIFY_ADDRESSES --local-domains $LOCAL_DOMAINS_ARRAY --silent-viruses $SILENT_VIRUSES --lang $QSLANG --debug $DEBUG_LEVEL --unzip $FORCE_UNZIP --block-password-protected $QUARANTINE_PASSWORD_PROTECTED --add-dscr-hdrs $DESCRIPTIVE_HEADERS --archive $ARCHIVEIT --redundant $REDUNDANT --log-details $LOG_DETAILS --log-crypto $LOG_CRYPTO --fix-mime $FIX_MIME --ignore-eol-check $DISABLE_EOL_CHECK --scanners \"$SCANNERS\""
+if [ -n "$SPAMS_REDIRECT" ]; then
+ CMDLINE="$CMDLINE --spams-redirect $SPAMS_REDIRECT"
+fi
+if [ -n "$SPAMS_TOSUFFIX" ]; then
+ CMDLINE="$CMDLINE --spams-tosuffix $SPAMS_TOSUFFIX"
+fi
if [ "$MANUAL_INSTALL" = "1" ]; then
CMDLINE="$CMDLINE --no-QQ-check $MANUAL_INSTALL"
fi
@@ -1381,7 +1398,7 @@
fi
fi
-USERNAME=${USERNAME:-$LOGNAME}
+ADMIN_MAIL=${ADMIN_MAIL:-$LOGNAME}
SCANNER_ARRAY=`echo $SCANNER_ARRAY|sed 's/^,//g'`
@@ -1461,7 +1478,13 @@
fi
echo "archiving $ASTRING into $AS_QQ/$ARCHIVEDIR/"
fi
-echo "virus-admin=$USERNAME@$MAILDOMAIN"
+echo "admin=$ADMIN_MAIL"
+if [ -n "$SPAMS_REDIRECT" ]; then
+ echo "spams-admin=$SPAMS_REDIRECT"
+fi
+if [ -n "$SPAMS_TOSUFFIX" ]; then
+ echo "spams-suffix=$SPAMS_TOSUFFIX"
+fi
echo "local-domains=$LOCAL_DOMAINS_ARRAY"
echo "silent-viruses=$FIND_SILENT_VIRUSES_ARRAY"
echo "scanners=$SCANNER_ARRAY"
@@ -1623,10 +1646,12 @@
s?SPAMC_BINARY?$SPAMC_BINARY?g;
s?SPAMC_OPTIONS?$SPAMC_OPTIONS?g;
s?SPAMC_SUBJECT?$SPAMC_SUBJECT?g;
-s?USERNAME?$USERNAME?g;
+s?ADMIN_MAIL?$ADMIN_MAIL?g;
+s?ADMIN_REALNAME?$ADMIN_REALNAME?g;
+s?SPAMS_REDIRECT?$SPAMS_REDIRECT?g;
+s?SPAMS_TOSUFFIX?$SPAMS_TOSUFFIX?g;
s?SKIP_TEXT_MSGS?$SKIP_TEXT_MSGS?g;
s?FQDN?$FQDN?g;
-s?MAILDOMAIN?$MAILDOMAIN?g;
s?LOCAL_DOMAINS_ARRAY?$LOCAL_DOMAINS_ARRAY?g;
s?NOTIFY_ADDRESSES?$NOTIFY_ADDRESSES?g;
s?FIND?$FIND?g;