repairing mailboxes.db

From: Craig White (no email)
Date: Sat Feb 05 2005 - 15:52:27 EST

  • Next message: (no name): "(no subject)"

    I am sorry to bother this list with this since directions seem so clear
    but I am not getting them.

    Included with distribution is a script to repair db...
    #!/bin/sh
    #

    # stop cyrus-imapd
    service cyrus-imapd stop

    # backup existing mailboxes.db
    mv /var/lib/imap/mailboxes.db /var/lib/imap/mailboxes.db.$$
    find /var/spool/imap/?/user -maxdepth 1 -mindepth 1 | \
      while read i; do
        echo $(basename $i)
        echo "user.$i<\t>default<\t>$i<\t>lrswipcda<\t>cyrus<\t>lrswipcda"
    >> /tmp/newmboxlist.txt
      done

    # we have everyone's base directory in /tmp/newmboxlist.txt, now we
    # import the new list
    /usr/lib/cyrus-imapd/ctl_mboxlist -u </tmp/newmboxlist.txt

    # and reconstruct to get subfolders into the list
    find /var/spool/imap/?/user -maxdepth 1 -mindepth 1 | \
      while read i; do
        /usr/lib/cyrus-imapd/reconstruct -rf user.$i
      done
    ***
    seems reasonable
    but when I execute it... it doesn't work - cyrus doesn't have privileges
    to execute 'service cyrus-imapd stop' and root doesn't have privileges
    to run ctl_mboxlist command.

    OK - so I stop cyrus-imapd as root and then try to run the rest as
    cyrus...

    administrator
    craig
    public_folder
    root
    line 1: no partition found
    line 2: no partition found
    line 3: no partition found
    line 4: no partition found

    $ cat /tmp/newmboxlist
    user./var/spool/imap/a/user/administrator<\t>default<\t>/var/spool/imap/a/user/administrator<\t>lrswipcda<\t>cyrus<\t>lrswipcda
    user./var/spool/imap/c/user/craig<\t>default<\t>/var/spool/imap/c/user/craig<\t>lrswipcda<\t>cyrus<\t>lrswipcda
    user./var/spool/imap/p/user/public_folder<\t>default<\t>/var/spool/imap/p/user/public_folder<\t>lrswipcda<\t>cyrus<\t>lrswipcda
    user./var/spool/imap/r/user/root<\t>default<\t>/var/spool/imap/r/user/root<\t>lrswipcda<\t>cyrus<\t>lrswipcda

    And I'm getting nowhere fast

    those the paths are there (ignoring the .user)
    -bash-2.05b$ ls -
    l /var/spool/imap/a/user/ /var/spool/imap/c/user/ /var/spool/imap/p/user/ /var/spool/imap/r/user/
    /var/spool/imap/a/user/:
    total 4
    drwx------ 7 cyrus mail 4096 Feb 3 00:05 administrator

    /var/spool/imap/c/user/:
    total 16
    drwx------ 61 cyrus mail 16384 Feb 5 11:47 craig

    /var/spool/imap/p/user/:
    total 4
    drwx------ 7 cyrus mail 4096 Feb 2 14:46 public_folder

    /var/spool/imap/r/user/:
    total 4
    drwx------ 2 cyrus mail 4096 Feb 5 11:01 root

    man ctl_mboxlist makes me think the result of the command to 'dump' the
    mailboxlist didn't work correctly because when I instead did...
    $ /usr/lib/cyrus-imapd/ctl_mboxlist -d > /tmp/newmboxlist.txt
    looked list this (first line)
    user.administrator default administrator lrswipcda

    and this worked...BUT...

    when I logged on, my inbox was empty, my folders looked fine and the
    inbox files when I :
    $ ls /var/spool/imap/c/user/craig/
    1. 113. 129. 139. 1491. 162. 178. 193. 208. 24. 39.
    51. 67. 81. 97. freshrpms postgres SPAMBOX
    10. 114. 1290. 1398. 15. 163. 179. 194. 209. 25. 4.
    52. 68. 82. 98. gnue psyche SPAM-learn
    100. 115. 13. 14. 150. 164. 18. 195. 21. 26. 40.
    53. 69. 83. 99. horde samba SPAM-NOT
    101. 116. 130. 140. 1503. 165. 180. 196. 210. 27. 400.
    54. 7. 84. 995. imp saved subscriptions
    102. 117. 1309. 141. 1504. 166. 181. 197. 211. 28. 409.
    55. 70. 85. amanda ipcop save_inbox suncou
    103. 118. 131. 142. 151. 167. 182. 198. 212. 29. 41.
    56. 71. 86. cyrus.cache jokes scooters taroon
    104. 119. 1310. 143. 152. 168. 183. 199. 213. 3. 417.
    57. 72. 87. cyrus.header kronolith security tobyhouse
    105. 12. 132. 144. 153. 169. 184. 2. 214. 30. 42.
    58. 73. 88. cyrus-imap ldap-umich Sent Trash
    106. 120. 1321. 145. 154. 17. 185. 20. 215. 31. 43.
    59. 730. 89. cyrus.index linux-plug Sent_2002 turba
    107. 121. 1324. 1457. 155. 170. 186. 200. 216. 32. 44. 6.
    74. 9. Deleted Items logs Sent_2003 vaio
    108. 122. 133. 146. 156. 171. 187. 201. 217. 33. 45.
    60. 75. 90. dell ltsp Sent_2004 VIRUSBOX
    109. 123. 134. 1463. 157. 172. 188. 202. 218. 34. 46.
    61. 76. 91. Drafts motta Sent Items vocp
    11. 124. 135. 147. 158. 173. 189. 203. 219. 35. 47.
    62. 77. 92. evolution mythtv Sent_Items webmin
    110. 125. 136. 148. 159. 174. 19. 204. 22. 36. 48.
    63. 78. 93. exxe netatalk sent-mail whitebox
    111. 126. 137. 1484. 16. 175. 190. 205. 220. 37. 49.
    64. 79. 94. fedora nilsson Sent_Messages xusers
    1119. 127. 1376. 1489. 160. 176. 191. 206. 223. 38. 5.
    65. 8. 95. fmexperts openldap Sent-new
    112. 128. 138. 149. 161. 177. 192. 207. 23. 384. 50.
    66. 80. 96. fmpro-l openvpn shrike

    all of the numbered files should be showing in my inbox but don't show
    up.

    Any suggestions appreciated

    Thanks

    Craig

    ---
    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
    

  • Next message: (no name): "(no subject)"





    Hosted Email Solutions

    Invaluement Anti-Spam DNSBLs



    Powered By FreeBSD   Powered By FreeBSD