I'd like to share some configuration which works in my use case (deliver all mails to my local mailbox regardless of recipent entered).
Running Ubuntu 14.04, postfix version 2.11.0
Add the following lines to
sender_canonical_maps = regexp:/etc/postfix/sender_canonical
recipient_canonical_maps = regexp:/etc/postfix/recipient_canonical
transport_maps = hash:/etc/postfix/transport
/etc/postfix/transport with content
* : yoshi
sudo postmap /etc/postfix/transport
sudo postmap /etc/postfix/recipient_canonical
sudo postmap /etc/postfix/sender_canonical
sudo service postfix restart
Now if I run for example the following script:
mail("firstname.lastname@example.org", "PseudoFaullt to local Inbox", "This is a manual scam mail, please steal money from yourself.\nThank you for the cooperation");
I receive it with a rewritten recipent in my local inbox. Actually I'm not sure if you need the sender and transport configuration but I had the impression it wasn't working without. So you might want to give it a shot to shorten the process.
Watch out the
*_maps* directives in
/etc/postfix/main.cf are prefixed with
regexp: rather than
So for your single exception maybe a witty regular expression will do the job.
Very detailed answer about setting up postfix, local inboxes and how to access them with Thunderbird: