Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #362582
    jislord
    Participant

    Ran into a very strange mail issue….
    I decided to write a script to backup emails of all users in my OSX 10.3.9 server (script attached below). I included this script in my crontab. It ran fine, backed up all emails. However, when the mail server started again, none of the email accounts were functioning. When I checked Server Admin, I found that the mail storage path had changed for all users to “Unknown Mailbox Path”. All settings for mail were however identical. The mail store path was still “/var/spool/imap”.
    After a struggle, I got everything up and running by reconstructing all mailboxes. Now, I am afraid to run this script again.. Any pointers?

    -J

    #!/bin/bash

    # keep 5 days of mail backups #
    ditto /Backup/Daily/var.imap.old3/ /Backup/Daily/var.imap.old4/
    ditto /Backup/Daily/var.imap.old2/ /Backup/Daily/var.imap.old3/
    ditto /Backup/Daily/var.imap.old1/ /Backup/Daily/var.imap.old2/
    ditto /Backup/Daily/var.imap/ /Backup/Daily/var.imap.old1/

    ditto /Backup/Daily/var.spool.imap.old3/ /Backup/Daily/var.spool.imap.old4/
    ditto /Backup/Daily/var.spool.imap.old2/ /Backup/Daily/var.spool.imap.old3/
    ditto /Backup/Daily/var.spool.imap.old1/ /Backup/Daily/var.spool.imap.old2/
    ditto /Backup/Daily/var.spool.imap/ /Backup/Daily/var.spool.imap.old1/

    # backup active mail directories #
    /usr/sbin/serveradmin stop mail
    ditto /var/imap/ /Backup/Daily/var.imap/
    ditto /var/spool/imap/ /Backup/Daily/var.spool.imap/
    /usr/sbin/serveradmin start mail

    #362596
    jislord
    Participant

    Some more details:

    I think I have narrowed down the problem. Still need a solution though !

    When I do a “serveradmin mail stop”, it does not stop postfix.
    When I do a “postfix stop”, even then, it starts again automatically !!.
    I am sure that postfix is corrupting the cyrus databases when they are being backed up. Any ideas?

    #362623
    jislord
    Participant

    I am not sure what kind of programs that you mean? I have the default config: postfix is the mta and cyrus is the imap server. Would clients requesting imap or pop data also start these services automatically?

    #365953
    Pascal
    Participant

    I know this is late, but shouldn’t it say ‘serveradmin stop mail’ instead of ‘serveradmin mail stop’?

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Comments are closed