Re: Empty folders

2014-12-31 Thread Andrea Venturoli
On 12/30/14 13:33, Niels Dettenbach (Syndicat.com) wrote:

 Am 30.12.2014 um 11:24 schrieb Andrea Venturoli m...@netfence.it:

 _ dm user.A.B.D (this won't delete anything);
 This is only for „deleting“ possibly existing but corrupt(ed) database 
 entries.
 _ stop imapd;
 _ reconstruct -r -f user.A (this will discover the folders I just only 
 formally deleted);
 _ start imapd;
 _ restore permissions for user.A*.
 hmm, OK,
 restarting should not be required afaik (but might be i’m wrong here) - but 
 if it help’s you, OK.

Everything seems solved now; thanks for your time and help.





 Relevant Modules are i.e.:

 Cyrus::IMAP::Admin
 http://search.cpan.org/~eestabroo/IMAP-Admin-1.6.7/Admin.pm
 http://www.manpagez.com/man/3/Cyrus::IMAP::Admin/

 manpages and perldoc are typical doc and example resources too for any 
 (installed) perl modules. There are many (very helpful) examples around which 
 should be relatively easy to adopt for your needs, even if you are a perl 
 „newcomer“.

 cyradm is the „alter ego of“ Cyrus::IMAP::Shell which is „just“ a „wrapper“ 
 around that module:
 https://cyrusimap.org/docs/cyrus-imapd/2.2.13p1/man/cyradm.1.php

 so it offers/does anything in the same way cyradm does, but object oriented 
 and/or perled.

 some further examples:
 http://lists.andrew.cmu.edu/pipermail/info-cyrus/2011-April/034798.html
 http://doc.gabosh.net/howto_IMAP_POP3_Server.html

Thanks again; I'll look into them.




 The major parts are the mailbox list db (which is typically „outside“
  the IMAP spool / filesystem) and the indices withIN the mailboxes and
  both could be handled by proper tools even „around“ cyradm shell.

I know.
I'm familiar with the case where a mailbox/folder exists in the mailbox 
list db, but not in the file system (or the other way around).

What puzzled me is a dual personality behaviour WRT to the mailbox 
list db.
As previously stated:
a) ctl_mboxlist -v showed 'user.A.B.D' has a directory 
'/data/imap/user/A/B/D' but no DB entry;
b) yet reconstruct -r f user.A would not discover this folder as new 
(until I did dm it);
c) cm user.A.B.D resulted in createmailbox: Mailbox already exists.

b) and c) seem to agree, but isn't a) in plain contrast?




  bye
av.

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: Empty folders

2014-12-30 Thread Andrea Venturoli
On 12/30/14 07:10, Niels Dettenbach (Syndicat IT  Internet) wrote:
 Am 29. Dezember 2014 23:02:10 MEZ, schrieb Andrea Venturoli 
 m...@netfence.it:
 cyradm dm does not delete this folder (and its files) from the
 filesystem.
 This is OK as long as you clearify for  you  that  there  is no folder before 
  you recreate the cyrus  folder  from/over  cyrus  again - means: delete it 
 by hand (rm) if still there.

 _ restore the old cyrus.* files.
 This should be done by reconstruct  -r -f  over  the (correct) folders - if 
 not, you still have  any problem in your setup or procedure as this command  
 must work for general/further proper cyrus functionality.

Thanks again.

