Re: [vchkpw] Vpopmail, Roaming Users, & Qmail-Scanner (vpopmail-5.2.1_qmailqueue.patch)

2003-01-02 Thread Tim Hasson
Thanks David for the info.

Unfortunately, I have previously done that (adding the qmailqueue env in qmail-
smtpd run file --as some posts on this mailing list or Q-S's list). However, 
the problem still existed since some users use the webmail interface (IMP 
www.horde.org/imp) to send messages which runs as a different user than qmail-
smtpd and in turn doesn't pickup the env var QMAILQUEUE. The webmail's default 
behavior is it uses local /usr/sbin/sendmail binary to send mails out (which 
is linked to qmail's sendmail) which doesn't pass qmail-smtpd at all. I think 
qmail-sendmail will automatically write the message to the real queue (or it 
passes through qmail-send first.) I probablly could've gotton around that by 
also adding the QMAILQUEUE env line to qmail-send run script?? What I done is 
I added a exec() line in the webmail's php code to set the var QMAILQUEUE to 
my scanner. This worked for the webmail only but not for outlook/eudora users 
(again, could've put env qmailqueue in qmail-smtpd run file -- but then it 
becomes a mess).

Quoting David Phillips <[EMAIL PROTECTED]>:

> Tim Hasson writes:
> > Below is a patch to allow setting QMAILQUEUE to
> > qmail-scanner-queue.pl for roaming users (change path to your
> > pre-qmail-queue script)
> 
> You could also just set it in your run script.  No need for patching.  If
> you use qmail-conf, add it to the env directory.
> 
> --
> David Phillips <[EMAIL PROTECTED]>
> http://david.acz.org/
> 
> 

> 








Re: [vchkpw] Vpopmail, Roaming Users, & Qmail-Scanner (vpopmail-5.2.1_qmailqueue.patch)

2003-01-02 Thread David Phillips
Tim Hasson writes:
> Below is a patch to allow setting QMAILQUEUE to
> qmail-scanner-queue.pl for roaming users (change path to your
> pre-qmail-queue script)

You could also just set it in your run script.  No need for patching.  If
you use qmail-conf, add it to the env directory.

--
David Phillips <[EMAIL PROTECTED]>
http://david.acz.org/





[vchkpw] Vpopmail, Roaming Users, & Qmail-Scanner (vpopmail-5.2.1_qmailqueue.patch)

2003-01-02 Thread Tim Hasson
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.origFri May 17 23:27:57 2002
+++ configureSun 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.origFri May 17 23:23:42 2002
+++ configure.inSun 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.origFri Feb  1 17:43:24 2002
+++ vmysql.cSun 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.origSat Jan 19 23:07:58 2002
+++ voracle.pcSun 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.origSat Jan 19 23:08:02 2002
+++ vpgsql.cSun 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.origFri May 17 23:25:49 2002
+++ vpopmail.cSun 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);