Linux – Postfix: save every outgoing mail in files

linuxpostfix

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?

Best Answer

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.

Related Question