Re: Weekly/Monthly record-keeping / maintenance?

2009-04-06 Thread Jeff Blaine
I lied, quoting works when you use the right quotes.

Double quotes, not single.

my ($rc, $msg) = $cyrus->send('', '', "EXAMINE $mb");

should become

my ($rc, $msg) = $cyrus->send('', '', "EXAMINE \"$mb\"");

... for a better imapdu.pl

Jeff Blaine wrote:
> I tried both
> 
> a) escaping spaces in $mb
> b) quoting $mb
> 
> Neither worked.
> 
> That's about as far as I delve into Perl anymore, so
> I'm happy to just retract my note to our users about
> this tool.
> 
> Bron Gondwana wrote:
>> On Thu, Apr 02, 2009 at 10:42:23AM -0400, Jeff Blaine wrote:
>>> Okay, well, for what it's worth, I fixed all of the
>>> problems prohibiting me from running a quota -f
>>> to completion.
>>>
>>> The problem: imapdu.pl is buggy
>>
>> Doh.
>>
>>> It fails to do the right thing with mailboxes containing
>>> a space in the name.
>>
>> Yeah, that's not entirely a surprise.  Spaces in names
>> confuse lots of stuff.
>>
>>> ...
>>> 1.46 MB 114 msgs INBOX.BMP
>>> 1.46 MB 114 msgs INBOX.Bio Stuff
>>> 0.00 bytes 0 msgs INBOX.Drafts
>>> 1.25 MB 36 msgs INBOX.HLT
>>> 1.25 MB 36 msgs INBOX.Information Retrieval
>>> ...
>>>
>>> # $Id: imapdu.pl,v 1.9 2008/04/04 12:47:14 murch Exp $
>>>
>>> I don't suppose 'murch', the author of the code reads
>>> this list?
>>
>> Yeah, he's around, though he doesn't always see stuff as quickly
>> if it's only sent to the list.  I've CC'd him.
>>
>> That said, he's likely not the author - just the last person that
>> changed things.  Given that he did a giant sweeping copyright
>> update of nearly every file in the tree a couple of months ago...
>>
>>   my ($rc, $msg) = $cyrus->send('', '', "EXAMINE $mb");
>>   if ($rc eq 'OK') {
>>   } else {
>>   print "failed: $mb: $msg\n";
>>   }
>>
>> Apart from being icky perl, that will fail to change mailboxes
>> because the EXAMINE command will have dodgy syntax.  I'm not
>> entirely sure why you're not seeing the 'failed' messages
>> though...  The "$mb" needs to be at least quoted - which is
>> why I generally use something like Mail::IMAPTalk that can
>> do correct protocol quoting.
>>
>> Ahh - it probably does output the "failed" stuff further up.
>>  
>> Bron.
>>
> 

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


Re: Weekly/Monthly record-keeping / maintenance?

2009-04-02 Thread Jeff Blaine
I tried both

a) escaping spaces in $mb
b) quoting $mb

Neither worked.

That's about as far as I delve into Perl anymore, so
I'm happy to just retract my note to our users about
this tool.

Bron Gondwana wrote:
> On Thu, Apr 02, 2009 at 10:42:23AM -0400, Jeff Blaine wrote:
>> Okay, well, for what it's worth, I fixed all of the
>> problems prohibiting me from running a quota -f
>> to completion.
>>
>> The problem: imapdu.pl is buggy
> 
> Doh.
> 
>> It fails to do the right thing with mailboxes containing
>> a space in the name.
> 
> Yeah, that's not entirely a surprise.  Spaces in names
> confuse lots of stuff.
> 
>> ...
>> 1.46 MB 114 msgs INBOX.BMP
>> 1.46 MB 114 msgs INBOX.Bio Stuff
>> 0.00 bytes 0 msgs INBOX.Drafts
>> 1.25 MB 36 msgs INBOX.HLT
>> 1.25 MB 36 msgs INBOX.Information Retrieval
>> ...
>>
>> # $Id: imapdu.pl,v 1.9 2008/04/04 12:47:14 murch Exp $
>>
>> I don't suppose 'murch', the author of the code reads
>> this list?
> 
> Yeah, he's around, though he doesn't always see stuff as quickly
> if it's only sent to the list.  I've CC'd him.
> 
> That said, he's likely not the author - just the last person that
> changed things.  Given that he did a giant sweeping copyright
> update of nearly every file in the tree a couple of months ago...
> 
>   my ($rc, $msg) = $cyrus->send('', '', "EXAMINE $mb");
>   if ($rc eq 'OK') {
>   } else {
>   print "failed: $mb: $msg\n";
>   }
> 
> Apart from being icky perl, that will fail to change mailboxes
> because the EXAMINE command will have dodgy syntax.  I'm not
> entirely sure why you're not seeing the 'failed' messages
> though...  The "$mb" needs to be at least quoted - which is
> why I generally use something like Mail::IMAPTalk that can
> do correct protocol quoting.
> 
> Ahh - it probably does output the "failed" stuff further up.
>  
> Bron.
> 

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


