Re: [vchkpw] Strange messages in qmail-send log after upgrading to vpopmail 5.3.27

2003-10-02 Thread Tom Collins
On Wednesday, October 1, 2003, at 06:02  PM, Brian Kolaci wrote:
The code for the maildirquota is verbatim from courier,
copy/paste.  I don't believe there's a problem with it,
however from the start you always had problems with it.
This is the first time I've looked at that code.  It works, but isn't 
documented well.  It will cause a segfault if called with pathname that 
doesn't include "/Maildir/" in it.

You just didn't like anything about the approach.  I tried
to take the path of least resistance and replicate code that
has been working for years, and just use it to iterate over
multiple maildirs.  I've been running it for easily over a
year with no problems.  If anything, its probably one of
the extensions added since 5.3.19, which I'm still using
and works perfectly fine.
You're right -- the new code that called that function was building an 
extra slash into the path.  As long as the function is called with the 
right pathname, there isn't any problem.  The fix is in CVS and will be 
in the 5.3.28 release later today.

--
Tom Collins
[EMAIL PROTECTED]
QmailAdmin: http://qmailadmin.sf.net/  Vpopmail: http://vpopmail.sf.net/
Info on the Sniffter hand-held Network Tester: http://sniffter.com/



Re: [vchkpw] Strange messages in qmail-send log after upgrading to vpopmail 5.3.27

2003-10-01 Thread Jochen Schug
Tom Collins wrote:

On Wednesday, October 1, 2003, at 03:20  PM, Jochen Schug wrote:

I tried adding the trailing slash, there's the result:
Please remove the trailing slash and try this patch.  The changes in 
vdelivermail resulted in a double-slash (adding a / and the 
/Maildir/).  The result is that mail is delivered fine, but domain 
quotas won't work.

--
diff -u -r1.3 vdelivermail.c
--- vdelivermail.c  14 Sep 2003 21:51:59 -  1.3
+++ vdelivermail.c  1 Oct 2003 22:39:53 -
@@ -1089,12 +1089,12 @@
 /* check if it is a path add the /Maildir/ for delivery */
 if ( bounce[0] == '/' ) {
-strcat( bounce, "/");
+if (bounce[strlen(bounce)-1] != '/') strcat( bounce, "/");
 printf ("user does not exist, but will deliver to %s\n", 
bounce);
 if( check_forward_deliver(bounce) == 1 )
 vexit(0);
 else
-strcat( bounce, "/Maildir/");
+strcat( bounce, "Maildir/");
 }

 ret = deliver_mail(bounce, "NOQUOTA" );
---
If it's a good fix, I'll include it in the 5.3.28 release (which is 
planned for later today).

This should fix a few things.  It only adds a trailing slash if one 
isn't there, and it doesn't double-up the slash when adding /Maildir/.
Tom,

This fix works pretty good - mail is delivered fine, and the error 
message doesn't appear in the logs anymore. But still, the log message 
differs slightly from the one that vpopmail 5.3.20 writes.

"success: 
user_does_not_exist,_but_will_deliver_to_/home/vpopmail/domains/*domainname*/postmaster//did_0+0+1/" 
is now written, whereas the old version had the "Maildir/" after the 
user name as well. Which is more correct, I think; the maildir where the 
mail is delivered is not the one with the username, but the actual 
Maildir one level deeper.

But that's just a matter of when the bounce message is printed - before 
or after the last strcat (if I get this right - my C skills are almost 
not existant ;-)).

Regards
Jochen




Re: [vchkpw] Strange messages in qmail-send log after upgrading to vpopmail 5.3.27

2003-10-01 Thread Tom Collins
On Wednesday, October 1, 2003, at 03:20  PM, Jochen Schug wrote:
I tried adding the trailing slash, there's the result:
Please remove the trailing slash and try this patch.  The changes in 
vdelivermail resulted in a double-slash (adding a / and the /Maildir/). 
 The result is that mail is delivered fine, but domain quotas won't 
work.

--
diff -u -r1.3 vdelivermail.c
--- vdelivermail.c  14 Sep 2003 21:51:59 -  1.3
+++ vdelivermail.c  1 Oct 2003 22:39:53 -
@@ -1089,12 +1089,12 @@
 /* check if it is a path add the /Maildir/ for delivery */
 if ( bounce[0] == '/' ) {
-strcat( bounce, "/");
+if (bounce[strlen(bounce)-1] != '/') strcat( bounce, "/");
 printf ("user does not exist, but will deliver to %s\n", 
bounce);
 if( check_forward_deliver(bounce) == 1 )
 vexit(0);
 else
-strcat( bounce, "/Maildir/");
+strcat( bounce, "Maildir/");
 }

 ret = deliver_mail(bounce, "NOQUOTA" );
---
If it's a good fix, I'll include it in the 5.3.28 release (which is 
planned for later today).

This should fix a few things.  It only adds a trailing slash if one 
isn't there, and it doesn't double-up the slash when adding /Maildir/.

--
Tom Collins
[EMAIL PROTECTED]
QmailAdmin: http://qmailadmin.sf.net/  Vpopmail: http://vpopmail.sf.net/
Info on the Sniffter hand-held Network Tester: http://sniffter.com/



Re: [vchkpw] Strange messages in qmail-send log after upgrading to vpopmail 5.3.27

2003-10-01 Thread Jochen Schug
Jochen Schug wrote:

Tom Collins wrote:

On Wednesday, October 1, 2003, at 01:10  PM, Jochen Schug wrote:

