Email Backup

Discussion in 'Server Operation' started by aberrio, May 11, 2008.

  1. aberrio

    aberrio New Member

    Hello, How can i back up postfix email server to cimply with regulations?

    Best regards

    AL
     
  2. topdog

    topdog Active Member HowtoForge Supporter

    Setup archiving, you can use postfix's built in bcc to send each and every email to a script that then encrypts and stores it to file.
     
  3. aberrio

    aberrio New Member

    thx, is this incremental back up or simply backup what is on the server at that time.?
     
  4. aberrio

    aberrio New Member

    any update with this

    thx
     
  5. topdog

    topdog Active Member HowtoForge Supporter

    each and every single email that passes through the system will be stored.
     
  6. aberrio

    aberrio New Member

    is any application than can do this?
     
  7. aberrio

    aberrio New Member

    any suggestion on this?
     
  8. chipsafts

    chipsafts New Member

    i just use a cron job to do a
    cp -a /var/spool/mail /home/backup/mail
     
  9. topdog

    topdog Active Member HowtoForge Supporter

    Okay using my method here is a tip on how you can get it working

    Create a script /etc/postfix/mail-backup.sh
    Code:
    #!/bin/bash
    
    cat >> /backup_dir/mail-backup
    
    Now for the always bcc use an address like email-backup
    In your aliases file have a pointer to the script
    Code:
    email-backup: "|/etc/postfix/mail-backup.sh"
    All the bcc'ed mail will be stored in the spool file /backup_dir/mail-backup.

    NOTE that you can get more fancy with this and split the spool files if you have multiple users by reading the mail headers and getting the to address then store the mail in that users spool file.

    Anyway this is just a skeleton for you to build on, haven't got the time on my hands to create you the full solution.
     
  10. techmeltz

    techmeltz New Member

    Restore

    That solution framework looks pretty simple yet effective.. how would you restore from that in the event of total server disaster? let's assume that a seperate program copied the target file to a remote server and is completely intact.
     
  11. topdog

    topdog Active Member HowtoForge Supporter

    In event of total disaster if you separated users to each have their own backup you can just copy back the file to their spool file if they are using mbox format if they are using maildir you will have to use a convertor to restore the mail.

    The mails are stored in mbox format you if you want to restore a single email you can just use
    Code:
    mutt -f /path/to/file
    to replay the single mail
     

Share This Page