Re: Weekly/Monthly record-keeping / maintenance?

2009-04-02 Thread Ken Murchison
I can guarantee that I had nothing to do with writing this code.  Other 
than updating the copyright blurb as Bron noted, I'm fairly certain I've 
never even looked at it.  Since its only example code, use it at your 
own risk.  If you fix it or improve it, feel free to pass us the changes.


Bron Gondwana wrote:
> On Thu, Apr 02, 2009 at 10:42:23AM -0400, Jeff Blaine wrote:
>> Okay, well, for what it's worth, I fixed all of the
>> problems prohibiting me from running a quota -f
>> to completion.
>>
>> The problem: imapdu.pl is buggy
> 
> Doh.
> 
>> It fails to do the right thing with mailboxes containing
>> a space in the name.
> 
> Yeah, that's not entirely a surprise.  Spaces in names
> confuse lots of stuff.
> 
>> ...
>> 1.46 MB 114 msgs INBOX.BMP
>> 1.46 MB 114 msgs INBOX.Bio Stuff
>> 0.00 bytes 0 msgs INBOX.Drafts
>> 1.25 MB 36 msgs INBOX.HLT
>> 1.25 MB 36 msgs INBOX.Information Retrieval
>> ...
>>
>> # $Id: imapdu.pl,v 1.9 2008/04/04 12:47:14 murch Exp $
>>
>> I don't suppose 'murch', the author of the code reads
>> this list?
> 
> Yeah, he's around, though he doesn't always see stuff as quickly
> if it's only sent to the list.  I've CC'd him.
> 
> That said, he's likely not the author - just the last person that
> changed things.  Given that he did a giant sweeping copyright
> update of nearly every file in the tree a couple of months ago...
> 
>   my ($rc, $msg) = $cyrus->send('', '', "EXAMINE $mb");
>   if ($rc eq 'OK') {
>   } else {
>   print "failed: $mb: $msg\n";
>   }
> 
> Apart from being icky perl, that will fail to change mailboxes
> because the EXAMINE command will have dodgy syntax.  I'm not
> entirely sure why you're not seeing the 'failed' messages
> though...  The "$mb" needs to be at least quoted - which is
> why I generally use something like Mail::IMAPTalk that can
> do correct protocol quoting.
> 
> Ahh - it probably does output the "failed" stuff further up.
>  
> Bron.
> 

-- 
Kenneth Murchison
Systems Programmer
Carnegie Mellon University

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


Re: Weekly/Monthly record-keeping / maintenance?

2009-04-02 Thread Bron Gondwana
On Thu, Apr 02, 2009 at 10:42:23AM -0400, Jeff Blaine wrote:
> Okay, well, for what it's worth, I fixed all of the
> problems prohibiting me from running a quota -f
> to completion.
> 
> The problem: imapdu.pl is buggy

Doh.

> It fails to do the right thing with mailboxes containing
> a space in the name.

Yeah, that's not entirely a surprise.  Spaces in names
confuse lots of stuff.

> ...
> 1.46 MB 114 msgs INBOX.BMP
> 1.46 MB 114 msgs INBOX.Bio Stuff
> 0.00 bytes 0 msgs INBOX.Drafts
> 1.25 MB 36 msgs INBOX.HLT
> 1.25 MB 36 msgs INBOX.Information Retrieval
> ...
> 
> # $Id: imapdu.pl,v 1.9 2008/04/04 12:47:14 murch Exp $
> 
> I don't suppose 'murch', the author of the code reads
> this list?

Yeah, he's around, though he doesn't always see stuff as quickly
if it's only sent to the list.  I've CC'd him.

That said, he's likely not the author - just the last person that
changed things.  Given that he did a giant sweeping copyright
update of nearly every file in the tree a couple of months ago...

  my ($rc, $msg) = $cyrus->send('', '', "EXAMINE $mb");
  if ($rc eq 'OK') {
  } else {
  print "failed: $mb: $msg\n";
  }