And that's what it looks like with 5.3.27:

new msg 240629
info msg 240629: bytes 79927 from <*removed*> qp 13841 uid 106
starting delivery 24: msg 240629 to local  
[EMAIL PROTECTED]
status: local 1/10 remote 0/20
delivery 24: success:  
user_does_not_exist,_but_will_deliver_to_/home/vpopmail/domains/ 
*domainname*/postmaster// 
Error._Domain_postmaster_was_not_found_in_the_assign_file/did_0+0+1/
status: local 0/10 remote 0/20
end msg 240629


I think I may have found the cause.  Does the pathname in your  
.qmail-default file include a trailing "/"?  vdelivermail is adding 
a  "/" at the end, and I think it may be doing a double-slash (which  
messes up code later on that tried to figure out the domain name 
from  the path).


Tom,

I'm afraid that's not the case. I checked the .qmail-default file, 
here's its content:

| /home/vpopmail/bin/vdelivermail '' 
/home/vpopmail/domains/*domainname*/postmaster


I tried adding the trailing slash, there's the result:

new msg 240488
info msg 240488: bytes 1441 from <*removed*> qp 19894 uid 106
starting delivery 637: msg 240488 to local [EMAIL PROTECTED]
status: local 1/10 remote 0/20
637: success: 
user_does_not_exist,_but_will_deliver_to_/home/vpopmail/domains/*domainname*/postmaster///Error._Domain__was_not_found_in_the_assign_file/did_0+0+1/
status: local 0/10 remote 0/20
end msg 240488

Nevertheless, the mail is delivered fine.

Regards
Jochen



Re: [vchkpw] Strange messages in qmail-send log after upgrading to vpopmail 5.3.27

2003-10-01 Thread Jochen Schug
Tom Collins wrote:

On Wednesday, October 1, 2003, at 01:10  PM, Jochen Schug wrote:

And that's what it looks like with 5.3.27:

new msg 240629
info msg 240629: bytes 79927 from <*removed*> qp 13841 uid 106
starting delivery 24: msg 240629 to local  
[EMAIL PROTECTED]
status: local 1/10 remote 0/20
delivery 24: success:  
user_does_not_exist,_but_will_deliver_to_/home/vpopmail/domains/ 
*domainname*/postmaster// 
Error._Domain_postmaster_was_not_found_in_the_assign_file/did_0+0+1/
status: local 0/10 remote 0/20
end msg 240629


I think I may have found the cause.  Does the pathname in your  
.qmail-default file include a trailing "/"?  vdelivermail is adding a  
"/" at the end, and I think it may be doing a double-slash (which  
messes up code later on that tried to figure out the domain name from  
the path).
Tom,

I'm afraid that's not the case. I checked the .qmail-default file, 
here's its content:

| /home/vpopmail/bin/vdelivermail '' 
/home/vpopmail/domains/*domainname*/postmaster

The code in domain_over_maildirquota() in maildirquota.c is kind of  
screwy, and I think that's where the problem is.  It's going through  
the directory name, and deciding that 'postmaster' is the domain name  
instead of '*domainname*'.  I'm not sure why it's mis-counting it now  
(unless it's the double-/).

That function definitely has problems -- if strstr(domdir, 
"/Maildir/")  fails, then p is NULL and the code that follows (while 
(*(--p) !=  '/');) is not good.

Perhaps Brian Kolaci can provide some details on that function.  
Could  we outright replace it with a function that took the domain 
name as a  parameter?  vdelivermail should know what domain it's 
processing mail  for by the time it needs to call that function.


Regards
Jochen



Re: [vchkpw] Strange messages in qmail-send log after upgrading to vpopmail 5.3.27

2003-10-01 Thread Tom Collins
On Wednesday, October 1, 2003, at 01:10  PM, Jochen Schug wrote:
And that's what it looks like with 5.3.27:

new msg 240629
info msg 240629: bytes 79927 from <*removed*> qp 13841 uid 106
starting delivery 24: msg 240629 to local  
[EMAIL PROTECTED]
status: local 1/10 remote 0/20
delivery 24: success:  
user_does_not_exist,_but_will_deliver_to_/home/vpopmail/domains/ 
*domainname*/postmaster// 
Error._Domain_postmaster_was_not_found_in_the_assign_file/did_0+0+1/
status: local 0/10 remote 0/20
end msg 240629
I think I may have found the cause.  Does the pathname in your  
.qmail-default file include a trailing "/"?  vdelivermail is adding a  
"/" at the end, and I think it may be doing a double-slash (which  
messes up code later on that tried to figure out the domain name from  
the path).

The code in domain_over_maildirquota() in maildirquota.c is kind of  
screwy, and I think that's where the problem is.  It's going through  
the directory name, and deciding that 'postmaster' is the domain name  
instead of '*domainname*'.  I'm not sure why it's mis-counting it now  
(unless it's the double-/).

That function definitely has problems -- if strstr(domdir, "/Maildir/")  
fails, then p is NULL and the code that follows (while (*(--p) !=  
'/');) is not good.

Perhaps Brian Kolaci can provide some details on that function.  Could  
we outright replace it with a function that took the domain name as a  
parameter?  vdelivermail should know what domain it's processing mail  
for by the time it needs to call that function.

--
Tom Collins
[EMAIL PROTECTED]
QmailAdmin: http://qmailadmin.sf.net/  Vpopmail: http://vpopmail.sf.net/
Info on the Sniffter hand-held Network Tester: http://sniffter.com/