Re: [vchkpw] Problems with 5.3.29

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

i have a problem with the pop auth... i get for every user a pop
access denied.. it's not apop. i have compiled without the
roaming-user option.


If you use Courier-IMAP, did you recompile it after installing the new 
vpopmail?

Is anyone out there successfully making POP connections with 5.3.29?
Yes, still works fine for me, I'm using qmail-pop3d with vchkpw. Also, 
my courier-imap still works, even without recompiling.

./configure  --enable-logging=y --enable-ucspi-dir=../ucspi-tcp-0.88 
--enable-passwd=y --enable-tcpserver-file=/etc/tcp.smtp 
--enable-defaultquota=50M --enable-domainquotas=y

Regards
Jochen



Re: [vchkpw] adding domains error

2003-10-21 Thread Jochen Schug
X-Istence wrote:

Tom Collins wrote:

On Tuesday, October 21, 2003, at 09:11  AM, Trey Nolen wrote:

After upgrading to 5.3.29, we are getting the following error when 
trying to
add a domain:
Error: (vadduser) can't read domain limits
If you have a ~vpopmail/etc/vlimits.default file, it should work.

Ok, this seems to be a new requirement for 5.3.29 - after creating the 
file with the default values Justin mentioned in another mail, it works 
now for me, too.

I'll look into having the install process create that file if it 
doesn't already exist.

Good idea :)

Should we update the code so that it doesn't generate an error if 
neither .qmailadmin-limits or vlimits.default exist?
It shouldnt generate an error if either doesnt exist. As it would then 
make the admin freak.
I see three possible solutions:
- Creating the missing file with the default values (i.e. no limits) if 
it doesn't exist.
- Don't create the file, but don't complain about it either. Just use 
the default values as with before 5.3.29
- Throw an error message, and point out how to fix it (i.e. provide a 
vlimits.default-example file with the installation)

Also in your post about the new release, i suggest you take a look at 
the problems the person had, and see how those happened :)
That was me ;) As mentioned above, creating the vlimits.default file 
solved the problems for me, too.

Regards
Jochen



Re: [vchkpw] adding domains error

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

On Tuesday, October 21, 2003, at 11:28  AM, Jochen Schug wrote:

Is there a documentation about what these values mean? What's the 
difference between quota, default_quota, perm_quota and 
perm_defaultquota?
Here's the file I built for the distribution which includes some 
details on what everything means.
Thanks, Tom :)  That explains it well.

# Default limits file.  This file is used for domains without a
# .qmailadmin-limits file.
# maximums for each account type, -1 = unlimited
maxpopaccounts  -1
maxforwards -1
maxautoresponders   -1
maxmailinglists -1
# quota for entire domain, in megabytes
# example shows a domain with a 100MB quota and a limit of 10,000 
messages
#quota  100
Unless the behaviour changed, shouldn't this read 104857600 instead of 100?

A general question regarding domain limits: What would be the correct 
behaviour when I add a new domain and have the limits in 
~vpopmail/etc/vlimits.default? Should a .qmaladmin-limits under the new 
domain, with the data from the default file, be created? Or should such 
a domain automatically refer to the data from default file (- when I 
change the defaults, all existing domains with no .qmailadmin-limits are 
affected by the change)?

I noticed that there's no .qmailadmin-limits file created when I add a 
new domain, but when I check the domain limits with vmoddomlimits -S, 
the default values from the time when I added the domain are shown (even 
when I edit the vlimits-default file in the meantime). Where do these 
values come from?

Regards
Jochen



Re: [vchkpw] adding domains error

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

On Tuesday, October 21, 2003, at 12:50  PM, Jochen Schug wrote:

# quota for entire domain, in megabytes
# example shows a domain with a 100MB quota and a limit of 10,000 
messages
#quota  100


Unless the behaviour changed, shouldn't this read 104857600 instead 
of 100?
Actually, that's a little inconsistency we have right now.
I checked my existing .qmailadmin-limits file for the values that are 
written by vmoddomlimits, that's where I got the 104857600 from.

maildirquota.c multiplies the number by 1024*1024, so it definitely 
considers it MB.

vmoddomlimits writes it out exactly as provided on the command line, 
which probably isn't a good idea now that we allow KB and MB modifiers 
(since if I say -Q 100M, I want 100MB, not 100TB).  The reason it's 
currently parsed, was in response to earlier bug reports that it 
wasn't (and it wasn't because it shouldn't have been).

I've updated vmoddomlimits to indicate that the -Q option is megabytes 
and -q is bytes.  The -S options adds MB after the domain quota and 
bytes after the default user quota when displaying the information.
Ok, fair enough. But - again just my humble opinion - this introduces 
two different metrics the user/admin has to get right... changing the 
code in maildirquota.c so that it expects a value in bytes instead of 
megabytes, and consitent metrics for vmoddomlimits' -q and -Q options 
(incl. parsing of the latter) would be easier to handle.


