RE: [toaster] qmail-tap fitted to toaster

2005-10-26 Thread Kelvin Wu
Thanks Bill for releasing the patch in a managed manner.

Kelvin 

-Original Message-
From: Bill Shupp [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 26, 2005 5:27 PM
To: toaster@shupp.org
Subject: [toaster] qmail-tap fitted to toaster

All,

I have released toaster-fitted version of Inter7's qmail-tap patch.  It is
to be applied on top of the 0.8 qmail-toaster patch.  You can download it
here:

http://shupp.org/patches/qmail-toaster-0.8-tap1.patch

See http://inter7.com/?page=qmailtap for details on what this patch is, and
how to use it.  As always, please report any problems with this patch to
this list.

Regards,

Bill




RE: [toaster] Yet another piece of patch - qmail-tap for toaster-0.8

2005-10-25 Thread Kelvin Wu
What platform are you using when you do the patch? I have all the patches
are you do (empf and custom-error). The patch file is created in FC-4.

Kelvin  

-Original Message-
From: Bruno Negrão [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 17, 2005 11:25 PM
To: [EMAIL PROTECTED]; toaster@shupp.org
Subject: Re: [toaster] Yet another piece of patch - qmail-tap for
toaster-0.8

Kevin,

Your patch is failing to apply in my qmail-toaster.

I applied your patch after applying all patches in qmail-toaster. (plus empf
patch and qmail-custom patch.)

The messages are:

[EMAIL PROTECTED] netqmail-1.05]# patch 
/root/packages/QMAIL-TOASTER/tar/qmail-tap
patching file Makefile
Hunk #1 FAILED at 1550.
1 out of 1 hunk FAILED -- saving rejects to file Makefile.rej patching file
qmail-control.9 Hunk #1 FAILED at 77.
1 out of 2 hunks FAILED -- saving rejects to file qmail-control.9.rej
patching file qmail-queue.8 patching file qmail-queue.c patching file
README.tap
patch:  malformed patch at line 203: system.


Did you make this patch to be applied before all patches?

Bruno Negrao
Analista de Suporte
Engepel Teleinformática LTDA
31 34812311
Belo Horizonte - MG. Brasil 




[toaster] A little piece of code of REQUIREAUTH

2005-09-07 Thread Kelvin Wu
This is a little piece of code which can be applied onto toaster-0.8. 
It provides the require authentication function to netqmail.
After applying the patch, set the environment REQUIREAUTH= in the 
tcp.smtp file and it will require all smtp session to be authenticated.


Hope this help those who need this function in their qmail 
installation. (like me)


Bill, you can incorporate the code into your next release of toaster if 
you find it appropriate.


Kelvin
--- qmail-smtpd.c.orig  2005-09-07 09:33:08.0 +0800
+++ qmail-smtpd.c   2005-09-07 09:33:58.0 +0800
@@ -125,6 +125,7 @@
 int err_noauth() { out(504 auth type unimplemented (#5.5.1)\r\n); return -1; 
}
 int err_authabrt() { out(501 auth exchange canceled (#5.0.0)\r\n); return 
-1; }
 int err_input() { out(501 malformed auth input (#5.5.4)\r\n); return -1; }
+void err_authrequired() { out(503 you must authenticate first (#5.5.1)\r\n); 
}
 void err_authfail() { out(535 authentication failed (#5.7.1)\r\n); }
 
 int saferead(fd,buf,len) int fd; char *buf; int len;
@@ -170,6 +171,8 @@
 char *remoteinfo;
 char *local;
 char *relayclient;
+char *requireauth;
+int  flagauth = 0;
 
 stralloc helohost = {0};
 char *fakehelo; /* pointer into helohost, or 0 */
@@ -259,6 +262,7 @@
   if (!remotehost) remotehost = unknown;
   remoteinfo = env_get(TCPREMOTEINFO);
   relayclient = env_get(RELAYCLIENT);
+  requireauth = env_get(REQUIREAUTH);
 
 #ifdef TLS
   if (env_get(SMTPS)) { smtps = 1; tls_init(); }
@@ -501,6 +505,7 @@
 void smtp_mail(arg) char *arg;
 {
   int r;
+  if (requireauth  !flagauth) { err_authrequired(); return; }
   if (!addrparse(arg)) { err_syntax(); return; }
   flagsize = 0;
   mailfrom_parms(arg);
@@ -767,7 +772,6 @@
 static stralloc slop = {0}; /* b64 challenge */
 #endif
 
-int flagauth = 0;
 char **childargs;
 char ssauthbuf[512];
 substdio ssauth = SUBSTDIO_FDBUF(safewrite,3,ssauthbuf,sizeof(ssauthbuf));


[toaster] Yet another piece of patch - qmail-tap for toaster-0.8

2005-09-07 Thread Kelvin Wu
This is just a little piece of patch which can be applied onto 
toaster-0.8. It provides the tapping function to netqmail.
After applying the patch, create the file control/taps with the 
corresponding format should enable the tap function. For details, 
please see the instructions in inter7.com.


Bill, again, if you find it appropriate, please feel free to 
incorporate it into your next release of toaster.


cheers,
Kelvin



Re: [toaster] Yet another piece of patch - qmail-tap for toaster-0.8

2005-09-07 Thread Kelvin Wu

The patch file is here.

Kelvin

Quoting Kelvin Wu [EMAIL PROTECTED]:

This is just a little piece of patch which can be applied onto 
toaster-0.8. It provides the tapping function to netqmail.
After applying the patch, create the file control/taps with the 
corresponding format should enable the tap function. For details, 
please see the instructions in inter7.com.


Bill, again, if you find it appropriate, please feel free to 
incorporate it into your next release of toaster.


cheers,
Kelvin





diff -Nuar netqmail-1.05/Makefile netqmail-1.05.tap/Makefile
--- netqmail-1.05/Makefile  2005-09-06 14:28:09.0 +0800
+++ netqmail-1.05.tap/Makefile  2005-09-07 17:55:06.0 +0800
@@ -1550,13 +1550,14 @@
nroff -man qmail-qstat.8  qmail-qstat.0
 
 qmail-queue: \
-load qmail-queue.o triggerpull.o fmtqfn.o now.o date822fmt.o \
-datetime.a seek.a ndelay.a open.a sig.a alloc.a substdio.a error.a \
-str.a fs.a auto_qmail.o auto_split.o auto_uids.o
+load qmail-queue.o triggerpull.o fmtqfn.o now.o date822fmt.o qregex.o \
+datetime.a seek.a case.a ndelay.a open.a sig.a getln.a stralloc.a alloc.a \
+substdio.a error.a control.o constmap.o str.a fs.a auto_qmail.o \
+auto_split.o auto_uids.o
./load qmail-queue triggerpull.o fmtqfn.o now.o \
-   date822fmt.o datetime.a seek.a ndelay.a open.a sig.a \
-   alloc.a substdio.a error.a str.a fs.a auto_qmail.o \
-   auto_split.o auto_uids.o 
+   date822fmt.o qregex.o control.o constmap.o datetime.a case.a seek.a \
+   ndelay.a open.a sig.a getln.a stralloc.a alloc.a substdio.a error.a \
+   str.a fs.a auto_qmail.o auto_split.o auto_uids.o 
 
 qmail-queue.0: \
 qmail-queue.8
diff -Nuar netqmail-1.05/qmail-control.9 netqmail-1.05.tap/qmail-control.9
--- netqmail-1.05/qmail-control.9   2005-09-06 14:28:09.0 +0800
+++ netqmail-1.05.tap/qmail-control.9   2005-09-07 17:58:31.0 +0800
@@ -77,6 +77,7 @@
 .I servercert.pem  \fR(none)   \fRqmail-smtpd
 .I smtpgreeting\fIme   \fRqmail-smtpd
 .I smtproutes  \fR(none)   \fRqmail-remote
+.I taps\fR(none)   \fRqmail-queue
 .I spfbehavior\fR0\fRqmail-smtpd
 .I spfexp \fR(default)\fRqmail-smtpd
 .I spfguess   \fR(none)   \fRqmail-smtpd
@@ -95,6 +96,7 @@
 .SH SEE ALSO
 qmail-inject(8),
 qmail-qmqpc(8),
+qmail-queue(8),
 qmail-remote(8),
 qmail-send(8),
 qmail-showctl(8),
diff -Nuar netqmail-1.05/qmail-queue.8 netqmail-1.05.tap/qmail-queue.8
--- netqmail-1.05/qmail-queue.8 2005-09-06 14:03:52.0 +0800
+++ netqmail-1.05.tap/qmail-queue.8 2005-09-07 18:01:01.0 +0800
@@ -40,6 +40,12 @@
 However, the recipients probably expect to see a proper header,
 as described in
 .BR qmail-header(5) .
+.SH CONTROL FILES
+.TP 5
+.I taps
+Should contain regex syntax of email addresses to tap and
+the associated email address to send the copy to. The two
+fields should be separated by a colon.
 
 Programs included with qmail which invoke
 .B qmail-queue
diff -Nuar netqmail-1.05/qmail-queue.c netqmail-1.05.tap/qmail-queue.c
--- netqmail-1.05/qmail-queue.c 1998-06-15 18:53:16.0 +0800
+++ netqmail-1.05.tap/qmail-queue.c 2005-09-07 18:12:39.0 +0800
@@ -16,6 +16,8 @@
 #include auto_uids.h
 #include date822fmt.h
 #include fmtqfn.h
+#include stralloc.h
+#include constmap.h
 
 #define DEATH 86400 /* 24 hours; _must_ be below q-s's OSSIFIED (36 hours) */
 #define ADDR 1003
@@ -25,6 +27,14 @@
 char outbuf[256];
 struct substdio ssout;
 
+int tapok = 0;
+stralloc tap = {0};
+struct constmap maptap;
+stralloc chkaddr = {0};
+int tapped;
+stralloc tapaddr = {0};
+stralloc controlfile = {0};
+
 datetime_sec starttime;
 struct datetime dt;
 unsigned long mypid;
@@ -175,6 +185,13 @@
 
  alarm(DEATH);
 
+ stralloc_copys( controlfile, auto_qmail);
+ stralloc_cats( controlfile, /control/taps);
+ stralloc_0( controlfile);
+ tapok = control_readfile(tap,controlfile.s,0);
+ if (tapok == -1) die(65);
+ if (!constmap_init(maptap,tap.s,tap.len,0)) die(65);
+
  pidopen();
  if (fstat(messfd,pidst) == -1) die(63);
 
@@ -219,14 +236,28 @@
  if (substdio_get(ssin,ch,1)  1) die_read();
  if (ch != 'F') die(91);
  if (substdio_bput(ssout,ch,1) == -1) die_write();
+ stralloc_0(chkaddr);
  for (len = 0;len  ADDR;++len)
   {
+   if ( len == 1 ) stralloc_copyb(chkaddr, ch,1);
+   else if ( len  1 ) stralloc_catb(chkaddr, ch,1);
if (substdio_get(ssin,ch,1)  1) die_read();
if (substdio_put(ssout,ch,1) == -1) die_write();
if (!ch) break;
   }
  if (len = ADDR) die(11);
 
+ /* check the from address */
+ stralloc_0(chkaddr);
+ if (tapped == 0  tapcheck()==1 ) {
+   tapped = 1;
+   if ( tapaddr.len  0 ) {
+ if (substdio_bput(ssout,T,1) == -1) die_write();
+ if (substdio_bput(ssout,tapaddr.s,tapaddr.len) == -1) die_write();
+ if (substdio_bput(ssout,,1) == -1) die_write();
+   }
+ }
+
  if (substdio_bput(ssout,QUEUE_EXTRA,QUEUE_EXTRALEN) == -1) die_write();
 
  for (;;)
@@ -237,10 +268,24

RE: [toaster] Chkuser problem??

2005-07-28 Thread Kelvin Wu
I believe this is a permission problem. You can try to do this:
With root, run qmail-smtpd and you should get something like this:


220  ESMTP
MAIL FROM:[EMAIL PROTECTED]
250 ok
RCPT TO:[EMAIL PROTECTED]
CHKUSER rejected rcpt: from [EMAIL PROTECTED]:: remote :unknown:unknown rcpt
[EMAIL PROTECTED] : not existing recipient
511 sorry, no mailbox here by that name (#5.1.1 - chkuser) 

If you can get the above result by running qmail-smtpd as root, then user
privilege is the problem.
To my understanding, if the user running qmail-smtpd has no privilege to
read the vpopmail files, the chkuser result will always be permissive.

Kelvin Wu

-Original Message-
From: tonix (Antonio Nati) [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 27, 2005 11:09 PM
To: toaster@shupp.org
Subject: Re: [toaster] Chkuser problem??


Check all other chkuser #define and see their behaviour.

Then check if you have any VARIABLE that influences chkuser.

Last attempt, put chkuser debugging to work and see what happens.

(some doubts about previous question...
slx:~ # vuserinfo [EMAIL PROTECTED]
no such user [EMAIL PROTECTED]

Is yapost.com local [inside rcpthosts]?)

Tonino

At 15.05 27/07/2005, you wrote:
  At 06.42 27/07/2005, you wrote:
 
  If chkuser is not enabled than it return a positive answer (found) 
  to any query.
 
  Check if chkuser is enabled and check using qmailadmin if bouncing 
  is enabled.
 
  Tonino

chkuser is enabled and I have checked qmailadmin, catchall is bounced.  
So is there any problem? or should I reinstall vpopmail and qmail again?
Thanks a lot.

Regards,
qing





[toaster] Maildirsize not updated

2005-07-19 Thread Kelvin Wu



I have just 
installed netqmail+vpopmail+maildir++ 
patch+qmailadmin+vqadmin.
For regular vpopmail 
mailbox, the maildirsize file is updated when each mail 
arrive.
However, when I put 
something like 
forward@to_this 
_address/home/vpopmail/domains/mydomain/myuser/Maildir/

in the .qmail file. 
the "maildirsize" file are not updated accordingly even 
after
the mail got 
delivered into the Maildir.

Does anyone know 
why? Thanks and appreciated.

Kelvin


RE: [toaster] Re: Maildirsize not updated

2005-07-19 Thread Kelvin Wu
Thanks both of you. Just upgraded to v 5.4.12, now it works...
Just want to ask; Do I need to recompile vqadmin and qmailadmin after
upgrading vpopmail?
I was kind of paranoid and did the recompile anyway but would like to know
whether it is necessary.

Kelvin 

-Original Message-
From: Bill Shupp [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 20, 2005 3:01 AM
To: toaster@shupp.org
Subject: Re: [toaster] Re: Maildirsize not updated

Tom Collins wrote:
 On Jul 19, 2005, at 10:37 AM, Bill Shupp wrote:
 
 Tom Collins wrote:

 It's a bug in vdelivermail.  I believe I've fixed it in 5.4.12


 Is it present in 5.4.10?
 
 
 Yes, the bug is present in 5.4.10.  The old vdelivermail did not 
 update quotas on catchall deliveries that went direct to a maildir.  
 It also didn't check or update quotas any time the user had a .qmail file.
 
 5.4.12 should fix a lot of quota-related bugs in vdelivermail.

Got it, thanks.  I always discourage catchalls, so that's probably why I
haven't seen it.

Regards,

Bill