Re: [vchkpw] Re: maildir++ patch doesn't solve the problem

2003-10-01 Thread Doug Clements
On Sat, Sep 20, 2003 at 08:58:37AM -0700, Tim Hasson wrote:
> I do not use/like sqwebmail, but what you did simplifies a lot of things. 
> sqwebmail doesn't do much special. The only thing I like about it is it access 
> maildir's directly.

Same here, and it can edit maildrop filters. I have on my todo list a maildrop filter 
editor web page so we can replace sqwebmail functionality, or at least give users a 
choice. It's pretty far down on my list, though.

> > I would too, and I do. The authoritative source of info is in the database,
> > and when the users file gets created, the database is consulted for the
> > proper value. When it's updated, a script goes back to update the users file.
> > This also allows for delivery should the database go down, and is less
> > database load in general.
> 
> This is very nice. Can you elaborate more on the above? Do you mind sharing 
> your script(s)?

I've been trying to make time to sanitize my scripts for publication, but I've just 
been so swamped. That's why it's taken so long to reply, and I apologize.

What I basically have is wrapper around each vpopmail command. The billing system sets 
user preferences such as if they get spam filtering. Then the billing system inserts a 
task into a database that the mail cluster checks for. It picks up the tasks and runs 
the wrapper, which involves adding the user with the vpopmail vadduser command, then 
consulting the billing database for user preferences. The wrapper writes out all the 
default filters, and quota and spam preferences and all that fun. It's pretty simple, 
actually.

When the spam preferences or the quota settings get changed, the billing system pushes 
out an update command. The mail cluster picks this up and re-writes the appropriate 
files.

In this way, we have the authoritative source of info available for lookup by billing 
and tech support, yet the system still runs independantly of other systems.

> Yes, I agree. My excuse here was that the second command would only be run if 
> the maildirsize file was not found. This still has the double exec effect on 
> delivery to accounts with no quota :/

Yeah, that's a nice and straightforward way of doing it, and probably works fine for 
low-volume systems. I'm still trying to optimize further by reducing the number of 
filter files maildrop needs to open, but I haven't come up with a clean way of that 
yet. Really though, this is all a drop in the bucket when I'm running spamc for spam 
filtering customers =)

--Doug



Re: Fwd: Re: [vchkpw] Re: maildir++ patch doesn't solve the problem

2003-09-25 Thread o k
The quota update hasn't been solved yet.
The README.quota file in vpopmail-5.2 states that :
qmail-pop3d does not update maildirsize when you delete messages.  This
   problem will correct itself within 15 minutes, since the Maildir++ spec
   dictates that the maildirsize file must be recalculated at least every
   15 minutes.  But there are 2 ways to avoid this:
   1. Patch qmail with the qmail-pop3d-maildirquota.patch in the contrib
  directory.
   2. Use courier's pop server which ships with courier-imap.  It supports
  maildirquotas natively.  See http://www.inter7.com/courierimap for
  details.
---
I have several problems:
1.The maildirsize update does not happen after 15 minutes.
2.I patched qmail with qmail-pop3d-maildirquota.patch  but when i started to 
issue the make setup check command an error occured in the qmail-pop3d.c 
file.

I really need a solution to this problem or even a document stating it.

Many thanks.







From: "o k" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Fwd: Re: [vchkpw] Re: maildir++ patch doesn't solve the problem
Date: Thu, 18 Sep 2003 14:06:44 +
Dear sir,

   I used your mailfilter script
   I don't know if this patch solves the problem i stated before:
   The problem is that the quota displayed after I retrieve mails through 
pop3 is not updated.

Thanks




From: Tamer Hassan <[EMAIL PROTECTED]>
To: o k <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
Subject: Re: [vchkpw] Re: maildir++ patch doesn't solve the problem
Date: Thu, 18 Sep 2003 05:11:22 -0700
Try using courier maildrop for delivery instead of vdelivermail.

I just switched all my domains (on nfs) .qmail-default's to invoke 
maildrop
instead of vdelivermail also because of problems with maildirsize not 
being
rebuilt and/or getting really screwed up. The problem happened very 
randomly
and cannot be duplicated easily, but happens over days to random
accounts/domains that used vdelivermail.

I am doing this using two files in each domain directory, .qmail-default 
and
mailfilter (basic version no filtering), both have to be owned by vpopmail 
and
vchkpw, and chmod 700 or it will not work

Please let me know if there is a better way..

# cat .qmail-default
| /usr/local/bin/maildrop mailfilter
# cat mailfilter
SHELL="/bin/sh"
import EXT
import HOST
VHOME=`/home/vpopmail/bin/vuserinfo -d [EMAIL PROTECTED]
`test -d $VHOME/Maildir`
if ( $RETURNCODE == 1 )
{
   echo "Sorry, no mailbox here by that name. (#5.1.1)"
   EXITCODE=100
   exit
}
# Make sure the quota file is in place.
# Vpopmail does not create it by default.
# Vpopmail also removes it when you change the quota.
`test -s "$VHOME/Maildir/maildirsize"`
if ( $RETURNCODE == 1 )
{
   `/home/vpopmail/bin/vuserinfo -Q [EMAIL PROTECTED]
   `test -s "$VHOME/Maildir/maildirsize"`
   if ( $RETURNCODE == 0 )
   {
  `/usr/sbin/chown vpopmail:vchkpw $VHOME/Maildir/maildirsize`
  `/bin/chmod 640 $VHOME/Maildir/maildirsize`
   }
}
# Default delivery
exception {
to "$VHOME/Maildir/"
}
I have another mailfilter template which does spam filtering with 
spamassassin
2.55 (w/ mysql prefs per user), which I enable only for a specific domain, 
or
can be modified to do per-user when invoked from user's .qmail file.