A general question regarding domain limits: What would be the correct 
behaviour when I add a new domain and have the limits in 
~vpopmail/etc/vlimits.default? Should a .qmaladmin-limits under the 
new domain, with the data from the default file, be created? Or 
should such a domain automatically refer to the data from default 
file (- when I change the defaults, all existing domains with no 
.qmailadmin-limits are affected by the change)?
Current (and I think the expected) behavior is to not create a 
.qmailadmin-limits file.  For sites that don't have domain-specific 
limits, this allows for easy updating of limits.
Exactly... this can be good or bad, depending on whether or not this is 
desired by the user. I really don't know what's better :) Maybe giving 
the user the choice (by adding another option to vadddomain) to copy or 
symlink the defaults would be a convenient solution.

I noticed that there's no .qmailadmin-limits file created when I add 
a new domain, but when I check the domain limits with vmoddomlimits 
-S, the default values from the time when I added the domain are 
shown (even when I edit the vlimits-default file in the meantime). 
Where do these values come from?
They come from ~vpopmail/etc/vlimits.default (not vlimits-default).  I 
checked on my system, and after modifying vlimits.default, 
vmoddomlimits -S reported the updated values.
You're right - I tried it again, and it works as expected... don't know 
what I did before, I was pretty sure that I saw the behaviour as I 
stated above. Sorry for the false alarm.

Regards
Jochen




Re: [vchkpw] Vpopmail 5.3.29 released

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

http://vpopmail.sf.net/

More bug fixes as we move toward a stable 5.4 release.

This version includes changes to the configure and build process, so 
please post bug reports to the bug tracker on SourceForge if you 
encounter any problems with configure/build.
Seems to be broken for me:

# vadddomain test.com bla
Error: (vadduser) can't read domain limits
# vdominfo test.com
domain: test.com
uid:509
gid:511
dir:/home/vpopmail/domains/test.com
users:  0
# vmoddomlimits -S test.com
Failed to vget_limits
# vmoddomlimits -S previously-existing-domain.com
Failed to vget_limits
My config: ./configure  --enable-logging=y 
--enable-ucspi-dir=../ucspi-tcp-0.88 --enable-passwd=y 
--enable-tcpserver-file=/etc/tcp.smtp --enable-defaultquota=50M 
--enable-domainquotas=y

...back to 5.3.28.

Regards
Jochen



Re: [vchkpw] Multi domain bounce message handling

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

On Friday, October 17, 2003, at 05:27  PM, David Bristol wrote:

This may not be the way to go about this, but have you verified that
both domains are in the qmail/control/locals file?


Don't put vpopmail domains in control/locals.  You'll mess things up.

There isn't a known solution to what was asked.  Doublebounces go to 
the postmaster of the server.  Bounce messages refer to the name of 
the physical server, and not the domain name.

You might be able to modify qmail-send, but it would be very difficult 
to determine what hostname to use in the bounce message.
There's actually a patch to qmail-send that does this, I've attached it 
to this mail. It was originally posted  on the qmail-list if I remember 
correctly. I've been using it for over a year, and it appears to work 
fine. But I'm not the author - if it doesn't work for you, don't blame me.

What if there are multiple recipients that bounced?
Then there are multiple bounce messages.

What if it's a message one of your user's is trying to send to a 
hotmail address?  You don't want it to say that your server is 
hotmail.com.
Well, I'm no expert - but the local mail server should only generate 
bounces it the mail is directed to one of the local domains. Otherwise, 
it should either not accept the mail at all, or relay it to the 
appropriate MX. If this MX can't deliver the mail, it will generate a 
bounce message on its own.

Regards
Jochen
--- qmail-send.c.orig   Tue Jun 11 17:59:23 2002
+++ qmail-send.cTue Jun 11 17:59:36 2002
@@ -193,6 +193,37 @@
 }
 
 
+int recipdomain(rd,fn2)
+stralloc* rd;
+stralloc fn2;
+{
+ int fd;
+ int ret = 0;
+ 
+ fd = open_read(fn2.s);
+ if (fd != -1)
+  {
+   int r;
+   char inbuf[128];
+   char buf[2];
+   substdio ssread;
+ 
+   buf[0] = 0; buf[1] = 0;
+   substdio_fdbuf(ssread,read,fd,inbuf,sizeof(inbuf));
+   while (((r = substdio_get(ssread,buf,1))  0)  (buf[0] != '@'));
+   if (buf[0] == '@')
+{
+  while (((r = substdio_get(ssread,buf,1))  0)  (buf[0] != ''))
+stralloc_cats(rd,buf);
+  stralloc_0(rd);
+  ret = (buf[0] == '');
+}
+   close(fd);
+  }
+  return ret;
+}
+ 
+ 
 /* this file is too long -- INFO */
 
 int getinfo(sa,dt,id)
