View | Details | Raw Unified | Return to bug 58503
Collapse All | Expand All

(-)vpopmail/Makefile (-27 / +39 lines)
Lines 55-60 Link Here
55
# WITHOUT_USERS_BIG_DIR - disables using big directories for users
55
# WITHOUT_USERS_BIG_DIR - disables using big directories for users
56
# WITHOUT_SEEKABLE - disables vdelivermail's attempt to make its input seekable
56
# WITHOUT_SEEKABLE - disables vdelivermail's attempt to make its input seekable
57
# WITH_DOMAIN_QUOTAS	- enable domain quotas
57
# WITH_DOMAIN_QUOTAS	- enable domain quotas
58
# WITH_SPAMASSASSIN	- enable SpamAssassin checks before Maildir delivery
58
#
59
#
59
# Set these to the values you'd prefer
60
# Set these to the values you'd prefer
60
#
61
#
Lines 116-121 Link Here
116
RELAYCLEAR?=	30
117
RELAYCLEAR?=	30
117
LOGLEVEL?=	y
118
LOGLEVEL?=	y
118
119
120
.if defined(WITH_MYSQL)
121
USE_MYSQL=		yes
122
CONFIGURE_ARGS+=	--enable-mysql=y \
123
			--enable-incdir=${LOCALBASE}/include/mysql \
124
			--enable-libdir=${LOCALBASE}/lib/mysql
125
.if defined(WITH_MYSQL_REPLICATION)
126
CONFIGURE_ARGS+=	--enable-mysql-replication=y
127
.endif
128
.if defined(WITH_MYSQL_LOG)
129
CONFIGURE_ARGS+=	--enable-mysql-logging=y
130
.endif
131
.if defined(WITH_MYSQL_LIMITS)
132
CONFIGURE_ARGS+=	--enable-mysql-limits=y
133
.endif
134
135
WITH_MYSQL_SERVER?=		localhost
136
WITH_MYSQL_READ_SERVER?=	${WITH_MYSQL_SERVER}
137
WITH_MYSQL_UPDATE_SERVER?=	${WITH_MYSQL_SERVER}
138
WITH_MYSQL_USER?=		vpopmail
139
WITH_MYSQL_READ_USER?=		${WITH_MYSQL_USER}
140
WITH_MYSQL_UPDATE_USER?=	${WITH_MYSQL_USER}
141
WITH_MYSQL_PASSWD?=		secret
142
WITH_MYSQL_READ_PASSWD?=	${WITH_MYSQL_PASSWD}
143
WITH_MYSQL_UPDATE_PASSWD?=	${WITH_MYSQL_PASSWD}
144
WITH_MYSQL_DB?=			vpopmail
145
.endif
146
119
.include <bsd.port.pre.mk>
147
.include <bsd.port.pre.mk>
120
148
121
.if exists(${LOCALBASE}/qmail/bin/qmail-send)
149
.if exists(${LOCALBASE}/qmail/bin/qmail-send)
Lines 168-200 Link Here
168
CONFIGURE_ARGS+=	--enable-learn-passwords=y
196
CONFIGURE_ARGS+=	--enable-learn-passwords=y
169
.endif
197
.endif
170
198
171
.if defined(WITH_MYSQL)
172
USE_MYSQL=		yes
173
CONFIGURE_ARGS+=	--enable-mysql=y \
174
			--enable-incdir=${LOCALBASE}/include/mysql \
175
			--enable-libdir=${LOCALBASE}/lib/mysql