Quoting o k <[EMAIL PROTECTED]>:

>
> Thanks for your reply.
> But what can solve the quota update problem?
>
> >From: Charles Cazabon <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: Re: maildir++ patch doesn't solve the problem
> >Date: Sun, 14 Sep 2003 09:14:01 -0600
> >
> >o k <[EMAIL PROTECTED]> wrote:
> > > Then I patched it:
> > >   cd qmail-1.03
> > >   patch < qmail-maildir++.patch
> >
> >Don't.  "maildir++" is broken by design and violates the letter and 
spirit
> >of
> >the maildir specification; it also makes the maildir unsafe for use 
over
> >NFS
> >without locking, which is one of the basic reasons for the existence 
of
> >maildir.
> >
> >Charles
> >--
> 
>---
> >Charles Cazabon
<[EMAIL PROTECTED]>
> >GPL'ed software available at: 
http://www.qcc.ca/~charlesc/software/
> >Read 
http://www.qcc.ca/~charlesc/writings/12-steps-to-qmail-list-bliss.html
> 
>---
>
> _
> MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
> http://join.msn.com/?page=features/virus
>
>

>

Respectfully,
Tamer Hassan
_
The new MSN 8: advanced junk mail protection and 2 months FREE* 
http://join.msn.com/?page=features/junkmail


_
Add photos to your messages with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail




Re: [vchkpw] Re: maildir++ patch doesn't solve the problem

2003-09-24 Thread Charles Sprickman
On Fri, 19 Sep 2003, Tim Hasson wrote:

> I am not setting the environment variable MAILDIRQUOTA for some reasons:
>
> 1. If user has access to their maildrop filter, or they have shell access,
> then the MAILDIRQUOTA makes no sense.

I didn't even know there was a MAILDIRQUOTA environment variable (this is
generated by vdelivermail?).  In my case, this might work better (no shell
access).  Is there documentation anywhere as to what environment variables
are available in qmail-local and vdelivermail?

