Hi everyone,
I'm not sure if this is the right place to ask, but I will give it a try (maybe some postfix admins read it).
I'm in the process of configuring a postfix server from scratch, and I have an issue when injecting mails locally from cli.
The real domainname is replaced by mydomain.com
When I try to do this (logged in as username cosmin):
echo "Test" | mail -s Test
someone@gmail.com
postfix says:
postfix/qmgr[10274]: 4FAE7B407D4: from=<cosmin@srv.mydomain.com>
And of course the email is delivered as coming from
cosmin@srv.mydomain.com instead of
cosmin@mydomain.com
This is not what I want, i want that for local users who inject emails from cli, the FROM part to be build adding $mydomain instead of $myhostname.
From reading postfix docs, I assumed that this will be the right config for that (definition of myorigin: The domain name that locally-posted mail appears to come from, and that locally posted mail is delivered to):
myorigin = $mydomain
mydomain = mydomain.com
But it does not work like I expected. So my question is: does anyone know what needs to be change so that when i send mail from cli on the postfix server, the domain is automatically appended to the user?
OS/server config:
Ubuntu 14.04, postfix 2.11 (everything installed from repositories with apt-get).
Below the full postconf -n:
cosmin@srv:/etc/postfix$ postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
inet_protocols = ipv4
mailbox_size_limit = 0
mydestination = $mydomain, srv.mydomain.com, srv, localhost.localdomain, localhost
mydomain = mydomain.com
myhostname = srv.mydomain.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = $mydomain
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname Email server - every action is logged
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_gid_maps = static:3000
virtual_mailbox_base = /home/cosmin/MAIL
virtual_mailbox_domains = alexinfo.ro
virtual_mailbox_maps = mysql:/etc/postfix/vmboxmaps.sql.cf
virtual_uid_maps = mysql:/etc/postfix/vuidmaps.sql.cf
Update:
I even tried with: "append_dot_mydomain = yes" but no success.