In fact I found a faster procedure:
_ dm user.A.B.D (this won't delete anything);
_ stop imapd;
_ reconstruct -r -f user.A (this will discover the folders I just only 
formally deleted);
_ start imapd;
_ restore permissions for user.A*.



 Only thing, I'll have to script this, since I've got a lot of
 problematic folders...
 arrgh, sound's timeconsuming -  so good luck...  Personally i prefer perl 
 with the  official  cyrus  imap/admin perl modules  for any cyrus scripting.

Could you share a pointer?
I'm not proficient with perl, but I'd gladly look into them anyway.



 If  don't know the reason behind the problem it may make sense to generate 
 database dumps of the mboxlist
  by cron from time to time and check if  there further such bad 
folders  get generated by a script or similiar.

I don't know where the problem originated from, so I'll check a number 
of times in the next few days/weeks.


However I'm suprised: looking into cyrus imap as a black box, it's 
almost like it has two databases for the same things.



  bye  Thanks
av.

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus


Re: Empty folders

2014-12-30 Thread Niels Dettenbach (Syndicat.com)

 Am 30.12.2014 um 11:24 schrieb Andrea Venturoli m...@netfence.it:
 
 _ dm user.A.B.D (this won't delete anything);
This is only for „deleting“ possibly existing but corrupt(ed) database entries.
 _ stop imapd;
 _ reconstruct -r -f user.A (this will discover the folders I just only 
 formally deleted);
 _ start imapd;
 _ restore permissions for user.A*.
hmm, OK,
restarting should not be required afaik (but might be i’m wrong here) - but if 
it help’s you, OK.


 Could you share a pointer?
 I'm not proficient with perl, but I'd gladly look into them anyway.

For Perl Modules, CPAN should be your first friend:
http://www.cpan.org

but many distributions bring the cyrus perl modules still somewhere within the 
cyrus (or cyrus dev) packages.

Relevant Modules are i.e.:

Cyrus::IMAP::Admin
http://search.cpan.org/~eestabroo/IMAP-Admin-1.6.7/Admin.pm
http://www.manpagez.com/man/3/Cyrus::IMAP::Admin/

manpages and perldoc are typical doc and example resources too for any 
(installed) perl modules. There are many (very helpful) examples around which 
should be relatively easy to adopt for your needs, even if you are a perl 
„newcomer“.

cyradm is the „alter ego of“ Cyrus::IMAP::Shell which is „just“ a „wrapper“ 
around that module:
https://cyrusimap.org/docs/cyrus-imapd/2.2.13p1/man/cyradm.1.php

so it offers/does anything in the same way cyradm does, but object oriented 
and/or perled.

some further examples:
http://lists.andrew.cmu.edu/pipermail/info-cyrus/2011-April/034798.html
http://doc.gabosh.net/howto_IMAP_POP3_Server.html

 However I'm suprised: looking into cyrus imap as a black box, it's almost 
 like it has two databases for the same things.
 
Yes and no,
i understand that for many „newer“ cyrus users cyrus behaves like a „black 
box“, but it widely isn’t in practice. The major parts are the mailbox list 
db (which is typically „outside“ the IMAP spool / filesystem) and the indices 
withIN the mailboxes and both could be handled by proper tools even „around“ 
cyradm shell. Different possible database formats (and BDB versions too) could 
„confuse“ users seriously…

But in my experience users could live on the „blackbox level“ and rely on it 
even in disaster scenarios (like in yours, where the cyradm shell plus standard 
filesystem ops are „enough), except in cases of i.e. BDB version upgrades or 
arch migrations which should be handled with care / the official procedures.

good luck,
cheerioh,


Niels.
Syndicat IT  Internet
http://www.syndicat.com


signature.asc
Description: Message signed with OpenPGP using GPGMail

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: Empty folders

2014-12-29 Thread Andrea Venturoli
On 12/28/14 20:41, Simon Amor wrote:
 Have they created folder A/B/C in their mail client, but not created A/B ?

No idea, really.
However the point is not A/B has no content or cyrus.* files: I'm fine 
with that.

The real problem is A/B/D is shown as empty.

  bye  Thanks
av.

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus


Re: Empty folders

2014-12-29 Thread Andrea Venturoli
On 12/28/14 16:28, Niels Dettenbach (Syndicat.com) wrote:

 Am 28.12.2014 um 16:26 schrieb Niels Dettenbach (Syndicat.com
 http://Syndicat.com) n...@syndicat.com mailto:n...@syndicat.com:

 One „easy“ option is to use cyradm and create the mailbox folders by
 hand with cm or similar (this should not delete content of the folders
 i assume, but make a backup of them for no risk). After that do
 reconstruct -f -r over the mailbox.

Hello.

Thanks for your suggestion.

cm user.A.B did in fact work (and create A/B/cyrus.* files).
reconstruct -f -r user.A, however didn't achieve anything.

cm user.A.B.D results in createmailbox: Mailbox already exists.

Still A.B.D shows up empty in any client and is reported by ctl_mailbox 
has having a directory but no DB entry.


 …just in addition: make sure the folders have correct access rights...

They are.



  bye  Thanks
av.

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: Empty folders

2014-12-29 Thread Niels Dettenbach (Syndicat.com)

 Am 29.12.2014 um 19:15 schrieb Andrea Venturoli m...@netfence.it:
 
 cm user.A.B did in fact work (and create A/B/cyrus.* files).
 reconstruct -f -r user.A, however didn't achieve anything.
 
 cm user.A.B.D results in createmailbox: Mailbox already exists.
 
 Still A.B.D shows up empty in any client and is reported by ctl_mailbox has 
 having a directory but no DB entry.
 


hmmm,
i would make a backup of the folders, delete it by cyradm dm (check if the 
folders in filesystem are gone too then) and recreate it by cyradm cm, copy the 
mail files into it, make shure the access rights fit your cyrus needs and make 
a reconstruct -r -f over the folders(!). reconstruct -r -f usually must give 
something out, but depending from your setup the correct path might be user/A 
(user/A* should work too for reconstruct -r -f) - for now it sound’s a bit like 
a Cyrus IMAP „path“ problem too. Check i.e. with cyradm lm or cyradm lam the 
naming conventions of other (working) directories/folders.

If that doesn’t help, make sure the mailbox user has all access rights to that 
folders by cyradm lam.

To make sure that you did not see any „old stuff“ (cached or similar) in your 
imap client, use temporarily another imap client without any caching - i.e. 
mutt -f imap://user@imaphost or a webmailer or similar.


hth,
cheerioh,


Niels.


signature.asc
Description: Message signed with OpenPGP using GPGMail

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: Empty folders

2014-12-29 Thread Andrea Venturoli
On 12/29/14 19:43, Niels Dettenbach (Syndicat.com) wrote:

 hmmm,
 i would make a backup of the folders, delete it by cyradm dm
 (check if the folders in filesystem are gone too then)

cyradm dm does not delete this folder (and its files) from the filesystem.



 and recreate it by cyradm cm, copy the mail files into it, make
 shure the access rights fit your cyrus needs and make a
 reconstruct -r -f over the folders(!).

Thanks to your suggestion I found a procedure that works:
_ store away D's cyrus.* files;
_ sam user.A.B.D root lrswpcdai
_ dm user.A.B.D (as said this doesn't delete anything)
_ cm user.A.B.D (this overwrites cyrus.*)
_ restore the old cyrus.* files.

Only thing, I'll have to script this, since I've got a lot of 
problematic folders...



 depending from your setup the correct path might be user/A
 for now it sound’s a bit like a Cyrus IMAP „path“ problem too.
 Check i.e. with cyradm lm or cyradm lam the naming conventions
 of other (working) directories/folders.

I'm using user.A: this is correct for my server.



 If that doesn’t help, make sure the mailbox user has all access rights to 
 that folders by cyradm lam.

Access rights are not the problem.



 To make sure that you did not see any „old stuff“ (cached or similar) in your 
 imap client,
 use temporarily another imap client without any caching - i.e. mutt -f
 imap://user@imaphost or a webmailer or similar.

I know TB is flaky in this regard, so I used a webmail from the start.


Thanks a lot for your help.

  bye
av.

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: Empty folders

2014-12-29 Thread Niels Dettenbach (Syndicat IT Internet)
Am 29. Dezember 2014 23:02:10 MEZ, schrieb Andrea Venturoli m...@netfence.it:
cyradm dm does not delete this folder (and its files) from the
filesystem.
This is OK as long as you clearify for  you  that  there  is no folder before  
you recreate the cyrus  folder  from/over  cyrus  again - means: delete it by 
hand (rm) if still there.

_ restore the old cyrus.* files.
This should be done by reconstruct  -r -f  over  the (correct) folders - if 
not, you still have  any problem in your setup or procedure as this command  
must work for general/further proper cyrus functionality.

Only thing, I'll have to script this, since I've got a lot of 
problematic folders...
arrgh, sound's timeconsuming -  so good luck...  Personally i prefer perl with 
the  official  cyrus  imap/admin perl modules  for any cyrus scripting.

If  don't know the reason behind the problem it may make sense to generate 
database dumps of the mboxlist by cron from time to time and check if  there 
further such bad  folders  get generated by a script or similiar.


good luck and
cheerioh,


Niels.
-- 
Niels Dettenbach
Syndicat IT  Internet
http://www.syndicat.com

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus


Empty folders

2014-12-28 Thread Andrea Venturoli
Hello.

I'm a long time cyrus IMAP admin, but I'm new to this mailing list, 
since this is the first time I encounter a problem I can't seem to solve 
alone.

A server of mine is running version 2.3.18:
_ user A has got his mailbox with lots of folders: all are working and 
all but one (B) have their cyrus.index, cyrus.header, cyrus.cache;
_ folder (B) has no cyrus.index, cyrus.header, cyrus.cache: ThunderBird 
displays it in gray but allows subfolders; of course there are no 
messages here;
_ as said, under B there are a lot of subfolders, most of which work; 
some, however, are shown as empty even if they exist, have messages in 
the file system and even have cyrus.* files (lets take D as an example).

So, to summarize I've got:
A (working)
  B (empty with no cyrus.* files)
   C (working)
   D (shown as empty even if cyrus.* and message files are present).


I tried reconstruct user.A: no results.
reconstruct -r user.A: user.A.B.D is listed in the output, but still 
no help.
reconstruct -f user.A didn't help either, nor did  reconstruct -f -r 
user.A.

No error is given to the client or displayed in the logs.
Owner and permissions in the filesystem are correct and so are IMAP rights.

The only strange thing I got to see is running ctl_mboxlist -v, which 
gives:
'user.A.B.D' has a directory '/data/imap/user/A/B/C' but no DB entry


Any suggestion on how to get out of this situation?

  bye  Thanks
av.

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus


Re: Empty folders

2014-12-28 Thread Niels Dettenbach (Syndicat.com)

 Am 28.12.2014 um 16:19 schrieb Andrea Venturoli m...@netfence.it:
 
 Any suggestion on how to get out of this situation?

...it seems your regarding mailbox DB is incomplete.

One „easy“ option is to use cyradm and create the mailbox folders by hand with 
cm or similar (this should not delete content of the folders i assume, but make 
a backup of them for no risk). After that do reconstruct -f -r over the mailbox.

hth,
cheerioh,


Niels.
Syndicat IT  Internet
http://www.syndicat http://www.syndicat/.com


signature.asc
Description: Message signed with OpenPGP using GPGMail

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

Re: Empty folders

2014-12-28 Thread Niels Dettenbach (Syndicat.com)

 Am 28.12.2014 um 16:26 schrieb Niels Dettenbach (Syndicat.com) 
 n...@syndicat.com:
 
 One „easy“ option is to use cyradm and create the mailbox folders by hand 
 with cm or similar (this should not delete content of the folders i assume, 
 but make a backup of them for no risk). After that do reconstruct -f -r over 
 the mailbox.

…just in addition: make sure the folders have correct access rights...


signature.asc
Description: Message signed with OpenPGP using GPGMail

Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus