Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am using postfix as a SMTP server on a network that does not have internet connection. I would like to configure every mail client to send mail to the postfix SMTP server. When the server receive a mail, it can't deliver it because it is not connected to internet, so I want it to save the mail in a file. I will then handle this file myself to send it when possible.

Is it possible to use postfix as describe above? Could you give me some advice to acheive this?

share|improve this question
    
/var/spool/postfix/defer/ There you go. –  Shadur Nov 24 '11 at 12:08
add comment

2 Answers 2

Easiest way is to create a local email address on the SMTP server (a fake address obviously) and then configure postfix to redirect all mails to that address and discard them afterwards.

This way, you can manage that address and forward the mails as you please.

But really, this is necessary only if you want to have personal control on which mails to forward and which to discard.

If it's only a matter of connectivity, i.e. Internet goes up and down frequently but you don't need to manage which mails to forward, the postfix queue will automatically take care of that.

You can configure the queue to keep messages for a long time trying to deliver. When Internet goes up, the mails will be automatically forwarded.

share|improve this answer
add comment

depending on what you actually plan to do with the emails, you may want to look at the Postfix smtp-sink utility.

http://www.postfix.org/smtp-sink.1.html

it will capture email trasactions and write them to file(s) on local disk, allowing the sending servers to complete their SMTP session.

share|improve this answer
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.