@@ -659,8 +690,10 @@
  char inbuf[128];
  static stralloc sender = {0};
  static stralloc quoted = {0};
+ stralloc rdomain = {0};
  datetime_sec birth;
  unsigned long qp;
+ int rd = 0;
 
  if (!getinfo(sender,birth,id)) return 0; /* XXX: print warning */
 
@@ -685,6 +718,10 @@
log3(triple bounce: discarding ,fn2.s,\n);
  else
   {
+   rd = recipdomain(rdomain,fn2);
+   if (rd)
+ log3(modified bouncehost: ', rdomain.s, '\n);
+
if (qmail_open(qqt) == -1)
 { log1(warning: unable to start qmail-queue, will try later\n); return 0; }
qp = qmail_qp(qqt);
@@ -698,7 +735,10 @@
while (!quote(quoted,bouncefrom)) nomem();
qmail_put(qqt,quoted.s,quoted.len);
qmail_puts(qqt,@);
-   qmail_put(qqt,bouncehost.s,bouncehost.len);
+   if (rd)
+ qmail_put(qqt,rdomain.s,rdomain.len);
+   else
+ qmail_put(qqt,bouncehost.s,bouncehost.len);
qmail_puts(qqt,\nTo: );
while (!quote2(quoted,bouncerecip)) nomem();
qmail_put(qqt,quoted.s,quoted.len);
@@ -706,7 +746,10 @@
 Subject: failure notice\n\
 \n\
 Hi. This is the qmail-send program at );