Apart from being icky perl, that will fail to change mailboxes
because the EXAMINE command will have dodgy syntax.  I'm not
entirely sure why you're not seeing the 'failed' messages
though...  The "$mb" needs to be at least quoted - which is
why I generally use something like Mail::IMAPTalk that can
do correct protocol quoting.

Ahh - it probably does output the "failed" stuff further up.
 
Bron.

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


Re: Weekly/Monthly record-keeping / maintenance?

2009-04-02 Thread Jeff Blaine
Okay, well, for what it's worth, I fixed all of the
problems prohibiting me from running a quota -f
to completion.

The problem: imapdu.pl is buggy

It fails to do the right thing with mailboxes containing
a space in the name.

...
1.46 MB 114 msgs INBOX.BMP
1.46 MB 114 msgs INBOX.Bio Stuff
0.00 bytes 0 msgs INBOX.Drafts
1.25 MB 36 msgs INBOX.HLT
1.25 MB 36 msgs INBOX.Information Retrieval
...

# $Id: imapdu.pl,v 1.9 2008/04/04 12:47:14 murch Exp $

I don't suppose 'murch', the author of the code reads
this list?

Jeff Blaine wrote:
> Well, hmm...
> 
> % sudo -u cyrus /local/mail/cyrus/bin/quota -f
> user.ahe: usage was 148771194, now 148756681
> ...
> user.william: usage was 107244707, now 107116597
> failed opening header for mailbox 'user.jay': System I/O error: %m
> failed building quota list for '*': System I/O error: %m
> 
> Apr  1 15:56:12 our.host.org quota[9819]: [ID 136705 local6.error] 
> IOERROR: opening /var/spool/imap/user/jay/cyrus.header: No such file or 
> directory
> Apr  1 15:56:12 our.host.org quota[9819]: [ID 357877 local6.error] 
> failed opening header for mailbox 'user.jay': System I/O error: Bad file 
> number
> Apr  1 15:56:13 our.host.org quota[9819]: [ID 809228 local6.error] 
> failed building quota list for '*': System I/O error: Bad file number
> 
> Wesley Craig wrote:
>> On 31 Mar 2009, at 16:50, Jeff Blaine wrote:
>>> What I mean, is, for one example -- a user is currently
>>> reporting that 'FETCH' (via the imapdu command) is showing
>>> 142 messages totalling 640KB in a folder that is actually
>>> completely empty on disk (except for cyrus.* files).
>> Fetch doesn't examine the messages in the mailbox if it doesn't need 
>> to.  Since you've reonstructed already, I wouldn't expect the seen DB is 
>> the problem.  Probably the quota.  Try rebuilding it.
>>
>> :wes
>>
> 
> Cyrus Home Page: http://cyrusimap.web.cmu.edu/
> Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
> List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
> 

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


Re: Weekly/Monthly record-keeping / maintenance?

2009-04-01 Thread Jeff Blaine
Well, hmm...

% sudo -u cyrus /local/mail/cyrus/bin/quota -f
user.ahe: usage was 148771194, now 148756681
...
user.william: usage was 107244707, now 107116597
failed opening header for mailbox 'user.jay': System I/O error: %m
failed building quota list for '*': System I/O error: %m

Apr  1 15:56:12 our.host.org quota[9819]: [ID 136705 local6.error] 
IOERROR: opening /var/spool/imap/user/jay/cyrus.header: No such file or 
directory
Apr  1 15:56:12 our.host.org quota[9819]: [ID 357877 local6.error] 
failed opening header for mailbox 'user.jay': System I/O error: Bad file 
number
Apr  1 15:56:13 our.host.org quota[9819]: [ID 809228 local6.error] 
failed building quota list for '*': System I/O error: Bad file number

Wesley Craig wrote:
> On 31 Mar 2009, at 16:50, Jeff Blaine wrote:
>> What I mean, is, for one example -- a user is currently
>> reporting that 'FETCH' (via the imapdu command) is showing
>> 142 messages totalling 640KB in a folder that is actually
>> completely empty on disk (except for cyrus.* files).
> 
> Fetch doesn't examine the messages in the mailbox if it doesn't need 
> to.  Since you've reonstructed already, I wouldn't expect the seen DB is 
> the problem.  Probably the quota.  Try rebuilding it.
> 
> :wes
> 

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


Re: Weekly/Monthly record-keeping / maintenance?

2009-04-01 Thread Wesley Craig
On 31 Mar 2009, at 16:50, Jeff Blaine wrote:
> What I mean, is, for one example -- a user is currently
> reporting that 'FETCH' (via the imapdu command) is showing
> 142 messages totalling 640KB in a folder that is actually
> completely empty on disk (except for cyrus.* files).