176
.if defined(WITH_MYSQL_REPLICATION)
177
CONFIGURE_ARGS+=	--enable-mysql-replication=y
178
.endif
179
.if defined(WITH_MYSQL_LOG)
180
CONFIGURE_ARGS+=	--enable-mysql-logging=y
181
.endif
182
.if defined(WITH_MYSQL_LIMITS)
183
CONFIGURE_ARGS+=	--enable-mysql-limits=y
184
.endif
185
186
WITH_MYSQL_SERVER?=		localhost
187
WITH_MYSQL_READ_SERVER?=	${WITH_MYSQL_SERVER}
188
WITH_MYSQL_UPDATE_SERVER?=	${WITH_MYSQL_SERVER}
189
WITH_MYSQL_USER?=	vpopmail
190
WITH_MYSQL_READ_USER?=	${WITH_MYSQL_USER}
191
WITH_MYSQL_UPDATE_USER?=	${WITH_MYSQL_USER}
192
WITH_MYSQL_PASSWD?=	secret
193
WITH_MYSQL_READ_PASSWD?=	${WITH_MYSQL_PASSWD}
194
WITH_MYSQL_UPDATE_PASSWD?=	${WITH_MYSQL_PASSWD}
195
WITH_MYSQL_DB?=		vpopmail
196
.endif
197
198
.if defined(WITH_SYBASE)
199
.if defined(WITH_SYBASE)
199
CONFIGURE_ARGS+=	--enable-sybase=y
200
CONFIGURE_ARGS+=	--enable-sybase=y
200
.endif
201
.endif
Lines 240-245 Link Here
240
CONFIGURE_ARGS+=	--enable-domainquotas=y
241
CONFIGURE_ARGS+=	--enable-domainquotas=y
241
.endif
242
.endif
242
243
244
.if defined(WITH_SPAMASSASSIN)
245
BUILD_DEPENDS=	spamc:${PORTSDIR}/mail/p5-Mail-SpamAssassin
246
CONFIGURE_ARGS+=	--enable-spamassassin=${LOCALBASE}/bin/spamc
247
.endif
248
243
# autoconf and automake can remove our patches to the configure scripts.
249
# autoconf and automake can remove our patches to the configure scripts.
244
250
245
post-patch:
251
post-patch:
Lines 309-313 Link Here
309
		>> ${PREFIX}/vpopmail/etc/vpopmail.mysql
315
		>> ${PREFIX}/vpopmail/etc/vpopmail.mysql
310
.endif
316
.endif
311
	${CHOWN} -R vpopmail:vchkpw ${PREFIX}/vpopmail/bin/ ${PREFIX}/vpopmail/etc/
317
	${CHOWN} -R vpopmail:vchkpw ${PREFIX}/vpopmail/bin/ ${PREFIX}/vpopmail/etc/
318
.if defined(WITH_SPAMASSASSIN)
319
	${ECHO_CMD} "***********************************************************************"
320
	${ECHO_CMD} "Now you should add the following options to your spamd.sh startup file:"
321
	${ECHO_CMD} "-v -u vpopmail"
322
	${ECHO_CMD} "***********************************************************************"
323
.endif
312
324
313
.include <bsd.port.post.mk>
325
.include <bsd.port.post.mk>
(-)vpopmail/files/patch-config.h.in (+12 lines)
Line 0 Link Here
1
--- config.h.in.orig	Fri Oct 24 18:43:20 2003
2
+++ config.h.in	Fri Oct 24 18:43:45 2003
3
@@ -89,6 +89,9 @@
4
 #undef QMAILNEWU
5
 
6
 /*  */
7
+#undef SPAMC
8
+
9
+/*  */
10
 #undef QMAILINJECT
11
 
12
 /*  */
(-)vpopmail/files/patch-configure (-5 / +42 lines)
Lines 1-6 Link Here
1
--- configure.orig	Thu Aug 28 21:09:47 2003
1
--- configure.orig	Fri Oct 17 01:12:22 2003
2
+++ configure	Fri Sep  5 00:13:14 2003
2
+++ configure	Sat Oct 25 01:18:27 2003
3
@@ -1317,7 +1317,7 @@
3
@@ -20,6 +20,8 @@
4
 ac_help="$ac_help
5
   --enable-qmail-newmrh=path Full path to qmail-newmrh program"
6
 ac_help="$ac_help
7
+  --enable-spamassassin=path Enable SpamAssassin. Full path to spamc program. default /usr/local/bin/spamc"
8
+ac_help="$ac_help
9
   --enable-vpopuser=vpopmail   user vchkpw was installed as."
10
 ac_help="$ac_help
11
   --enable-vpopgroup=vchkpw   group vchkpw was installed as."
12
@@ -1317,7 +1319,7 @@
4
   ;;
13
   ;;
5
 esac
14
 esac
6
 
15
 
Lines 9-15 Link Here
9
 then
18
 then
10
     echo "configure: warning: === vpopmail must be configured as root. ===" 1>&2
19
     echo "configure: warning: === vpopmail must be configured as root. ===" 1>&2
11
     echo "configure: warning: === please switch to the root user and  ===" 1>&2
20
     echo "configure: warning: === please switch to the root user and  ===" 1>&2
12
@@ -1601,15 +1601,6 @@
21
@@ -1446,6 +1448,27 @@
22
 EOF
