-
Chad Granum
OpenSourcery Alumnus
Today Jonathan asked me about configuring his system to pretend to be an email server.
The goals of this task were:
I have configured local email for development in the past, which is why Jonathan came to me with this. Immediately I decided to use postfix because it is easy to configure and use. Initially I looked at address masquerading or rewriting, but these solutions were overcomplicated and did not appear to solve all the problems.
Eventually I found a site explaining how to disable local delivery (the opposite of what we needed). The way to disable the local delivery was to comment out the 'local' configuration option in /etc/postfix/master.cf. Looking at the file it was clear that it mapped source to destination.
smtp unix - - - - - smtp relay unix - - - - - smtp local unix - n n - - local
smtp unix - - - - - local relay unix - - - - - local local unix - n n - - local
The results were exactly as desired. No email is delivered to the outside world, and all email is placed in /var/spool/postfix/active. According to Jonathan, his applications run seamlessly, completely unaware of this.
Delivery to a local mailbox
This is a very useful setup, thanks. I found that messages were formatted a bit inconveniently when sitting in the Postfix active spool. By adding a virtual alias map, I was able to get Postfix to deliver them to a local mailbox (
/var/mail/djtack, for me), where they can be read with a normal MUA (I'm using Pine currently).Forward locally delivered mail to another Postfix instance?
Hi guys,
This was extremely helpful and easy to follow. But here's my scenario. I am running a Turnkey Linux LAMP stack in a VirtualBox VM, bridged on a static IP of 192.168.1.3. I have setup postfix on the VM as above, and I can get all mail delivered to /var/mail/ignatius. Problem is I can't get to this using Thunderbird's Movemail account.
I also have postfix installed locally on my host desktop as well (hostname is ignatius-desktop). Question: How do I forward locally delivered mail on the VM to the host?
Or is there a simpler option?
Brilliant!
Thank you, worked like a charm!