-   qmail_put(qqt,bouncehost.s,bouncehost.len);
+   if (rd)
+ qmail_put(qqt,rdomain.s,rdomain.len);
+   else
+ qmail_put(qqt,bouncehost.s,bouncehost.len);
qmail_puts(qqt,*sender.s ? .\n\
 I'm afraid I wasn't able to deliver your message to the following addresses.\n\
 This is a permanent error; I've given up. Sorry it didn't work out.\n\


Re: [vchkpw] Upgrading from 5.3.20 to 5.3.28

2003-10-16 Thread Jochen Schug
Eduardo M. Bragatto wrote:

What do I need to know before upgrading from this version to that one?!
Is there any changes that I need to do about? I'm using CDB to store 
users/passes.
 

Eduardo,

A while ago I upgraded from 5.3.20 to 5.3.27 and recently to 5.3.28. The 
upgrade was easy and hassle-free. The only thing that kept me busy was 
the smtp-auth patch I applied to qmail-smtpd, and that's not vpopmail's 
fault. After the upgrade, I wasn't able to send out mail anymore, all I 
got were authentication errors. In order to authenticate with vchkpw, 
the program must be setuid root. After a make install-strip, the newly 
installed version lost these rights. A simple chmod 4755 
~vpopmail/bin/vchkpw  chown root.root ~vpopmail/bin/vchkpw solved that.

Regards
Jochen



[vchkpw] vmoddomlimits doesn't know kilo- and megabyte-abbreviations

2003-10-11 Thread Jochen Schug
Hi,

I noticed that vmoddomlimits doesn't care about a trailing 'M' or 'K' 
when specifing quotas... Instead of complaining that there's an unknown 
character in the quota, it silently ignores it. I ended up with a domain 
with 100 byte quota and 20 byte per-user quota, and only noticed it from 
the bouncing messages in the qmail-send log.

An example to illustrate what I mean:

$ vmoddomlimits -Q 100M -q 20M example.com

results in a 100 byte quota for domain example.com, and 20 byte default 
quota for users.

IMO, vmoddomlimits should be changed to accept these abbreviations, or 
at least complain when I specify a quota and it can't handle it properly 
- instead of just silently ignoring invalid characters.

Regards
Jochen



Re: [vchkpw] different per user quotas on a single domain

2003-10-11 Thread Jochen Schug
[EMAIL PROTECTED] wrote:

Say, during setup of vpopmail initially, I setup a default quota of 10m.  I use
the latest vpopmail/qmailadmin and don't allow domain postmasters to change
quotas (must be done through commandline only).
Now, let's say I add 3 domains: domain1.com, domain2.com, and domain3.com. 
domain1.com is to have all their subsequent users to have 10m quotas - no big
deal.  Everytime their postmaster logs in and creats a new user, it gets
assigned a 10m quota.

Now, I want all the users of domain2.com to have a 20m quota.  Is there a way to
automate this?  Initially, when [EMAIL PROTECTED] is created it is
automatically assigned a 10m quota and I would have to change that myself. NOTE:
I am not talking about domain quotas (since that is always the response I get)!
I'm talking about per user domain quotas aside from the set quota during
initial configuration.
So with that in mind, I want domain2.com's users to EACH have a 20m quota now. 
Since I am not the one adding the users (their postmaster is through qmailadmin
and he doesn't have the ability to modify quotas...as how can you trust that
he'll put 20m each time, heh?

Does this make sense?  I believe this is what Justin was trying to describe and
what I've been trying to find an answer to for months now.  If this currently
isn't possible, does anyone else think this would be a great feature to add?
Unless I'm not getting this right, vmoddomlimits should be exactly what 
you need:

vmoddomlimits: usage: [options] domain
options: -v ( display the vpopmail version number )
-S ( show current settings )
-Q quota ( set domain quota )
-q quota ( set default user quota )
So a one-time vmoddomlimits -q 20971520 domain2.com, together with a 
vmoduser -q 20971520 [EMAIL PROTECTED] for the postmaster 
account, and you're done.

Regards
Jochen



Re: [vchkpw] different per user quotas on a single domain

2003-10-11 Thread Jochen Schug
Alexander Bruns wrote:

I am traying to get quota work for my installation og vpopmail stable (5.2.1)
 

I don't know how reliable the quota support in vpopmail-5.2.1 is, in the 
developement branch it's working pretty good. One big improvement is the 
per-domain quota, and not just on a per-user basis (I don't want my 
users to create 100 accounts per domain that take up 20 megs each).

I tried to reproduce the behaviour you mentioned in your other mail, but 
I have vpopmail compiled with a default quota size, so the maildirsize 
file is created automatically when I add a user.

Unless I'm not getting this right, vmoddomlimits should be exactly what
you need:
vmoddomlimits: usage: [options] domain
options: -v ( display the vpopmail version number )
-S ( show current settings )
-Q quota ( set domain quota )
-q quota ( set default user quota )
So a one-time vmoddomlimits -q 20971520 domain2.com, together with a
vmoduser -q 20971520 [EMAIL PROTECTED] for the postmaster
account, and you're done.
   

I do not have the command /home/vpopmail/bin/vmoddomlimits.
Is this a feature of the develment versions of vpopmail?
 

Yes, it is indeed. I'm currently running 5.3.27.

Regards
Jochen



Re: [vchkpw] qmailadmin-1.0.27 error on rh7.3

2003-10-09 Thread Jochen Schug
[EMAIL PROTECTED] wrote:

I'm trying to compile qmailadmin-1.0.27 and I'm getting the following error:

gcc -I. -I/usr/local/vpopmail/include  -g -O2 -c qmailadmin.c
qmailadmin.c:32:21: vlimits.h: No such file or directory
qmailadmin.c:67: error: storage size of `Limits' isn't known
make: *** [qmailadmin.o] Error 1
I'm using gcc 3.3.1 on a redhat 7.3 box.

Here are my configure options:

./configure --enable-vpopmaildir=/usr/local/vpopmail
--enable-htmldir=/usr/local/www/webapps/qmailadmin
--enable-cgibindir=/usr/local/www/webapps/qmailadmin/cgi-bin
--enable-qmaildir=/var/qmail --enable-cgipath=/cgi-bin/qmailadmin
--enable-imagedir=/usr/local/www/webapps/qmailadmin/images
--enable-imageurl=/images --enable-autoresponder-bin --enable-ezmlmdir=/usr/bin
--enable-domain-autofill=Y --enable-modify-spam=Y
--enable-spam-command=|/usr/local/bin/maildrop /usr/local/vpopmail/spamfilter
Btw, I can compile 1.0.6 just fine, but I wanted the spam-command option.

Any ideas?
 

What version of vpopmail are you using? From your previous post, I asume
5.2.1 or 5.2.2... Read the requirements of the recent qmailadmin release
- you'll need at least 5.3.19 IIRC.
Regards
Jochen




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

2003-10-01 Thread Jochen Schug
Hi,

I'm running qmail for quite a while now, and recently decided to give 
the latest vpopmail version a try. So I upgraded from 5.3.20 to 5.3.27. 
Everything works fine so far, except that I'm getting some weird log 
entries when mail is delivered to a catchall address. The mail is 
delivered fine, despite the error message.

Here's an example of what it looked like before the upgrade (I've 
removed the real domain name with *domainname*):

new msg 240765
info msg 240765: bytes 13833 from *removed* qp 16950 uid 106
starting delivery 30350: msg 240765 to local [EMAIL PROTECTED]
status: local 1/10 remote 0/20
delivery 30350: success: 
user_does_not_exist,_but_will_deliver_to_/home/vpopmail/domains/*domainname*/postmaster/Maildir//did_0+0+1/
status: local 0/10 remote 0/20
end msg 240765

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've read before that some new error checking code was added in 5.3.26; 
maybe that's the reason for this, too? Any help is appreciated.

Thanks
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 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