summaryrefslogtreecommitdiffstats
path: root/mail/qmail-scanner/files/patch-configure
blob: 5eec14b74de8cada63bb524b74a2ea758e2756bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
--- configure.orig	Thu Dec 11 14:28:41 2003
+++ configure	Thu Dec 11 14:28:48 2003
@@ -83,7 +83,8 @@ DEBUG_LEVEL="1"
 FORCE_UNZIP="0"
 DESCRIPTIVE_HEADERS="0"
 NOTIFY_ADDRESSES="sender,admin"
-USERNAME="$USER"
+ADMIN_MAIL="$USER"
+ADMIN_REALNAME="System Anti-Virus Administrator"
 MANUAL_INSTALL="0"
 INSTALLIT="0"
 DONOTCONFIRM="0"
@@ -100,8 +101,10 @@ do
         --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=`echo $1 | sed 's/_/ /g'` ;;
+	--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" ;;
@@ -130,9 +133,17 @@ valid options:
   --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.
@@ -911,12 +922,16 @@ fi
 if [ "$UNAME" ] ; then FQDN="$UNAME" ; fi
 if [ "$HOST" ] ; then FQDN="$HOST" ; fi
 
-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 --add-dscr-hdrs $DESCRIPTIVE_HEADERS --archive $ARCHIVEIT --redundant $REDUNDANT --log-details $LOG_DETAILS --log-crypto $LOG_CRYPTO --fix-mime $FIX_MIME  --scanners \"$SCANNERS\""
-
+LOCAL_DOMAINS_ARRAY=${LOCAL_DOMAINS_ARRAY:-$FQDN}
+CMDLINE="$0 --spooldir $AS_QQ --qmaildir $QMAILDIR --bindir $BINDIR --qmail-queue-binary $QMAILQUEUE_BIN  --admin $ADMIN_MAIL --admin-realname \"$ADMIN_REALNAME\" --notify $NOTIFY_ADDRESSES --local-domains $LOCAL_DOMAINS_ARRAY --silent-viruses $SILENT_VIRUSES --lang $QSLANG --debug $DEBUG_LEVEL --unzip $FORCE_UNZIP --add-dscr-hdrs $DESCRIPTIVE_HEADERS --archive $ARCHIVEIT --redundant $REDUNDANT --log-details $LOG_DETAILS --log-crypto $LOG_CRYPTO --fix-mime $FIX_MIME  --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
@@ -1286,7 +1301,7 @@ if [ "$SPAMC_BINARY" != "" ]; then
     fi
 fi
 
-USERNAME=${USERNAME:-$LOGNAME}
+ADMIN_MAIL=${ADMIN_MAIL:-$LOGNAME}
 
 SCANNER_ARRAY=`echo $SCANNER_ARRAY|sed 's/^,//g'`
 
@@ -1360,7 +1375,13 @@ if [ "$ARCHIVEIT" != "0" ]; then
     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"
@@ -1506,10 +1527,12 @@ s?SPAMASSASSIN_BINARY?$SPAMASSASSIN_BINA
 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;
OpenPOWER on IntegriCloud