unexpunge and subfolders

2006-10-17 Thread Leena Heino
If user has not deleted the whole subfolder only some of the messages then 
is there any way to restore those messages with unexpunge?


It seems that if any subfolders is specified as an argument then then 
unexpuge segfaults eg.: unexpunge -a user.foo.subfolder


(gdb) bt
#0  0xfedb455c in strlen () from /usr/lib/libc.so.1
#1  0xfee07058 in _doprnt () from /usr/lib/libc.so.1
#2  0xfee090c8 in vsnprintf () from /usr/lib/libc.so.1
#3  0xfedd62a4 in vsyslog () from /usr/lib/libc.so.1
#4  0xfedd5de0 in syslog () from /usr/lib/libc.so.1
#5  0x000178e8 in main (argc=4, argv=0xffbffe5c) at unexpunge.c:507

unexpunge.c:507
   505  if (r || expunge_fd == -1) {
   506  /* mailbox corrupt/nonexistent -- skip it */
   507  syslog(LOG_WARNING, unable to open/lock mailbox %s, 
argv[optind]);

   508  if (doclose) mailbox_close(mailbox);
   509  return 0;
   510  }

--
  Leena Heino  University of Tampere / Computer Centre
  ( liinu at uta.fi )  ( http://www.uta.fi/laitokset/tkk )

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: unexpunge and subfolders

2006-10-17 Thread Andy Fiddaman
On Tue, 17 Oct 2006, Leena Heino wrote:

; If user has not deleted the whole subfolder only some of the messages then is
; there any way to restore those messages with unexpunge?
;
; It seems that if any subfolders is specified as an argument then then unexpuge
; segfaults eg.: unexpunge -a user.foo.subfolder
;
; (gdb) bt
; #0  0xfedb455c in strlen () from /usr/lib/libc.so.1
; #1  0xfee07058 in _doprnt () from /usr/lib/libc.so.1
; #2  0xfee090c8 in vsnprintf () from /usr/lib/libc.so.1
; #3  0xfedd62a4 in vsyslog () from /usr/lib/libc.so.1
; #4  0xfedd5de0 in syslog () from /usr/lib/libc.so.1
; #5  0x000178e8 in main (argc=4, argv=0xffbffe5c) at unexpunge.c:507
;
; unexpunge.c:507
;505  if (r || expunge_fd == -1) {
;506  /* mailbox corrupt/nonexistent -- skip it */
;507  syslog(LOG_WARNING, unable to open/lock mailbox %s,
; argv[optind]);
;508  if (doclose) mailbox_close(mailbox);
;509  return 0;
;510  }


Well, the crash is due to a bug in unexpunge.c, line 507 should read:
   syslog(LOG_WARNING, unable to open/lock mailbox %s, argv[optind -1]);

(I reported this to the cyrus bugs email address a while ago).

However, if this is fixed then you will just get told
'unable to open/lock mailbox user.foo.subfolder'. I have virtdomains enabled
and use:

unexpunge -l fiddaman.net\!user.xxx.mailing_lists.cyrus

for example, which works fine. Not sure what you do for the default domain or
with virtdomains disabled, maybe try '\!user.foo.subfolder' ?

HTH.

Andy


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