23
 
24
 
25
+# Check whether --enable-spamassassin or --disable-spamassassin was given.
26
+if test "${enable_spamassassin+set}" = set; then
27
+  enableval="$enable_spamassassin"
28
+  spamc="$enableval"
29
+
30
+  case $spamc in
31
+  1*|y*|Y*)
32
+      spamc="/usr/local/bin/spamc"
33
+      ;;
34
+  esac
35
+
36
+  if test ! -f "$spamc"
37
+  then
38
+      { echo "configure: error: Unable to find your spamc file, specify --enable-spamassassin=/full/path/to/spamc" 1>&2; exit 1; }
39
+  fi
40
+
41
+  cat >> confdefs.h <<EOF
42
+#define SPAMC "$spamc"
43
+EOF
44
+fi
45
+
46
 
47
 vpopuser="vpopmail"
48
 # Check whether --enable-vpopuser or --disable-vpopuser was given.
49
@@ -1601,15 +1624,6 @@
13
 EOF
50
 EOF
14
 
51
 
15
 
52
 
Lines 25-31 Link Here
25
 # Check whether --enable-roaming-users or --disable-roaming-users was given.
62
 # Check whether --enable-roaming-users or --disable-roaming-users was given.
26
 if test "${enable_roaming_users+set}" = set; then
63
 if test "${enable_roaming_users+set}" = set; then
27
   enableval="$enable_roaming_users"
64
   enableval="$enable_roaming_users"
28
@@ -1671,17 +1662,7 @@
65
@@ -1671,17 +1685,7 @@
29
 if test "${enable_tcpserver_file+set}" = set; then
66
 if test "${enable_tcpserver_file+set}" = set; then
30
   enableval="$enable_tcpserver_file"
67
   enableval="$enable_tcpserver_file"
31
   tcpserver_file="$enableval"
68
   tcpserver_file="$enableval"
(-)vpopmail/files/patch-vdelivermail.c (-3 / +42 lines)
Lines 1-6 Link Here
1
--- vdelivermail.c.orig	Sat Nov  2 22:34:39 2002
1
--- vdelivermail.c.orig	Mon Oct 20 20:59:57 2003
2
+++ vdelivermail.c	Sat Nov  2 22:35:20 2002
2
+++ vdelivermail.c	Fri Oct 24 18:31:45 2003
3
@@ -263,7 +263,7 @@
3
@@ -257,7 +257,7 @@
4
 
4
 
5
     /* check for wildcard if there's no match */
5
     /* check for wildcard if there's no match */
6
     if(tmpstr == NULL) {
6
     if(tmpstr == NULL) {
Lines 9-11 Link Here
9
             if(TheUser[i-1]=='-') {
9
             if(TheUser[i-1]=='-') {
10
                 tmpuser[0] = '\0';
10
                 tmpuser[0] = '\0';
11
                 strncat(tmpuser,TheUser,i); 
11
                 strncat(tmpuser,TheUser,i); 
12
@@ -444,6 +444,7 @@
13
  int inject = 0;
14
  FILE *fs;
15
  char tmp_file[256];
16
+ int pim[2];
17
 
18
     /* check if the email is looping to this user */
19
     if ( is_looping( address ) == 1 ) {
20
@@ -631,6 +632,30 @@
21
         }
22
     }
23
 
24
+#ifdef SPAMC
25
+    /* fork the SpamAssassin client - patch by Alex Dupre */
26
+    if (!pipe(pim)) {
27
+        pid = vfork();
28
+        switch (pid) {
29
+            case -1:
30
+                close(pim[0]);
31
+                close(pim[1]);
32
+                break;
33
+            case 0:
34
+                close(pim[0]);
35
+                dup2(pim[1], 1);
36
+                close(pim[1]);
37
+                if (execl(SPAMC, SPAMC, "-u", maildir_to_email(address), 0) == -1) {
38
+                    while ((file_count=read(0, msgbuf, MSG_BUF_SIZE)) > 0)
39
+                        write(1, msgbuf, file_count);
40
+                    _exit(0);
41
+                }
42
+        }
43
+        close(pim[1]);
44
+        dup2(pim[0], 0);
45
+        close(pim[0]);
46
+    }
47
+#endif
48
 
49
     /* read it in chunks and write it to the new file */
50
     while((file_count=read(0,msgbuf,MSG_BUF_SIZE))>0) {

Return to bug 58503