Fetch doesn't examine the messages in the mailbox if it doesn't need  
to.  Since you've reonstructed already, I wouldn't expect the seen DB  
is the problem.  Probably the quota.  Try rebuilding it.

:wes

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


Re: Weekly/Monthly record-keeping / maintenance?

2009-04-01 Thread Jeff Blaine
> How about
> 
> reconstruct -r -f user.hername

Nope.  FETCH/imapdu.pl reports 142 messages still.

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


Re: Weekly/Monthly record-keeping / maintenance?

2009-04-01 Thread Eddy Beliveau

 Message original 
Sujet : Re: Weekly/Monthly record-keeping / maintenance?
De : Jeff Blaine 
Pour : Andreas Winkelmann 
Copie à : info-cyrus@lists.andrew.cmu.edu
Date : 2009-03-31 16:50

Andreas Winkelmann wrote:
  

Am Dienstag 31 März 2009 18:09:32 schrieb Jeff Blaine:



Every year or so, a user of ours reports a discrepancy
between on-disk usage for their spool compared to what
'FETCH' is reporting (as implemented via imapdu.pl)
  
What means "on-disk usage for spool" ? 



What I mean, is, for one example -- a user is currently
reporting that 'FETCH' (via the imapdu command) is showing
142 messages totalling 640KB in a folder that is actually
completely empty on disk (except for cyrus.* files).

reconstruct -r user.hername did not change what is reported
via 'FETCH'.  It did update the cyrus.* files though.

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

  

Hi!

How about

reconstruct -r -f user.hername

Eddy

--
Eddy Beliveau
HEC Montreal
Montreal (Quebec)
Canada


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

Re: Weekly/Monthly record-keeping / maintenance?

2009-03-31 Thread Jeff Blaine
Andreas Winkelmann wrote:
> Am Dienstag 31 März 2009 18:09:32 schrieb Jeff Blaine:
> 
>> Every year or so, a user of ours reports a discrepancy
>> between on-disk usage for their spool compared to what
>> 'FETCH' is reporting (as implemented via imapdu.pl)
> 
> What means "on-disk usage for spool" ? 

What I mean, is, for one example -- a user is currently
reporting that 'FETCH' (via the imapdu command) is showing
142 messages totalling 640KB in a folder that is actually
completely empty on disk (except for cyrus.* files).

reconstruct -r user.hername did not change what is reported
via 'FETCH'.  It did update the cyrus.* files though.

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


Re: Weekly/Monthly record-keeping / maintenance?

2009-03-31 Thread Andreas Winkelmann
Am Dienstag 31 März 2009 18:09:32 schrieb Jeff Blaine:

> Every year or so, a user of ours reports a discrepancy
> between on-disk usage for their spool compared to what
> 'FETCH' is reporting (as implemented via imapdu.pl)

What means "on-disk usage for spool" ? 

Do you really compare the size of the Directory on the disk with the Size of 
each Mail-Message in this Directory?

> Compact/Expunge via the client app buys nothing.
>
> Clearly we are failing to do something as admins in order
> to keep our Cyrus instance working up to snuff.
>
> Can anyone shed some light on what we're doing wrong?
>
> What are the regular maintenance tasks we should be
> performing to keep everything working as precisely as
> possible?
>
> I found nothing useful in the Wiki regarding this topic.
>
> # our imapd.conf with auth options censored
> configdirectory:/var/imap
> defaultpartition:   default
> partition-default:  /var/spool/imap
> unix_group_enable: 0
> sieveusehomedir:true
> autocreatequota:20
> duplicate_db:   skiplist
> annotation_db:  skiplist
> mboxkey_db: skiplist
> mboxlist_db: skiplist
>
> # our cyrus.conf
> START {
>recover   cmd="ctl_cyrusdb -r"
> }
>
> SERVICES {
>imap  cmd="imapd" listen="imap" prefork=5 proto=tcp4
>imaps cmd="imapd -s" listen="imaps" prefork=1 proto=tcp4
>lmtpunix  cmd="lmtpd" listen="/var/imap/socket/lmtp" prefork=1
> }
>
> EVENTS {
>checkpointcmd="ctl_cyrusdb -c" period=10
>delprune  cmd="cyr_expire -E 3" at=0400
>tlsprune  cmd="tls_prune" at=0400
> }
> 
> Cyrus Home Page: http://cyrusimap.web.cmu.edu/
> Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
> List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

-- 
--
Andreas

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