> `test -s "$VHOME/Maildir/maildirsize"`
> if ( $RETURNCODE == 1 )
> {
>`/home/vpopmail/bin/vuserinfo -Q [EMAIL PROTECTED]
>
>`test -s "$VHOME/Maildir/maildirsize"`
>if ( $RETURNCODE == 0 )
>{
>   `/usr/sbin/chown vpopmail:vchkpw $VHOME/Maildir/maildirsize`
>   `/bin/chmod 640 $VHOME/Maildir/maildirsize`
>}
> }

This is working wonderfully for me right now.  I just ran through a
battery of tests, and quotas in general seem to be working correctly.

I do have one lingering question about how quotas are calculated.  I had
my test user setup with a 20M quota.  Usage was around 18M.  I pulled over
a bunch of mboxes and converted them to Maildir.  Chowned them properly,
bringing the usage up to about 35M.  Sent some test mails to the account,
checked mail via IMAP, quota was still showing 18M usage.  Later the next
day, mail started bouncing with an overquota message.  Questions:

-what later kicked in to tally up the new usage numbers?
-after modifying the quota with vmoduser, the only way to let the quota
system know that there was now at 40M was to blow away the maildirsize
file.  Is this correct behaviour?  I don't think it's really a problem as
there's no way for a normal user to inject more mail without passsing
through some quota-aware program.

Thanks,

Charles


> Respectfully,
> Tim Hasson
>
>
> Quoting Doug Clements <[EMAIL PROTECTED]>:
>
> > On Thu, Sep 18, 2003 at 05:10:29PM -0700, Tim Hasson wrote:
> > > BTW,
> > >
> > > I had a problem before where if I changed a user quota using vpop's
> > > vsetuserquota, the maildirsize file in the user's maildir will
> > automagically
> > > get deleted, but never recreated by maildrop (for the domain I was doing
> > > filtering for) So that's why i put the check in mailfilter script to see if
> >
> > > maildirsize needs to be recreated.
> > >
> > > Shouldn't maildrop create the maildirsize file if it doesn't exist?
> > >
> > > I think when I used vdelivermail, it created maildirsize when a new message
> >
> > > was received in the mailbox that didn't have maildirsize in place, but with
> >
> > > quota limit on it.
> > >
> > > Now, as far as I recall, Bill Shupp made the maildir++ patch based on the
> > code
> > > from maildrop, so I am not surprised it doesn't recreate the maildirsize
> > > file ;-)
> > >
> > > Respectfully,
> > > Tim Hasson
> >
> > Hm.. maildrop creates maildirsize for me. Are you sure you're setting the
> > MAILDIRQUOTA environment variable when you run maildrop?
> >
> > When I create a user, it creates all the maildrop recipes for that user,
> > including one that sets MAILDIRQUOTA (in addition to setting the quota with
> > vsetuserquota, which only seems to set it in the database). I've tested
> > multiple times, and the maildirsize file behavior is what you'd expect; the
> > file gets created on first delivery, and it gets recreated when it gets big.
> > Naturally I don't expect maildrop to directly use vpopmail quota settings,
> > which is why I set the variable.
> >
> > --Doug
> >
>
> >
> >
>
>
>
>



Re: [vchkpw] Re: maildir++ patch doesn't solve the problem

2003-09-20 Thread Tim Hasson
Quoting Doug Clements <[EMAIL PROTECTED]>:

> On Fri, Sep 19, 2003 at 03:57:26PM -0700, Tim Hasson wrote:
> > I am not setting the environment variable MAILDIRQUOTA for some reasons:
> > 
> > 1. If user has access to their maildrop filter, or they have shell access,
> 
> > then the MAILDIRQUOTA makes no sense.
> 
> My users use sqwebmail to access their filter file. I solved the overwriting
> problem by having maildrop first call a mailfilter-standard file. It includes
> the mailfilter-quota file, then includes the mailfilter-sqwebmail file.
> sqwebmail is free to edit it's own filter without messing with the quota
> settings.
> 

I do not use/like sqwebmail, but what you did simplifies a lot of things. 
sqwebmail doesn't do much special. The only thing I like about it is it access 
maildir's directly.

> None of my users have shell access, so I don't have to worry about that. You
> could make the case that they could still edit their maildrop filter and
> remove the part where they lookup the quota, as well.
> 
> > 2. I rather have all user information (including quotas) set in vpopmail's
> 
> > mysql db, for administration reasons.
> 
> I would too, and I do. The authoritative source of info is in the database,
> and when the users file gets created, the database is consulted for the
> proper value. When it's updated, a script goes back to update the users file.
> This also allows for delivery should the database go down, and is less
> database load in general.

This is very nice. Can you elaborate more on the above? Do you mind sharing 
your script(s)?

> 
> > 3. Eventually, I do not want to use maildrop at all, except maybe for 
> > filtering. But I'd like to find a better solution.
> 
> I find maildrop to work great for final delivery. I call a single program in
> the users .qmail file, and it takes care of everything. No forking, no
> external calls, no nothing. I figure if you're going to use it in one place,
> you might as well standardize and use it everywhere. It's easier to keep up
> with a single delivery agent than 3, especially when maildrop does everything
> you need.
> 

You're exactly right. As I gave up on a good way to assemble everything 
together, I thought I should eventually give up either vpop or maildrop..
I'd hate to give vpop up though.

> > And because I do not set the variable MAILDIRQUOTA, my mailfilter contains
> a 
> > section like so:
> > 
> > VHOME=`/home/vpopmail/bin/vuserinfo -d [EMAIL PROTECTED]
> 
> That's an external program that in my opinion doesn't need to be run for
> every single delivery. 
> 

Sure. That part I hated most. But in my case, I had no other solutions 
available. I needed to switch over immediately to maildrop to avoid 
maildirsize regeneration problems with vdelivermail over nfs.

> [...]
> >`/home/vpopmail/bin/vuserinfo -Q [EMAIL PROTECTED]
> 
> That's 2 extra programs per mail delivery, times how many ever mails a day
> you get. I guess maybe I'm anal about optimizing this sort of thing, but if I
> can avoid that (and I can) then I will (and I did).
> 

Yes, I agree. My excuse here was that the second command would only be run if 
the maildirsize file was not found. This still has the double exec effect on 
delivery to accounts with no quota :/

> With regard to the url you posted in another message:
> http://www.geocrawler.com/archives/3/9569/2001/4/0/5564545/
> 
> Sqwebmail does have support for updating maildirsize, I knew that, but
> setting MAILDIRSIZE in the generated filter file doesn't seem to work on my
> system. No biggy, I don't need it anyway =)
> 
> Hope your problems are closer to being solved!

Thank you! You've been quite helpful :)

> 
> --Doug
> 

> 


Respectfully,
Tim Hasson



Re: [vchkpw] Re: maildir++ patch doesn't solve the problem

2003-09-20 Thread Doug Clements
On Fri, Sep 19, 2003 at 03:57:26PM -0700, Tim Hasson wrote:
> I am not setting the environment variable MAILDIRQUOTA for some reasons:
> 
> 1. If user has access to their maildrop filter, or they have shell access, 
> then the MAILDIRQUOTA makes no sense.

My users use sqwebmail to access their filter file. I solved the overwriting problem 
by having maildrop first call a mailfilter-standard file. It includes the 
mailfilter-quota file, then includes the mailfilter-sqwebmail file. sqwebmail is free 
to edit it's own filter without messing with the quota settings.

None of my users have shell access, so I don't have to worry about that. You could 
make the case that they could still edit their maildrop filter and remove the part 
where they lookup the quota, as well.

> 2. I rather have all user information (including quotas) set in vpopmail's 
> mysql db, for administration reasons.

I would too, and I do. The authoritative source of info is in the database, and when 
the users file gets created, the database is consulted for the proper value. When it's 
updated, a script goes back to update the users file. This also allows for delivery 
should the database go down, and is less database load in general.

> 3. Eventually, I do not want to use maildrop at all, except maybe for 
> filtering. But I'd like to find a better solution.

I find maildrop to work great for final delivery. I call a single program in the users 
.qmail file, and it takes care of everything. No forking, no external calls, no 
nothing. I figure if you're going to use it in one place, you might as well 
standardize and use it everywhere. It's easier to keep up with a single delivery agent 
than 3, especially when maildrop does everything you need.

> And because I do not set the variable MAILDIRQUOTA, my mailfilter contains a 
> section like so:
> 
> VHOME=`/home/vpopmail/bin/vuserinfo -d [EMAIL PROTECTED]

That's an external program that in my opinion doesn't need to be run for every single 
delivery. 

[...]
>`/home/vpopmail/bin/vuserinfo -Q [EMAIL PROTECTED]

That's 2 extra programs per mail delivery, times how many ever mails a day you get. I 
guess maybe I'm anal about optimizing this sort of thing, but if I can avoid that (and 
I can) then I will (and I did).

With regard to the url you posted in another message: 
http://www.geocrawler.com/archives/3/9569/2001/4/0/5564545/

Sqwebmail does have support for updating maildirsize, I knew that, but setting 
MAILDIRSIZE in the generated filter file doesn't seem to work on my system. No biggy, 
I don't need it anyway =)

Hope your problems are closer to being solved!

--Doug



Re: [vchkpw] Re: maildir++ patch doesn't solve the problem

2003-09-19 Thread Tim Hasson
Doug,

You might also want to look on a previous post by Mr Sam (might be a little 
outdated but I think it still holds valid):

http://www.geocrawler.com/archives/3/9569/2001/4/0/5564545/

The relevant part is:
--
So, it is necessary to bootstrap the whole process by manually initializing 
maildirsize using something like deliverquota, then using sqwebmail to 
generate .mailfilter that explicitly initialized MAILDIRQUOTA.  Then, 
everything will run by itself... 
--


Respectfully,
Tim Hasson


Quoting Tim Hasson <[EMAIL PROTECTED]>:

> I am not setting the environment variable MAILDIRQUOTA for some reasons:
> 
> 1. If user has access to their maildrop filter, or they have shell access, 
> then the MAILDIRQUOTA makes no sense.
> 
> 2. I rather have all user information (including quotas) set in vpopmail's 
> mysql db, for administration reasons.
> 
> 3. Eventually, I do not want to use maildrop at all, except maybe for 
> filtering. But I'd like to find a better solution.
> 
> 
> And because I do not set the variable MAILDIRQUOTA, my mailfilter contains a
> 
> section like so:
> 
> VHOME=`/home/vpopmail/bin/vuserinfo -d [EMAIL PROTECTED]
> 
> [...]
> 
> `test -s "$VHOME/Maildir/maildirsize"`
> if ( $RETURNCODE == 1 )
> {
>`/home/vpopmail/bin/vuserinfo -Q [EMAIL PROTECTED]
> 
>`test -s "$VHOME/Maildir/maildirsize"`
>if ( $RETURNCODE == 0 )
>{
>   `/usr/sbin/chown vpopmail:vchkpw $VHOME/Maildir/maildirsize`
>   `/bin/chmod 640 $VHOME/Maildir/maildirsize`
>}
> }
> 
> 
> The vuserinfo -Q [EMAIL PROTECTED] will create the maildirsize file, owned by
> root 
> (or whatever maildrop runs as), if it does not already exist.
> 
> This works pretty good.
> 
> After using maildrop for all deliveries on the NFS volume, I think I am not 
> having the problem with the negated quotas (possibly caused by 
> vdelivermail/qmail-local w/ maildir++ patch not rebuilding maildirsize) any 
> more.
> 
> It's only been a couple days, so I will wait until monday then I will 
> confirm :)
> 
> Respectfully,
> Tim Hasson
> 
> 
> Quoting Doug Clements <[EMAIL PROTECTED]>:
> 
> > On Thu, Sep 18, 2003 at 05:10:29PM -0700, Tim Hasson wrote:
> > > BTW,
> > > 
> > > I had a problem before where if I changed a user quota using vpop's 
> > > vsetuserquota, the maildirsize file in the user's maildir will
> > automagically 
> > > get deleted, but never recreated by maildrop (for the domain I was doing
> 
> > > filtering for) So that's why i put the check in mailfilter script to see
> if
> > 
> > > maildirsize needs to be recreated.
> > > 
> > > Shouldn't maildrop create the maildirsize file if it doesn't exist?
> > > 
> > > I think when I used vdelivermail, it created maildirsize when a new
> message
> > 
> > > was received in the mailbox that didn't have maildirsize in place, but
> with
> > 
> > > quota limit on it.
> > > 
> > > Now, as far as I recall, Bill Shupp made the maildir++ patch based on
> the
> > code 
> > > from maildrop, so I am not surprised it doesn't recreate the maildirsize
> 
> > > file ;-)
> > > 
> > > Respectfully,
> > > Tim Hasson
> > 
> > Hm.. maildrop creates maildirsize for me. Are you sure you're setting the
> > MAILDIRQUOTA environment variable when you run maildrop? 
> > 
> > When I create a user, it creates all the maildrop recipes for that user,
> > including one that sets MAILDIRQUOTA (in addition to setting the quota
> with
> > vsetuserquota, which only seems to set it in the database). I've tested
> > multiple times, and the maildirsize file behavior is what you'd expect;
> the
> > file gets created on first delivery, and it gets recreated when it gets
> big.
> > Naturally I don't expect maildrop to directly use vpopmail quota settings,
> > which is why I set the variable.
> > 
> > --Doug
> > 
> 
> > 
> > 
> 
> 
> 

> 





Re: [vchkpw] Re: maildir++ patch doesn't solve the problem

2003-09-19 Thread Tim Hasson
I am not setting the environment variable MAILDIRQUOTA for some reasons:

1. If user has access to their maildrop filter, or they have shell access, 
then the MAILDIRQUOTA makes no sense.

2. I rather have all user information (including quotas) set in vpopmail's 
mysql db, for administration reasons.

3. Eventually, I do not want to use maildrop at all, except maybe for 
filtering. But I'd like to find a better solution.


And because I do not set the variable MAILDIRQUOTA, my mailfilter contains a 
section like so:

VHOME=`/home/vpopmail/bin/vuserinfo -d [EMAIL PROTECTED]

[...]

`test -s "$VHOME/Maildir/maildirsize"`
if ( $RETURNCODE == 1 )
{
   `/home/vpopmail/bin/vuserinfo -Q [EMAIL PROTECTED]

   `test -s "$VHOME/Maildir/maildirsize"`
   if ( $RETURNCODE == 0 )
   {
  `/usr/sbin/chown vpopmail:vchkpw $VHOME/Maildir/maildirsize`
  `/bin/chmod 640 $VHOME/Maildir/maildirsize`
   }
}


The vuserinfo -Q [EMAIL PROTECTED] will create the maildirsize file, owned by root 
(or whatever maildrop runs as), if it does not already exist.

This works pretty good.

After using maildrop for all deliveries on the NFS volume, I think I am not 
having the problem with the negated quotas (possibly caused by 
vdelivermail/qmail-local w/ maildir++ patch not rebuilding maildirsize) any 
more.

It's only been a couple days, so I will wait until monday then I will 
confirm :)

Respectfully,
Tim Hasson


Quoting Doug Clements <[EMAIL PROTECTED]>:

> On Thu, Sep 18, 2003 at 05:10:29PM -0700, Tim Hasson wrote:
> > BTW,
> > 
> > I had a problem before where if I changed a user quota using vpop's 
> > vsetuserquota, the maildirsize file in the user's maildir will
> automagically 
> > get deleted, but never recreated by maildrop (for the domain I was doing 
> > filtering for) So that's why i put the check in mailfilter script to see if
> 
> > maildirsize needs to be recreated.
> > 
> > Shouldn't maildrop create the maildirsize file if it doesn't exist?
> > 
> > I think when I used vdelivermail, it created maildirsize when a new message
> 
> > was received in the mailbox that didn't have maildirsize in place, but with
> 
> > quota limit on it.
> > 
> > Now, as far as I recall, Bill Shupp made the maildir++ patch based on the
> code 
> > from maildrop, so I am not surprised it doesn't recreate the maildirsize 
> > file ;-)
> > 
> > Respectfully,
> > Tim Hasson
> 
> Hm.. maildrop creates maildirsize for me. Are you sure you're setting the
> MAILDIRQUOTA environment variable when you run maildrop? 
> 
> When I create a user, it creates all the maildrop recipes for that user,
> including one that sets MAILDIRQUOTA (in addition to setting the quota with
> vsetuserquota, which only seems to set it in the database). I've tested
> multiple times, and the maildirsize file behavior is what you'd expect; the
> file gets created on first delivery, and it gets recreated when it gets big.
> Naturally I don't expect maildrop to directly use vpopmail quota settings,
> which is why I set the variable.
> 
> --Doug
> 

> 
> 





Re: [vchkpw] Re: maildir++ patch doesn't solve the problem

2003-09-19 Thread Doug Clements
On Thu, Sep 18, 2003 at 05:10:29PM -0700, Tim Hasson wrote:
> BTW,
> 
> I had a problem before where if I changed a user quota using vpop's 
> vsetuserquota, the maildirsize file in the user's maildir will automagically 
> get deleted, but never recreated by maildrop (for the domain I was doing 
> filtering for) So that's why i put the check in mailfilter script to see if 
> maildirsize needs to be recreated.
> 
> Shouldn't maildrop create the maildirsize file if it doesn't exist?
> 
> I think when I used vdelivermail, it created maildirsize when a new message 
> was received in the mailbox that didn't have maildirsize in place, but with 
> quota limit on it.
> 
> Now, as far as I recall, Bill Shupp made the maildir++ patch based on the code 
> from maildrop, so I am not surprised it doesn't recreate the maildirsize 
> file ;-)
> 
> Respectfully,
> Tim Hasson

Hm.. maildrop creates maildirsize for me. Are you sure you're setting the MAILDIRQUOTA 
environment variable when you run maildrop? 

When I create a user, it creates all the maildrop recipes for that user, including one 
that sets MAILDIRQUOTA (in addition to setting the quota with vsetuserquota, which 
only seems to set it in the database). I've tested multiple times, and the maildirsize 
file behavior is what you'd expect; the file gets created on first delivery, and it 
gets recreated when it gets big. Naturally I don't expect maildrop to directly use 
vpopmail quota settings, which is why I set the variable.

--Doug



Re: [vchkpw] Re: maildir++ patch doesn't solve the problem

2003-09-18 Thread Tim Hasson
Quoting Doug Clements <[EMAIL PROTECTED]>:

> On Thu, Sep 18, 2003 at 05:13:32AM -0700, Tim Hasson wrote:
> > Try using courier maildrop for delivery instead of vdelivermail.
> > 
> > I just switched all my domains (on nfs) .qmail-default's to invoke maildrop
> 
> > instead of vdelivermail also because of problems with maildirsize not being
> 
> > rebuilt and/or getting really screwed up. The problem happened very
> randomly 
> > and cannot be duplicated easily, but happens over days to random 
> > accounts/domains that used vdelivermail.
> 
> Tim, 
>   Let us know if this actually does fix your problems. Nobody can seem to
> confirm that vdelivermail or qmail-local will rewrite the maildirsize file,
> and my initial looking through the code of vdelivermail turns up nothing of
> the sort.
> 
> --Doug
> 

> 

BTW,

I had a problem before where if I changed a user quota using vpop's 
vsetuserquota, the maildirsize file in the user's maildir will automagically 
get deleted, but never recreated by maildrop (for the domain I was doing 
filtering for) So that's why i put the check in mailfilter script to see if 
maildirsize needs to be recreated.

Shouldn't maildrop create the maildirsize file if it doesn't exist?

I think when I used vdelivermail, it created maildirsize when a new message 
was received in the mailbox that didn't have maildirsize in place, but with 
quota limit on it.

Now, as far as I recall, Bill Shupp made the maildir++ patch based on the code 
from maildrop, so I am not surprised it doesn't recreate the maildirsize 
file ;-)

Respectfully,
Tim Hasson





Re: [vchkpw] Re: maildir++ patch doesn't solve the problem

2003-09-18 Thread Tim Hasson
What pop3 are you using?

Hope you're not using qmail-pop3d. Even if you did patch it with the maildir++ 
patch, I strongly recommend you use the pop3d from the courier-imap package.

Please also make sure you compiled couirer maildrop with quota support.

Respectfully,
Tim Hasson

Quoting o k <[EMAIL PROTECTED]>:

> Dear sir,
> 
> I used your mailfilter script
> I don't know if this patch solves the problem i stated before:
> The problem is that the quota displayed after I retrieve mails through 
> pop3 is not updated.
> 
> Thanks
> 
> 
> 
> 
> >From: Tamer Hassan <[EMAIL PROTECTED]>
> >To: o k <[EMAIL PROTECTED]>
> >CC: [EMAIL PROTECTED]
> >Subject: Re: [vchkpw] Re: maildir++ patch doesn't solve the problem
> >Date: Thu, 18 Sep 2003 05:11:22 -0700
> >
> >Try using courier maildrop for delivery instead of vdelivermail.
> >
> >I just switched all my domains (on nfs) .qmail-default's to invoke maildrop
> >instead of vdelivermail also because of problems with maildirsize not being
> >rebuilt and/or getting really screwed up. The problem happened very 
> >randomly
> >and cannot be duplicated easily, but happens over days to random
> >accounts/domains that used vdelivermail.
> >
> >I am doing this using two files in each domain directory, .qmail-default 
> >and
> >mailfilter (basic version no filtering), both have to be owned by vpopmail 
> >and
> >vchkpw, and chmod 700 or it will not work
> >
> >Please let me know if there is a better way..
> >
> ># cat .qmail-default
> >| /usr/local/bin/maildrop mailfilter
> >
> ># cat mailfilter
> >SHELL="/bin/sh"
> >import EXT
> >import HOST
> >VHOME=`/home/vpopmail/bin/vuserinfo -d [EMAIL PROTECTED]
> >
> >`test -d $VHOME/Maildir`
> >if ( $RETURNCODE == 1 )
> >{
> >echo "Sorry, no mailbox here by that name. (#5.1.1)"
> >EXITCODE=100
> >exit
> >}
> >
> ># Make sure the quota file is in place.
> ># Vpopmail does not create it by default.
> ># Vpopmail also removes it when you change the quota.
> >`test -s "$VHOME/Maildir/maildirsize"`
> >if ( $RETURNCODE == 1 )
> >{
> >`/home/vpopmail/bin/vuserinfo -Q [EMAIL PROTECTED]
> >
> >`test -s "$VHOME/Maildir/maildirsize"`
> >if ( $RETURNCODE == 0 )
> >{
> >   `/usr/sbin/chown vpopmail:vchkpw $VHOME/Maildir/maildirsize`
> >   `/bin/chmod 640 $VHOME/Maildir/maildirsize`
> >}
> >}
> >
> ># Default delivery
> >exception {
> > to "$VHOME/Maildir/"
> >}
> >
> >
> >I have another mailfilter template which does spam filtering with 
> >spamassassin
> >2.55 (w/ mysql prefs per user), which I enable only for a specific domain, 
> >or
> >can be modified to do per-user when invoked from user's .qmail file.
> >
> >Quoting o k <[EMAIL PROTECTED]>:
> >
> > >
> > > Thanks for your reply.
> > > But what can solve the quota update problem?
> > >
> > > >From: Charles Cazabon <[EMAIL PROTECTED]>
> > > >To: [EMAIL PROTECTED]
> > > >Subject: Re: maildir++ patch doesn't solve the problem
> > > >Date: Sun, 14 Sep 2003 09:14:01 -0600
> > > >
> > > >o k <[EMAIL PROTECTED]> wrote:
> > > > > Then I patched it:
> > > > >   cd qmail-1.03
> > > > >   patch < qmail-maildir++.patch
> > > >
> > > >Don't.  "maildir++" is broken by design and violates the letter and 
> >spirit
> > > >of
> > > >the maildir specification; it also makes the maildir unsafe for use 
> >over
> > > >NFS
> > > >without locking, which is one of the basic reasons for the existence of
> > > >maildir.
> > > >
> > > >Charles
> > > >--
> > > 
> >
> >---
> > > >Charles Cazabon
> ><[EMAIL PROTECTED]>
> > > >GPL'ed software available at: 
> >http://www.qcc.ca/~charlesc/software/
> > > >Read 
> >http://www.qcc.ca/~charlesc/writings/12-steps-to-qmail-list-bliss.html
> > > 
> >
> >---
> > >
> > > _
> > > MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
> > > http://join.msn.com/?page=features/virus
> > >
> > >
> >
> > >
> >
> >
> >Respectfully,
> >Tamer Hassan
> 
> _
> The new MSN 8: advanced junk mail protection and 2 months FREE* 
> http://join.msn.com/?page=features/junkmail
> 
> 

> 





Re: [vchkpw] Re: maildir++ patch doesn't solve the problem

2003-09-18 Thread Doug Clements
On Thu, Sep 18, 2003 at 05:13:32AM -0700, Tim Hasson wrote:
> Try using courier maildrop for delivery instead of vdelivermail.
> 
> I just switched all my domains (on nfs) .qmail-default's to invoke maildrop 
> instead of vdelivermail also because of problems with maildirsize not being 
> rebuilt and/or getting really screwed up. The problem happened very randomly 
> and cannot be duplicated easily, but happens over days to random 
> accounts/domains that used vdelivermail.

Tim, 
  Let us know if this actually does fix your problems. Nobody can seem to confirm that 
vdelivermail or qmail-local will rewrite the maildirsize file, and my initial looking 
through the code of vdelivermail turns up nothing of the sort.

--Doug



Fwd: Re: [vchkpw] Re: maildir++ patch doesn't solve the problem

2003-09-18 Thread o k
Dear sir,

   I used your mailfilter script
   I don't know if this patch solves the problem i stated before:
   The problem is that the quota displayed after I retrieve mails through 
pop3 is not updated.

Thanks




From: Tamer Hassan <[EMAIL PROTECTED]>
To: o k <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
Subject: Re: [vchkpw] Re: maildir++ patch doesn't solve the problem
Date: Thu, 18 Sep 2003 05:11:22 -0700
Try using courier maildrop for delivery instead of vdelivermail.

I just switched all my domains (on nfs) .qmail-default's to invoke maildrop
instead of vdelivermail also because of problems with maildirsize not being
rebuilt and/or getting really screwed up. The problem happened very 
randomly
and cannot be duplicated easily, but happens over days to random
accounts/domains that used vdelivermail.

I am doing this using two files in each domain directory, .qmail-default 
and
mailfilter (basic version no filtering), both have to be owned by vpopmail 
and
vchkpw, and chmod 700 or it will not work

Please let me know if there is a better way..

# cat .qmail-default
| /usr/local/bin/maildrop mailfilter
# cat mailfilter
SHELL="/bin/sh"
import EXT
import HOST
VHOME=`/home/vpopmail/bin/vuserinfo -d [EMAIL PROTECTED]
`test -d $VHOME/Maildir`
if ( $RETURNCODE == 1 )
{
   echo "Sorry, no mailbox here by that name. (#5.1.1)"
   EXITCODE=100
   exit
}
# Make sure the quota file is in place.
# Vpopmail does not create it by default.
# Vpopmail also removes it when you change the quota.
`test -s "$VHOME/Maildir/maildirsize"`
if ( $RETURNCODE == 1 )
{
   `/home/vpopmail/bin/vuserinfo -Q [EMAIL PROTECTED]
   `test -s "$VHOME/Maildir/maildirsize"`
   if ( $RETURNCODE == 0 )
   {
  `/usr/sbin/chown vpopmail:vchkpw $VHOME/Maildir/maildirsize`
  `/bin/chmod 640 $VHOME/Maildir/maildirsize`
   }
}
# Default delivery
exception {
to "$VHOME/Maildir/"
}
I have another mailfilter template which does spam filtering with 
spamassassin
2.55 (w/ mysql prefs per user), which I enable only for a specific domain, 
or
can be modified to do per-user when invoked from user's .qmail file.

Quoting o k <[EMAIL PROTECTED]>:

>
> Thanks for your reply.
> But what can solve the quota update problem?
>
> >From: Charles Cazabon <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: Re: maildir++ patch doesn't solve the problem
> >Date: Sun, 14 Sep 2003 09:14:01 -0600
> >
> >o k <[EMAIL PROTECTED]> wrote:
> > > Then I patched it:
> > >   cd qmail-1.03
> > >   patch < qmail-maildir++.patch
> >
> >Don't.  "maildir++" is broken by design and violates the letter and 
spirit
> >of
> >the maildir specification; it also makes the maildir unsafe for use 
over
> >NFS
> >without locking, which is one of the basic reasons for the existence of
> >maildir.
> >
> >Charles
> >--
> 
>---
> >Charles Cazabon
<[EMAIL PROTECTED]>
> >GPL'ed software available at: 
http://www.qcc.ca/~charlesc/software/
> >Read 
http://www.qcc.ca/~charlesc/writings/12-steps-to-qmail-list-bliss.html
> 
>---
>
> _
> MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
> http://join.msn.com/?page=features/virus
>
>

>

Respectfully,
Tamer Hassan
_
The new MSN 8: advanced junk mail protection and 2 months FREE* 
http://join.msn.com/?page=features/junkmail




Re: [vchkpw] Re: maildir++ patch doesn't solve the problem

2003-09-18 Thread Tim Hasson
Try using courier maildrop for delivery instead of vdelivermail.

I just switched all my domains (on nfs) .qmail-default's to invoke maildrop 
instead of vdelivermail also because of problems with maildirsize not being 
rebuilt and/or getting really screwed up. The problem happened very randomly 
and cannot be duplicated easily, but happens over days to random 
accounts/domains that used vdelivermail.

I am doing this using two files in each domain directory, .qmail-default and 
mailfilter (basic version no filtering), both have to be owned by vpopmail and 
vchkpw, and chmod 700 or it will not work

Please let me know if there is a better way..

# cat .qmail-default
| /usr/local/bin/maildrop mailfilter

# cat mailfilter
SHELL="/bin/sh"
import EXT
import HOST
VHOME=`/home/vpopmail/bin/vuserinfo -d [EMAIL PROTECTED]

`test -d $VHOME/Maildir`
if ( $RETURNCODE == 1 )
{
   echo "Sorry, no mailbox here by that name. (#5.1.1)"
   EXITCODE=100
   exit
}

# Make sure the quota file is in place.
# Vpopmail does not create it by default.
# Vpopmail also removes it when you change the quota.
`test -s "$VHOME/Maildir/maildirsize"`
if ( $RETURNCODE == 1 )
{
   `/home/vpopmail/bin/vuserinfo -Q [EMAIL PROTECTED]

   `test -s "$VHOME/Maildir/maildirsize"`
   if ( $RETURNCODE == 0 )
   {
  `/usr/sbin/chown vpopmail:vchkpw $VHOME/Maildir/maildirsize`
  `/bin/chmod 640 $VHOME/Maildir/maildirsize`
   }
}

# Default delivery
exception {
to "$VHOME/Maildir/"
}


I have another mailfilter template which does spam filtering with spamassassin 
2.55 (w/ mysql prefs per user), which I enable only for a specific domain, or 
can be modified to do per-user when invoked from user's .qmail file.

Quoting o k <[EMAIL PROTECTED]>:

> 
> Thanks for your reply.
> But what can solve the quota update problem?
> 
> >From: Charles Cazabon <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: Re: maildir++ patch doesn't solve the problem
> >Date: Sun, 14 Sep 2003 09:14:01 -0600
> >
> >o k <[EMAIL PROTECTED]> wrote:
> > > Then I patched it:
> > >   cd qmail-1.03
> > >   patch < qmail-maildir++.patch
> >
> >Don't.  "maildir++" is broken by design and violates the letter and spirit 
> >of
> >the maildir specification; it also makes the maildir unsafe for use over 
> >NFS
> >without locking, which is one of the basic reasons for the existence of
> >maildir.
> >
> >Charles
> >--
> >---
> >Charles Cazabon<[EMAIL PROTECTED]>
> >GPL'ed software available at: http://www.qcc.ca/~charlesc/software/
> >Read http://www.qcc.ca/~charlesc/writings/12-steps-to-qmail-list-bliss.html
> >---
> 
> _
> MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. 
> http://join.msn.com/?page=features/virus
> 
> 

> 

Respectfully,
Tim Hasson