LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-13-2008, 11:00 PM   #1
CH586
LQ Newbie
 
Registered: Dec 2008
Posts: 2

Rep: Reputation: 0
Smile Postfix email backup?


Hi all,

I am a newbie to linux and postfix. I am trying to keep a copy of incoming mails to users own backup folder on Fedora 7. For example, copy all test@test.com incoming mails to /home/test/mail.backup. Please show me how to do it if you can. Any help appreciated.
 
Old 12-13-2008, 11:21 PM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
The way I do it is simply with a cron job. I use maildir format for my emails (see home_mailbox setting in main.cf), so my emails are in ~/Maildir.

A cron job like

Code:
25      *       *       *       *       /usr/bin/rsync -avt --delete ~/Maildir ~/mail.backup > /dev/null 2>&1
should work. Note that the --delete means that when the user deletes an email, it will get deleted from the backup next time the cron job is run. You may not want this, and you can omit --delete. If you use an mbox format, all your emails are in one file, so deletions will be deleted.

If you want to get more sophisticated, you can use procmail or maildrop to take delivery from postfix. I use maildrop, and a line like

Code:
cc "/home/username/Maildir/.Mail_Backup/"
will cc all mail to the sub folder Mail_Backup.

You may be able to use one of the postfix bcc parameters, but I've never used them.

Depends a bit why you are taking backups
 
Old 12-14-2008, 06:37 AM   #3
CH586
LQ Newbie
 
Registered: Dec 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Thumbs up This Forums users are wonderful. Thank you.

Quote:
Originally Posted by billymayday View Post
The way I do it is simply with a cron job. I use maildir format for my emails (see home_mailbox setting in main.cf), so my emails are in ~/Maildir.

A cron job like

Code:
25      *       *       *       *       /usr/bin/rsync -avt --delete ~/Maildir ~/mail.backup > /dev/null 2>&1
should work. Note that the --delete means that when the user deletes an email, it will get deleted from the backup next time the cron job is run. You may not want this, and you can omit --delete. If you use an mbox format, all your emails are in one file, so deletions will be deleted.

If you want to get more sophisticated, you can use procmail or maildrop to take delivery from postfix. I use maildrop, and a line like

Code:
cc "/home/username/Maildir/.Mail_Backup/"
will cc all mail to the sub folder Mail_Backup.

You may be able to use one of the postfix bcc parameters, but I've never used them.

Depends a bit why you are taking backups

Billymayday,

Thank you so much for the wonderful information. I will give it a try today.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix email backup? glyn3332 Linux - Server 7 10-11-2008 12:27 PM
Postfix: help required to configure postfix to redirect email. Wheddod Linux - Software 3 08-20-2008 07:55 AM
Postfix: cant send email from my Windows pc using my postfix mailserver elvisious Linux - Software 8 08-01-2008 07:01 PM
backup email server in Postfix LinuxLover Linux - Networking 1 12-28-2005 09:39 AM
How do I configure postfix master to forward all email to an email server ? hello321_1999 Linux - Software 1 11-18-2004 04:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration