Hello vpopmailers I encountered a problem when using qmail-1.03(with qmail-queue patch), vpopmail-5.2.1 with roaming users, and qmail-scanner-1.15 w/ spamassassin 2.43 & sophos sweep. The problem exists when vpopmail rebuilds the relay database, setting only the env var RELAYCLIENT="". If QMAILQUEUE is not set to the qmail- scanner binary path or other application to be invoked before the real qmail- queue, emails sent by roaming users will not be scanned (for viruses, spam, etc.) i.e. emails will be directly sent to the qmail-queue without analysis.
Below is a patch to allow setting QMAILQUEUE to qmail-scanner-queue.pl for roaming users (change path to your pre-qmail-queue script) I am also using matt simerson's tcpserver mysql patch to read relay information directly from vpopmail's relay table in mysql. works like a charm! cd vpopmail-5.2.1 patch -p0 < vpopmail-5.2.1_qmailqueue.patch --- configure.orig Fri May 17 23:27:57 2002 +++ configure Sun Dec 29 04:57:04 2002 @@ -1631,7 +1631,7 @@ if test "$tcpserver_file" = "" then - echo "127.:allow,RELAYCLIENT=\"\"" > "$vpopmaildir"/etc/tcp.smtp + echo "127.:allow,RELAYCLIENT=\"\",QMAILQUEUE=\"/var/qmail/bin/qmail-scanner- queue.pl\"" > "$vpopmaildir"/etc/tcp.smtp tcpserver_file="$vpopmaildir"/etc/tcp.smtp echo "configure: warning: Unable to find your tcpserver relay file." 1>&2 --- configure.in.orig Fri May 17 23:23:42 2002 +++ configure.in Sun Dec 29 04:57:48 2002 @@ -294,7 +294,7 @@ [ if test "$tcpserver_file" = "" then - echo "127.:allow,RELAYCLIENT=\"\"" > "$vpopmaildir"/etc/tcp.smtp + echo "127.:allow,RELAYCLIENT=\"\",QMAILQUEUE=\"/var/qmail/bin/qmail-scanner- queue.pl\"" > "$vpopmaildir"/etc/tcp.smtp tcpserver_file="$vpopmaildir"/etc/tcp.smtp AC_MSG_WARN([Unable to find your tcpserver relay file.]) --- vmysql.c.orig Fri Feb 1 17:43:24 2002 +++ vmysql.c Sun Dec 29 04:51:20 2002 @@ -750,7 +750,7 @@ return; } while((row = mysql_fetch_row(res_read))) { - snprintf(SqlBufRead, SQL_BUF_SIZE, "%s:allow,RELAYCLIENT=\"\"\n", row [0]); + snprintf(SqlBufRead, SQL_BUF_SIZE, "% s:allow,RELAYCLIENT=\"\",QMAILQUEUE=\"/var/qmail/bin/qmail-scanner- queue.pl\"\n", row[0]); write(fdm,SqlBufRead, strlen(SqlBufRead)); } mysql_free_result(res_read); --- voracle.pc.orig Sat Jan 19 23:07:58 2002 +++ voracle.pc Sun Dec 29 04:55:14 2002 @@ -694,7 +694,7 @@ EXEC SQL FETCH CF INTO :Vip_addr; if (sqlca.sqlcode == 1403) break; - sprintf(SqlBuf, "%s:allow,RELAYCLIENT=\"\"\n", Vip_addr); + sprintf(SqlBuf, "% s:allow,RELAYCLIENT=\"\",QMAILQUEUE=\"/var/qmail/bin/qmail-scanner- queue.pl\"\n", Vip_addr); write(fdm,SqlBuf, strlen(SqlBuf)); } --- vpgsql.c.orig Sat Jan 19 23:08:02 2002 +++ vpgsql.c Sun Dec 29 04:54:21 2002 @@ -675,7 +675,7 @@ { PGresult *pgres; const char *qr="select ip_addr from relay"; - const char re[]=":allow,RELAYCLIENT=\"\"\n"; + const char re[] =":allow,RELAYCLIENT=\"\",QMAILQUEUE=\"/var/qmail/bin/qmail-scanner- queue.pl\"\n"; register unsigned i=0, n, len=strlen(re)+1; char *buf=NULL; --- vpopmail.c.orig Fri May 17 23:25:49 2002 +++ vpopmail.c Sun Dec 29 04:53:19 2002 @@ -2140,7 +2140,7 @@ rebuild_cdb = 0; } } - fprintf( fs1, "%s:allow,RELAYCLIENT=\"\",RBLSMTPD=\"\" %d\n", + fprintf( fs1, "% s:allow,RELAYCLIENT=\"\",RBLSMTPD=\"\",QMAILQUEUE=\"/var/qmail/bin/qmail- scanner-queue.pl\" %d\n", ipaddr, (int)mytime); fclose(fs); fclose(fs1);