Re: deliver -q won't ignore quotas

2004-06-16 Thread Ken Murchison
Robert Covell wrote:
So the "IGNOREQUOTA" does not pertain to my situation?
No is doesn't.  IGNOREQUOTA is an LMTP keyword and you don't look like 
you're sending LMTP commands to deliver.

 I am seeing the same
that Jamie was, in that our system messages for over quota are getting
bounced because they are over quota.  For example when our quota checker ran
this morning we got:
The original message was received at Tue, 15 Jun 2004 23:00:05 -0500 (CDT)
from localhost.rolet.com [127.0.0.1]
   - The following addresses had permanent fatal errors -
<[EMAIL PROTECTED]>
(reason: 552 5.2.2 Over quota)
How would we address this situation using the "-q"?
deliver -q  works for me.


-Original Message-
From: Ken Murchison [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 15, 2004 8:55 PM
To: Robert Covell
Cc: Jamie Davey; [EMAIL PROTECTED]
Subject: Re: deliver -q won't ignore quotas
Robert Covell wrote:

We are doing something similar but opening deliver a bit
different (with the
user name and -q).  Before we put this in production would the
following be
correct (the previous open of deliver is commented out):
No, the commented out version is correct.  The difference being that
Jamie is using the '-l' option which means that the client is speaking
LMTP directly (with deliver being a middle-man).  In your case, you're
just telling deliver what to do and it creates the LMTP session with the
appropriate commands/arguments.

//$MP = "/usr/local/cyrus/bin/deliver -q $user";
$MP = "/usr/local/cyrus/bin/deliver $user IGNOREQUOTA";
$fp = popen($MP,"w");
fputs($fp, $toheader);
fputs($fp, $fromheader);
fputs($fp, $replytoheader);
fputs($fp, $dateheader);
fputs($fp, $subjectheader);
fputs($fp, "$message");
pclose($fp);
Thanks,
Bob

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Ken Murchison
Sent: Wednesday, June 09, 2004 3:17 PM
To: Jamie Davey
Cc: [EMAIL PROTECTED]
Subject: Re: deliver -q won't ignore quotas
Jamie Davey wrote:

Hi all
I am trying to get a script (derived from the archives of this list)
running that will deliver a warning mail to users who are in danger of
breaching / have breached their mailbox quota. The script
determines the

users affected by running the quota command and then tries to send them
a mail using deliver with the -q directive to deliver regardless of
their quota usage. It works fine for users who are approaching their
full quota but not for those currently over it.
I have run the script without the deliver portion and manually sent the
mails, again using "deliver -q -l"  and get a "452 4.2.2 Over quota"
error which disregards the recipient. Is this a bug with
deliver or am I

doing something wrong
If you're going to speak LMTP directly (-l option), then no other
options apply and you need to add the IGNOREQUOTA protocol element
yourself (see below).  Actually, if you're writing your own LMTP client,
then talk to lmtpd directly instead of using deliver as a pass-through
proxy.

# Warning messages
if (@warn) {
 open(DELIVER, "| $deliverprog -q -l");
 print DELIVER "MAIL FROM:<[EMAIL PROTECTED]>\n";
 foreach $warnuser (@warn) {
 print DELIVER "RCPT TO:<$warnuser>\n";
This should be "RCPT TO:<$warnuser> IGNOREQUOTA\n"


 };
 print DELIVER "DATA\n";
 print DELIVER <--
Kenneth Murchison Oceana Matrix Ltd.
Software Engineer 21 Princeton Place
716-662-8973 x26  Orchard Park, NY 14127
--PGP Public Key--http://www.oceana.com/~ken/ksm.pgp
---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

--
Kenneth Murchison Oceana Matrix Ltd.
Software Engineer 21 Princeton Place
716-662-8973 x26  Orchard Park, NY 14127
--PGP Public Key--http://www.oceana.com/~ken/ksm.pgp

---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

--
Kenneth Murchison Oceana Matrix Ltd.
Software Engineer 21 Princeton Place
716-662-8973 x26  Orchard Park, NY 14127
--PGP Public Key--http://www.oceana.com/~ken/ksm.pgp
---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


RE: deliver -q won't ignore quotas

2004-06-16 Thread Robert Covell
So the "IGNOREQUOTA" does not pertain to my situation?  I am seeing the same
that Jamie was, in that our system messages for over quota are getting
bounced because they are over quota.  For example when our quota checker ran
this morning we got:


The original message was received at Tue, 15 Jun 2004 23:00:05 -0500 (CDT)
from localhost.rolet.com [127.0.0.1]

   - The following addresses had permanent fatal errors -
<[EMAIL PROTECTED]>
(reason: 552 5.2.2 Over quota)

How would we address this situation using the "-q"?

Thanks,
-Bob


> -Original Message-
> From: Ken Murchison [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 15, 2004 8:55 PM
> To: Robert Covell
> Cc: Jamie Davey; [EMAIL PROTECTED]
> Subject: Re: deliver -q won't ignore quotas
>
>
> Robert Covell wrote:
>
> > We are doing something similar but opening deliver a bit
> different (with the
> > user name and -q).  Before we put this in production would the
> following be
> > correct (the previous open of deliver is commented out):
>
> No, the commented out version is correct.  The difference being that
> Jamie is using the '-l' option which means that the client is speaking
> LMTP directly (with deliver being a middle-man).  In your case, you're
> just telling deliver what to do and it creates the LMTP session with the
> appropriate commands/arguments.
>
>
> >
> > //$MP = "/usr/local/cyrus/bin/deliver -q $user";
> > $MP = "/usr/local/cyrus/bin/deliver $user IGNOREQUOTA";
> >
> > $fp = popen($MP,"w");
> > fputs($fp, $toheader);
> > fputs($fp, $fromheader);
> > fputs($fp, $replytoheader);
> > fputs($fp, $dateheader);
> > fputs($fp, $subjectheader);
> > fputs($fp, "$message");
> > pclose($fp);
> >
> > Thanks,
> > Bob
> >
> >
> >>-Original Message-
> >>From: [EMAIL PROTECTED]
> >>[mailto:[EMAIL PROTECTED] Behalf Of Ken Murchison
> >>Sent: Wednesday, June 09, 2004 3:17 PM
> >>To: Jamie Davey
> >>Cc: [EMAIL PROTECTED]
> >>Subject: Re: deliver -q won't ignore quotas
> >>
> >>
> >>Jamie Davey wrote:
> >>
> >>
> >>>Hi all
> >>>
> >>>I am trying to get a script (derived from the archives of this list)
> >>>running that will deliver a warning mail to users who are in danger of
> >>>breaching / have breached their mailbox quota. The script
> >>
> >>determines the
> >>
> >>>users affected by running the quota command and then tries to send them
> >>>a mail using deliver with the -q directive to deliver regardless of
> >>>their quota usage. It works fine for users who are approaching their
> >>>full quota but not for those currently over it.
> >>>
> >>>I have run the script without the deliver portion and manually sent the
> >>>mails, again using "deliver -q -l"  and get a "452 4.2.2 Over quota"
> >>>error which disregards the recipient. Is this a bug with
> >>
> >>deliver or am I
> >>
> >>>doing something wrong
> >>
> >>If you're going to speak LMTP directly (-l option), then no other
> >>options apply and you need to add the IGNOREQUOTA protocol element
> >>yourself (see below).  Actually, if you're writing your own LMTP client,
> >>then talk to lmtpd directly instead of using deliver as a pass-through
> >>proxy.
> >>
> >>
> >>># Warning messages
> >>>if (@warn) {
> >>>   open(DELIVER, "| $deliverprog -q -l");
> >>>   print DELIVER "MAIL FROM:<[EMAIL PROTECTED]>\n";
> >>>   foreach $warnuser (@warn) {
> >>>   print DELIVER "RCPT TO:<$warnuser>\n";
> >>
> >>This should be "RCPT TO:<$warnuser> IGNOREQUOTA\n"
> >>
> >>
> >>
> >>>   };
> >>>   print DELIVER "DATA\n";
> >>>   print DELIVER < >>
> >>--
> >>Kenneth Murchison Oceana Matrix Ltd.
> >>Software Engineer 21 Princeton Place
> >>716-662-8973 x26  Orchard Park, NY 14127
> >>--PGP Public Key--http://www.oceana.com/~ken/ksm.pgp
> >>---
> >>Cyrus Home Page: http://asg.web.cmu.edu/cyrus
> >>Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
> >>List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
> >>
> >
> >
> > ---
> > Cyrus Home Page: http://asg.web.cmu.edu/cyrus
> > Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
> > List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
> >
>
>
> --
> Kenneth Murchison Oceana Matrix Ltd.
> Software Engineer 21 Princeton Place
> 716-662-8973 x26  Orchard Park, NY 14127
> --PGP Public Key--http://www.oceana.com/~ken/ksm.pgp
>

---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: deliver -q won't ignore quotas

2004-06-15 Thread Ken Murchison
Robert Covell wrote:
We are doing something similar but opening deliver a bit different (with the
user name and -q).  Before we put this in production would the following be
correct (the previous open of deliver is commented out):
No, the commented out version is correct.  The difference being that 
Jamie is using the '-l' option which means that the client is speaking 
LMTP directly (with deliver being a middle-man).  In your case, you're 
just telling deliver what to do and it creates the LMTP session with the 
appropriate commands/arguments.


//$MP = "/usr/local/cyrus/bin/deliver -q $user";
$MP = "/usr/local/cyrus/bin/deliver $user IGNOREQUOTA";
$fp = popen($MP,"w");
fputs($fp, $toheader);
fputs($fp, $fromheader);
fputs($fp, $replytoheader);
fputs($fp, $dateheader);
fputs($fp, $subjectheader);
fputs($fp, "$message");
pclose($fp);
Thanks,
Bob

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Ken Murchison
Sent: Wednesday, June 09, 2004 3:17 PM
To: Jamie Davey
Cc: [EMAIL PROTECTED]
Subject: Re: deliver -q won't ignore quotas
Jamie Davey wrote:

Hi all
I am trying to get a script (derived from the archives of this list)
running that will deliver a warning mail to users who are in danger of
breaching / have breached their mailbox quota. The script
determines the
users affected by running the quota command and then tries to send them
a mail using deliver with the -q directive to deliver regardless of
their quota usage. It works fine for users who are approaching their
full quota but not for those currently over it.
I have run the script without the deliver portion and manually sent the
mails, again using "deliver -q -l"  and get a "452 4.2.2 Over quota"
error which disregards the recipient. Is this a bug with
deliver or am I
doing something wrong
If you're going to speak LMTP directly (-l option), then no other
options apply and you need to add the IGNOREQUOTA protocol element
yourself (see below).  Actually, if you're writing your own LMTP client,
then talk to lmtpd directly instead of using deliver as a pass-through
proxy.

# Warning messages
if (@warn) {
  open(DELIVER, "| $deliverprog -q -l");
  print DELIVER "MAIL FROM:<[EMAIL PROTECTED]>\n";
  foreach $warnuser (@warn) {
  print DELIVER "RCPT TO:<$warnuser>\n";
This should be "RCPT TO:<$warnuser> IGNOREQUOTA\n"

  };
  print DELIVER "DATA\n";
  print DELIVER <--
Kenneth Murchison Oceana Matrix Ltd.
Software Engineer 21 Princeton Place
716-662-8973 x26  Orchard Park, NY 14127
--PGP Public Key--http://www.oceana.com/~ken/ksm.pgp
---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

--
Kenneth Murchison Oceana Matrix Ltd.
Software Engineer 21 Princeton Place
716-662-8973 x26  Orchard Park, NY 14127
--PGP Public Key--http://www.oceana.com/~ken/ksm.pgp
---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


RE: deliver -q won't ignore quotas

2004-06-15 Thread Robert Covell
We are doing something similar but opening deliver a bit different (with the
user name and -q).  Before we put this in production would the following be
correct (the previous open of deliver is commented out):

//$MP = "/usr/local/cyrus/bin/deliver -q $user";
$MP = "/usr/local/cyrus/bin/deliver $user IGNOREQUOTA";

$fp = popen($MP,"w");
fputs($fp, $toheader);
fputs($fp, $fromheader);
fputs($fp, $replytoheader);
fputs($fp, $dateheader);
fputs($fp, $subjectheader);
fputs($fp, "$message");
pclose($fp);

Thanks,
Bob

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Ken Murchison
> Sent: Wednesday, June 09, 2004 3:17 PM
> To: Jamie Davey
> Cc: [EMAIL PROTECTED]
> Subject: Re: deliver -q won't ignore quotas
>
>
> Jamie Davey wrote:
>
> > Hi all
> >
> > I am trying to get a script (derived from the archives of this list)
> > running that will deliver a warning mail to users who are in danger of
> > breaching / have breached their mailbox quota. The script
> determines the
> > users affected by running the quota command and then tries to send them
> > a mail using deliver with the -q directive to deliver regardless of
> > their quota usage. It works fine for users who are approaching their
> > full quota but not for those currently over it.
> >
> > I have run the script without the deliver portion and manually sent the
> > mails, again using "deliver -q -l"  and get a "452 4.2.2 Over quota"
> > error which disregards the recipient. Is this a bug with
> deliver or am I
> > doing something wrong
>
> If you're going to speak LMTP directly (-l option), then no other
> options apply and you need to add the IGNOREQUOTA protocol element
> yourself (see below).  Actually, if you're writing your own LMTP client,
> then talk to lmtpd directly instead of using deliver as a pass-through
> proxy.
>
> >
> > # Warning messages
> > if (@warn) {
> >open(DELIVER, "| $deliverprog -q -l");
> >print DELIVER "MAIL FROM:<[EMAIL PROTECTED]>\n";
> >foreach $warnuser (@warn) {
> >print DELIVER "RCPT TO:<$warnuser>\n";
>
> This should be "RCPT TO:<$warnuser> IGNOREQUOTA\n"
>
>
> >};
> >print DELIVER "DATA\n";
> >print DELIVER <
> --
> Kenneth Murchison Oceana Matrix Ltd.
> Software Engineer 21 Princeton Place
> 716-662-8973 x26  Orchard Park, NY 14127
> --PGP Public Key--http://www.oceana.com/~ken/ksm.pgp
> ---
> Cyrus Home Page: http://asg.web.cmu.edu/cyrus
> Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
> List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
>

---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: deliver -q won't ignore quotas

2004-06-09 Thread Ken Murchison
Jamie Davey wrote:
Hi all
I am trying to get a script (derived from the archives of this list) 
running that will deliver a warning mail to users who are in danger of 
breaching / have breached their mailbox quota. The script determines the 
users affected by running the quota command and then tries to send them 
a mail using deliver with the -q directive to deliver regardless of 
their quota usage. It works fine for users who are approaching their 
full quota but not for those currently over it.

I have run the script without the deliver portion and manually sent the 
mails, again using "deliver -q -l"  and get a "452 4.2.2 Over quota" 
error which disregards the recipient. Is this a bug with deliver or am I 
doing something wrong
If you're going to speak LMTP directly (-l option), then no other 
options apply and you need to add the IGNOREQUOTA protocol element 
yourself (see below).  Actually, if you're writing your own LMTP client, 
then talk to lmtpd directly instead of using deliver as a pass-through 
proxy.

# Warning messages
if (@warn) {
   open(DELIVER, "| $deliverprog -q -l");
   print DELIVER "MAIL FROM:<[EMAIL PROTECTED]>\n";
   foreach $warnuser (@warn) {
   print DELIVER "RCPT TO:<$warnuser>\n";
This should be "RCPT TO:<$warnuser> IGNOREQUOTA\n"

   };
   print DELIVER "DATA\n";
   print DELIVER <--
Kenneth Murchison Oceana Matrix Ltd.
Software Engineer 21 Princeton Place
716-662-8973 x26  Orchard Park, NY 14127
--PGP Public Key--http://www.oceana.com/~ken/ksm.pgp
---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: deliver -q won't ignore quotas

2004-06-09 Thread Andrew Morgan


On Wed, 9 Jun 2004, Jamie Davey wrote:

> Hi all
>
> I am trying to get a script (derived from the archives of this list)
> running that will deliver a warning mail to users who are in danger of
> breaching / have breached their mailbox quota. The script determines the
> users affected by running the quota command and then tries to send them
> a mail using deliver with the -q directive to deliver regardless of
> their quota usage. It works fine for users who are approaching their
> full quota but not for those currently over it.
>
> I have run the script without the deliver portion and manually sent the
> mails, again using "deliver -q -l"  and get a "452 4.2.2 Over quota"
> error which disregards the recipient. Is this a bug with deliver or am I
> doing something wrong

The man page for deliver shows:

SYNOPSIS
   deliver [ -C config-file ] [ -d ] [ -r address ]
   [ -f address ] [ -m mailbox ] [ -a auth-id ]
   [ -q ] [ userid ]...
   deliver [ -C config-file ] -l


This indicates to me that -l and -q are mutually exclusive.


I wrote an overquota script.  Here is a snippet concerning sending email
to an overquota mailbox:

# And build a message to send
$tmpmsg = $msg_over;
$to = "[EMAIL PROTECTED]";

# Substitute values into message
$tmpmsg =~ s/%to%/$to/g;
$tmpmsg =~ s/%quota%/$quota/g;
$tmpmsg =~ s/%percent%/$percent/g;
$tmpmsg =~ s/%usage%/$usage/g;
$tmpmsg =~ s/%from%/$from/g;
$tmpmsg =~ s/%date%/$date/g;

open(OUT, "| /usr/local/cyrus/bin/deliver -q -r [EMAIL PROTECTED] $username");
print OUT $tmpmsg;
close(OUT);


Where $msg_over contains the template of an overquota message that I do
some substitutions into before sending.

Andy

---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


deliver -q won't ignore quotas

2004-06-09 Thread Jamie Davey
Hi all
I am trying to get a script (derived from the archives of this list) 
running that will deliver a warning mail to users who are in danger of 
breaching / have breached their mailbox quota. The script determines the 
users affected by running the quota command and then tries to send them 
a mail using deliver with the -q directive to deliver regardless of 
their quota usage. It works fine for users who are approaching their 
full quota but not for those currently over it.

I have run the script without the deliver portion and manually sent the 
mails, again using "deliver -q -l"  and get a "452 4.2.2 Over quota" 
error which disregards the recipient. Is this a bug with deliver or am I 
doing something wrong

I'm using Cyrus 2.1.16 and the script is as follows:
#!/usr/bin/perl -w
# Settings
$quotaprog = "/usr/cyrus/bin/quota";
$deliverprog = "/usr/cyrus/bin/deliver";
$warnpct = 90;
# Lists
@warn = ();
@over = ();
# Process quota output
open(QUOTA, "$quotaprog |");
while () {
   next if /^   Quota/;
   ($junk, $pctused, $junk, $qroot) = split;
   ($junk, $user) = split /\./, $qroot;
   if ($pctused >= 100) {
   push @over, $user;
   }
   elsif ($pctused >= $warnpct) {
   push @warn, $user;
   }
}
close(QUOTA);
# Construct a date string
# Warning messages
if (@warn) {
   open(DELIVER, "| $deliverprog -q -l");
   print DELIVER "MAIL FROM:<[EMAIL PROTECTED]>\n";
   foreach $warnuser (@warn) {
   print DELIVER "RCPT TO:<$warnuser>\n";
   };
   print DELIVER "DATA\n";
   print DELIVER <
Your server mailbox has reached or exceeded $warnpct% of your available 
quota
for storing messages.  This will not cause any immediate problem, but if the
size of your inbox exceeds your quota, you will not be able to receive any
new email until some messages are removed from your server mailbox, 
either by
deleting them or saving them to a local folder.

If you need assistance cleaning up your inbox, please contact the Help 
Desk on 8
225 or by email at [EMAIL PROTECTED]

Thank you.
.
EOF
   close(DELIVER);
}
# Over quota messages
if (@over) {
   open(DELIVER, "| $deliverprog -q -l");
   print DELIVER "MAIL FROM:<[EMAIL PROTECTED]>\n";
   foreach $warnuser (@over) {
   print DELIVER "RCPT TO:<$warnuser>\n";
   };
   print DELIVER "DATA\n";
   print DELIVER <
Your server mailbox has exceeded your available quota for storing messages!
You will not be able to receive any new email until some messages are 
removed
from your server mailbox, either by deleting them or saving them to a local
folder.  If this condition persists for 5 days or more, messages to you will
begin to bounce back to the sender.  Please correct this problem as soon as
possible.

If you need assistance cleaning up your inbox, please contact the Help 
Desk on 8
225.

Thank you.
.
EOF
   close(DELIVER);
}

--
   Jamie Davey
 Systems Engineer
 01206 508227
---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html