PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Update Cyrus 1.5.19 auf cyrus21 - Userverzeichnisse?



Frisco
29.08.05, 11:53
Hallo zusammen,

ich habe mir erstmalig unter Debian Sarge einen Mailserver installiert, Postfix, Cyrus, Procmail und Fetchmail, Webclient Horde, Mailclient Thunderbird, das läuft schonmal gut.

Allerdings würde ich gerne zur serverseitigen Filterung Sieve einsetzen, und da habe ich gesehen, dass ich wohl besser nicht das Debian-Paket cyrus-imapd, sondern die cyrus21-Pakete installiert hätte.

Das könnte ich jetzt natürlich mit apt-get leicht auf den aktuellen Stand bringen, allerdings frage ich mich ob ich da mit Probleme zu rechnen habe, vor allem bei den User-Verzeichnissen, da cyrus21 die Mails wohl in einer Datenbank speichert?

Momentan liegt halt alles unter /var/spool/mail/users, und nach einem zeitintensiven Wochenende sind da jetzt über 1GB Mails drin - da wüßte ich natürlich gern vorher, ob ich mit Problemen beim Update rechnen muss.

Wißt ihr da was zu?`

Viele Grüße!

Frisco
29.08.05, 22:55
Hallo,

ich hatte cyrus21-doc/UPGRADE.Debian gefunden, das eigentlich genau mein Problem beschreibt, leider klappt das aber nicht.

Unten ist die UPGRADE.Debian ergänzt um meine Anmerkungen, einfach nach Zeilen beginnend mit "frisco" schauen/suchen.

Hat einer 'ne Ahnung was da schief läuft?

Viele Grüße!

------- UPGRADE.Debian ergänzt ---------

Upgrading cyrus-imapd to cyrus2-imapd on Debian
$Id: UPGRADE.Debian,v 1.15 2004/11/23 12:35:35 hmh Exp $
(thanks to David D. Kilzer <ddkilzer@theracingworld.com> for this document)
-----------------------------------------------

For more information, see README.Debian[.gz] in /usr/share/doc/cyrus21-common/
and the web page below, part of the cyrus-utils project at SourceForge:

http://cyrus-utils.sourceforge.net/faq

This document describes the procedure for upgrading from the old cyrus-imapd
(v1.5.x) package to the new cyrus21-imapd (v2.1) package. While this is a
manual process, it is very straightforward.

The procedure for converting a v1.6 cyrus store to v2.1 is not explained here,
but the tools to convert the sieve scripts are in /usr/lib/cyrus/upgrade.

Your SASL installation may require further conversion steps, as Cyrus v2.1 uses
SASL v2, while Cyrus v1.5 used SASL v1.5. /usr/share/doc/libsasl2 has more
information on SASL v2. Do pay attention to your SASL v2 installation, such
as permissions and such. When in doubt, read the README.simpleinstall
document, as it describes an initial SASLv2 setup.

NOTE: If you've already installed the cyrus21 packages, skip to step 5.

1. Become the "root" user on your local system.

$ /bin/su -
#

2. Look for any running cyrus daemons using the ps(1) command. Use
kill(1) to stop any processes that are found.

# /etc/init.d/pwcheck stop
# ps auwwx | grep cyr
# ps auwwx | grep pop3d
# ps auwwx | grep imapd
# ps auwwx | grep nntpd

3. Remove the old cyrus packages.

# apt-get --purge remove cyrus-common cyrus-admin cyrus-imapd cyrus-pop3d \
cyrus-nntpd

or use dselect/aptitude/synaptic/your favorite deb management tool.

IMPORTANT: You must answer "n" to this question: "Do you want me to
remove the Cyrus mail and news spool (y/n) [n] ?"

frisco 20050829: no question, directories removed, backup restored

NOTE: You could also copy -a the /var/spool/cyrus and /var/lib/cyrus
folders somewhere else, just in case.

frisco 20050829: This note should be put first to 3., otherwise it could be to late. I know one should read first completly, but you know how users behave ;-)

4. Install the new cyrus21-imapd packages. Make sure no user will try
to connect to imapd/pop3d and that no MTA will try to deliver to lmtpd
until you do step 5.

cyrus21-common [required]
cyrus21-admin [required]
cyrus21-imapd [optional; must have one of imapd or pop3d]
cyrus21-pop3d [optional; must have one of imapd or pop3d]
libcyrus-imap-perl21 [required]

# apt-get install PACKAGE-NAME [PACKAGE_NAME ...]

or use dselect.

5. Stop the cyrmaster process.

# /etc/init.d/cyrus21 stop

5a. Make sure Cyrus won't start until the upgrade process is over.

# cp -f /usr/lib/cyrus/upgrade/cyrus-db-types.upgrading_from_1.5.txt \
/usr/lib/cyrus/cyrus-db-types.active

6. Install the libdb3-util package.

# apt-get install libdb3-util

7. Change to the "cyrus" user.

# /bin/su - cyrus
$

8. Run the rehash program.

$ /usr/lib/cyrus/upgrade/rehash basic

9. Run ctl_mboxlist to update the "mailboxes" file.

$ cd /var/lib/cyrus
$ /usr/sbin/ctl_mboxlist -u < mailboxes

frisco 20050829: no mailboxes-file here (updating from 1.5.19-20 deb)

10. Run the cyrreconstruct program from the /var/spool/cyrus directory
to reconstruct the mailboxes.

$ cd /var/spool/cyrus
$ /usr/sbin/cyrreconstruct -r user.*

frisco 20050829: This is correct, but it could be worth mentioning why the user-dir from /var/spool/cyrus/mail/user has vanished (rehash did it, right?) - it took me some time, but find . -name user then showed me
cyrreconstruct is very fast or does not do anything - no output was given and it ended immediatly

(you may need to cyrreconstruct other mailboxes, if you have any
system mailboxes or shared mailboxes not in the user hierarchy)

11. Exit the "cyrus" user, back to "root".

$ exit
#

12. Upgrade all of the db2 files used by Cyrus from to db3.
^^
frisco 20050829: from what: -> (see line above)

# find /var/lib/cyrus -name \*.db -print -exec /usr/bin/db3_upgrade {} \;

frisco 20050829: Seems not to work, output as follows:
root@linux:/# find /var/lib/cyrus -name \*.db -print -exec /usr/bin/db3_upgrade {} \;
/var/lib/cyrus/mailboxes.db
db_upgrade: /var/lib/cyrus/mailboxes.db: unrecognized file type
db_upgrade: DB->upgrade: /var/lib/cyrus/mailboxes.db: Invalid argument

13. Convert the state databases to those used by new Cyrus 2.1

Read /usr/share/doc/cyrus21-common/README.Debian.database, and follow
whatever steps you need to change the backends from db3 to skiplist.

This step needs some work, if you can send your experiences with it
to hmh@debian.org, I will update this document accordingly.

**** The upgrade of Cyrus' stores are now complete ****

You may want to remove any left-over empty directories from the old version,
and re-run /usr/sbin/cyrus-makedirs just in case you got one of them wrong.

Now, you need to reconfigure the new Cyrus imapd to adequate it to your system
and SASL requirements. The Cyrus config files are /etc/imapd.conf,
/etc/cyrus.conf and /etc/default/cyrus21.

Depending on your SASL configuration, you may also need to modify
/etc/pam.d/{imap,pop,sieve,lmtp} and other SASL configuration files.

Do not forget to edit /etc/imapd.conf to e.g. set the "admins: cyrus" line (if
you use "cyrus" as the name for the administrator).

Frisco
30.08.05, 15:35
Hallo,

wie schon oben beschrieben hatte ich ja Probleme beim Update der Userverzeichnisse. Cyrus auf Cyrus21 habe ich mittlerweile hinbekommen und am Laufen, aber auf die alten Mails kann ich immer noch nicht zugreifen.

Kann mir da bitte jemand helfen?

Das Verzeichnis eine Testusers sieht wie folgt aus (eine alte Mail):

root@linux:/var/spool/cyrus/mail/a/user/annette# la
insgesamt 24
drwx------ 2 cyrus mail 4096 2005-08-30 14:54 .
drwxr-xr-x 3 cyrus mail 4096 2005-08-29 21:51 ..
-rw------- 1 cyrus mail 984 2005-08-17 15:29 1.
-rw------- 1 cyrus mail 4 2005-08-30 14:54 cyrus.cache
-rw------- 1 cyrus mail 153 2005-08-30 14:54 cyrus.header
-rw------- 1 cyrus mail 76 2005-08-30 14:54 cyrus.index
-rw------- 1 cyrus mail 0 2005-08-17 10:44 cyrus.seen
root@linux:/var/spool/cyrus/mail/a/user/annette#

Die Mail "1." ist nicht zu sehen. Den User "annette" habe ich mit cyradm neu angelegt, er kann sich auch einloggen, nur Mails sieht er keine. SASL-Authentifikation läuft also auch.

Ich habe einiges aus den README.Debian-Dateien (,.simpleinstall, .database, UPGRADE) versucht, aber bei der Konvertierung der Userverzeichnisse und der Handhabung von cvt_cyrusdb mache ich scheinbar einiges falsch.

Mir scheint auch, dass die apt-get-Installation von cyrus21*-Paketen einiges automatisch macht, was in den Readmes noch als manuell beschrieben wird.

Anyway, ich krieg einfach keinen Zugriff auf die alten Mails, da muss doch einer einen Tipp haben?

Danke schonmal und viele Grüße!

Frisco
30.08.05, 19:42
Hallo nochmal,

das Hauptproblem habe ich lösen können: Mit cyradm die User wieder angelegt, ebenso für SASL, dann als User cyrus mit "cyrreconstruct -f user.name" für jeden User die Mails wiederhergestellt. "user.*" klappt leider bei mir nicht.

Dabei ist aber ein anderes Problem aufgetaucht: Fetchmail lasse ich in mail.log schreiben, was nur klappt wenn ich mail.log auf den Eigentümer fetchmal chown'e :-) oder fetchmail in die Gruppe mail mit aufnehme und der Gruppe Schreibrechte gebe - ich habe zweiteres getan. Nach dem morgendlichen Logrotate gehört aber enweder mail.log wieder root.adm oder die Gruppenschreibrechte sind wieder weg. Dann holt aber fetchmail keine Mails mehr, weil er nicht ins Log schreiben kann.

Wo kann ich das ändern, das die Gruppenschreibrechte erhalten bleiben?

Viele Grüße,
André