A seguinte configuração parece funcionar para o seu objetivo:
main.cf: (padrão no Ubuntu, exceto mydestination
, default_transport
e local_transport
)
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
readme_directory = no
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = vagrant-ubuntu-trusty-64
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = vagrant-ubuntu-trusty-64, localhost.localdomain, , localhost, example.org
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
default_transport=test
local_transport=test
master.cf:
test unix - n n - - pipe
user=nobody argv=/usr/local/bin/test ${sender} ${recipient}
/ usr / local / bin / test:
#!/bin/sh
logfile="/tmp/postfix_transport.log"
content='cat'
date -R >> "$logfile"
echo "$@" >> "$logfile"
O envio de um email usando sendmail -f [email protected] [email protected] [email protected] < mail
gera a seguinte mensagem em /tmp/postfix_transport.log
:
Sun, 03 May 2015 19:19:47 +0000
[email protected] [email protected] [email protected]