Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

When using combination of Postfix/Dovecot, is there a way to tell smtp server (Postfix) not to store mails on disk but hold/add them to queue until "maintenance finished"?

Useful for disk upgrades, volume extensions, chkdisk etc.

share|improve this question
add comment

2 Answers

I don't believe so; the incoming queue is on disk. Perhaps you could temporarily move the queue to a ramdisk mount?

mkdir /mnt/pframqueue
mount -t tmpfs -o size=512M tmpfs /mnt/pframqueue
service postfix stop
mv /var/spool/postfix/* /mnt/pframqueue/
<<<adjust 'queue_directory' in main.cf to /mnt/pframqueue>>>
service postfix start

Do the opposite once you're done.

IMHO that's more trouble than it's worth, especially if something goes screwy in the mv

share|improve this answer
add comment

Just shut down postfix. Any legit sending server will queue your mail and retry after a time delay if it is not able to contact your server. As long as your maintenance is short, say under 6 hours, your chances of losing mail are very small.

share|improve this answer
1  
This could be a good answer but then what to do with internal users who connect to the smtp for outgoing mail? –  Alex Dec 21 '12 at 5:54
    
@Alex During maintenance? –  Michael Hampton Dec 21 '12 at 18:20
1  
@Alex - I agree with Michael here. If you only have a single server, you're clearly not in a high-availability environment to start with, so just take things down during a published maintenance period. This is fairly standard practice, and is typically well-received by users as long as you communicate with them about it. –  EEAA Dec 21 '12 at 19:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.