Networking Forums

Networking Forums > Computer Networking > Linux Networking > Mail Backup

Reply
 
 
Dan N
Guest
Posts: n/a

 
      11-28-2005, 06:37 AM

I need a way to make a copy of incoming mail and put it into a backup file
for each user. I'm using Postfix as my MTA.

Mail for, say, johnc, normally gets put into /var/mail/johnc. I'd like to
have another file, say, johnc.bak, which gets a copy of any mail that goes
into johnc. Is there an easy way to do this? I'd like to do this for all
users, so I don't think procmail is what I'm looking for.

Thanks

Dan
 
Reply With Quote
 
 
 
 
Sybren Stuvel
Guest
Posts: n/a

 
      11-28-2005, 07:08 AM
["Followup-To:" header set to alt.os.linux.]
Dan N enlightened us with:
> I need a way to make a copy of incoming mail and put it into a
> backup file for each user. I'm using Postfix as my MTA.


I'd do a 'cp -ua' in a cron job every few minutes.

> Mail for, say, johnc, normally gets put into /var/mail/johnc.


I suggest you move from mbox format to maildir format. It's a lot
safer ;-)

Sybren
--
The problem with the world is stupidity. Not saying there should be a
capital punishment for stupidity, but why don't we just take the
safety labels off of everything and let the problem solve itself?
Frank Zappa
 
Reply With Quote
 
Matt Payton
Guest
Posts: n/a

 
      11-28-2005, 10:20 PM
Dan N wrote:
> I need a way to make a copy of incoming mail and put it into a backup file
> for each user. I'm using Postfix as my MTA.
>
> Mail for, say, johnc, normally gets put into /var/mail/johnc. I'd like to
> have another file, say, johnc.bak, which gets a copy of any mail that goes
> into johnc. Is there an easy way to do this? I'd like to do this for all
> users, so I don't think procmail is what I'm looking for.
>
> Thanks
>
> Dan


Procmail maybe ?
Something like the following in .procmailrc will copy al incoming
messages to the "backup" mail folder :
:0 c:
backup


--
- Matt -
 
Reply With Quote
 
Dan N
Guest
Posts: n/a

 
      11-29-2005, 12:06 AM
On Mon, 28 Nov 2005 23:20:04 +0000, Matt Payton wrote:

> Procmail maybe ?
> Something like the following in .procmailrc will copy al incoming messages
> to the "backup" mail folder :
> :0 c:
> backup


Thanks.

I was thinking that I wanted a more central option, something that
wouldn't require setting up for each user, so I ruled out procmail. But I
guess I could put the .procmailrc in the skel directory so it would be set
up automatically for each user.

Dan

 
Reply With Quote
 
Michael Perry
Guest
Posts: n/a

 
      11-29-2005, 04:16 AM
Dan N wrote:

> On Mon, 28 Nov 2005 23:20:04 +0000, Matt Payton wrote:
>
> > Procmail maybe ?
> > Something like the following in .procmailrc will copy al incoming
> > messages to the "backup" mail folder :
> > :0 c:
> > backup

>
> Thanks.
>
> I was thinking that I wanted a more central option, something that
> wouldn't require setting up for each user, so I ruled out procmail.
> But I guess I could put the .procmailrc in the skel directory so it
> would be set up automatically for each user.
>
> Dan


You could also consider running something like unison against the mail
folders in /var/mail. We did this before when we ran uw imapd as a
mail server and stored the inbox folders on a backup system. You could
setup unison centrally and not against each user and have it back up to
either a archive location or have it backup to a remote server.

Unison gets down to a content level and keeps pretty detailed records
on what it does and how it does it. We implemented it for about 20
users of our mail server at one point.

Moving to maildir makes things decidedly simpler since you can then
just do an rsync backup if you desire and use either the --delete flag
or not and keep a mail backup/archive location with everything.

I've also done this in postfix before using some setting in
/etc/aliases or somewhere and with a central procmailrc file in /etc.


--
Michael Perry | Do or do not. There is no try --Master Yoda
(E-Mail Removed) | http://www.lnxpowered.org
 
Reply With Quote
 
Dan N
Guest
Posts: n/a

 
      11-29-2005, 04:43 AM
On Tue, 29 Nov 2005 05:16:19 +0000, Michael Perry wrote:

> I've also done this in postfix before using some setting in /etc/aliases
> or somewhere and with a central procmailrc file in /etc.


Thanks.

I set up a central procmailrc file, simply saves the incoming mail into a
file for each user in a directory /var/mail/backup. And I also set up
logrotate to compress each backup file after a week. Turned out to be a
fairly easy to implement solution.

Dan

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Mail relay program that TRASHES ALL INCOMING MAIL? [for what purpose?] Andrzej Adam Filip Linux Networking 3 05-08-2010 09:03 PM
Exchange DNS (and possibly mail server) backup Coop DNS Broadband 3 03-21-2005 08:31 AM
Full daily backup with MS backup on W2k3 Herm Windows Networking 4 12-21-2004 01:45 PM
mail command | view local machine mail with Mozilla @(none) Linux Networking 1 10-17-2004 10:42 AM
Mail Backup Dan Linux Networking 2 07-03-2004 08:32 PM



1 2 3 4 5 6 7 8 9 10 11