Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

qmail/vpopmail backup suggestions

Status
Not open for further replies.

slylos

Programmer
Feb 17, 2005
81
US
I've got qmail/vpopmail running at work (I just deployed it!! brand new installation!!) But of course I'm concerned with backups (I'm more than concerend, I'm scared! I'm still slightly above a newb at qmail). What is a good backup scheme for these programs? FYI I'm running SuSE 9.1 as the OS of choice . . .
Also, I'm running a Win2k server as our Smtp server, and it requires authentication prior to relay allowance (it also uses an alternate port). I did that cuz I couldn't figure out how to use roaming users in vpopmail, and I couldn't figure out another way to allow Smtp relay in qmail, without having to list ever domain in rcpthosts . . . just thought I'd mention it as a conversation starter if nobody replys to my backup question haha
 
OK, congratulations and wow!

First, SMTP-AUTH works very well with VPOPMAIL. I urge you to NOT run open relays or gimiked solutions on other ports. You will be found and abused where possible. Try again!

Take a strong look at this guide:
And review the "vpopmail roaming users" section.


As for backup, I have an approach of using rsync to synchronize the /home/vpopmail/domains folder every few hours. The rsync commands I use will copy new messages to the backup destination and will also delete removed files/folders. Thus my restore strategy is to simply apply-back the specific user/domain folder to the latest backup I have. No tapes, no versions, no bull$hit. That may or may not fit with your obligations for retention periods or legal compliance. Be sure to be very clear with your users what your available file retention approach/policy is BEFORE you need to use it. Otherwise they'll piss and moan about not having something in your backup that they deleted a week ago and "would you please recover it?".

D.E.R. Management - IT Project Management Consulting
 
Thanks for the input thedaver - however I do NOT have an Open relay. Every user that relay's through our SMTP server is forced to authenticate before relay is allowed (using a username and strong password that relates to an account on the Win2k server)

So not only am I on an alternate port, I force user authentication.

As for the backup, I will look into rsync.
 
The other problem is users are accustomed to being able to open their email client and shoot off an email without worrying about anything. Thats where 'POP before SMTP' can become a nuisance. I love qmail, I just wish it was a little easier to configure SMTP relay . . . but I know its not qmail's fault . . . I'm just melancholy because I feel a little defeated by my solution lol
 
thedaver,

This is interesting. Could you post your rsync script here?
 
My scripting may suck, but this works for me... Remember, I use vpopmail from /home/vpopmail

Code:
#!/bin/sh
cd /var/backup/mailserver.hostname

WORKLOG="/var/log/backup.work.log"
ERRLOG="/var/log/backup.err.log"

echo $0 >> $WORKLOG
date 1>> $WORKLOG
echo $0 >> $ERRLOG
date 1>> $ERRLOG
rsync -Rtav --rsh=ssh --delete root@mailserver.hostname:/home/vpopmail .  1>>$WORKLOG 2>>$ERRLOG

echo $0 >> $WORKLOG
date 1>> $WORKLOG
echo $0 >> $ERRLOG
date 1>> $ERRLOG
rsync -Rtav --rsh=ssh --delete root@mailserver.hostname:/var/qmail/control .  1>>$WORKLOG 2>>$ERRLOG

echo $0 >> $WORKLOG
date 1>> $WORKLOG
echo $0 >> $ERRLOG
date 1>> $ERRLOG
rsync -Rtav --rsh=ssh --delete root@mailserver.hostname:/var/qmail/supervise .  1>>$WORKLOG 2>>$ERRLOG

echo $0 >> $WORKLOG
date 1>> $WORKLOG
echo $0 >> $ERRLOG
date 1>> $ERRLOG
rsync -Rtav --rsh=ssh --delete root@mailserver.hostname:/var/qmail/alias .  1>>$WORKLOG 2>>$ERRLOG
The "echo $0" statements help me keep track of lots of other rsync shell scripts I run that log into the same file, you can omit them if you only run the one script.

What you'll also abviously note is that I am using SSH public key encryption for the root user. This is about the safest way to run with no password for the SSH login, but you really need to be careful about implementing it so as not to compromise your own box by leaving the key lying around... DUH.

Hope this helps somebody.

REMEMBER!!! The rsync params I use are DELETING folders/files on the backup/destination that no longer appear on the source. Think carefully about your application of the rsync options before you proceed.




D.E.R. Management - IT Project Management Consulting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top