Hi,
Would appreciate if someone might be able to assist me. I have virtualmin setup for just website hosting for our clients. We have DNS and mail hosted elsewhere. I do not have the mail feature enabled for virtual servers as I only want to relay them. Usernames are just a standard format of “user”.
OS: Ubuntu 18.04
Virtualmin: 6.09
Webmin: 1.942
Postfix: 3.3.0
I have postfix setup on this Virtualmin webserver to relay email to another postfix server via sasl authentication and this works fine.
However, I need to fine tune the from address in the emails being sent via the virtualmin websites.
Emails are being sent as the hostname.FQDN. mail.log is showing it as
from=username@servername.serverdomain.com
What I would like it to do it send as
from=username@customersdomain.com.
I thought the (Rewrite “user” to “user@$mydomain”) would be converting it but doesn’t appear to be.
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
compatibility_level = 2
empty_address_recipient = - MAILER-DAEMON
home_mailbox = Maildir/
inet_interfaces = all
inet_protocols = all
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
mailbox_size_limit = 0
mydestination = $myhostname, webserver01, localhost.localdomain, localhost, webserver01.contoso.com
myhostname = webserver01.contoso.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
readme_directory = no
recipient_delimiter = +
relayhost = relayserver.contoso.com:587
sender_bcc_maps = hash:/etc/postfix/bcc
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/relay-passwd
smtp_sasl_security_options =
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
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_alias_maps = hash:/etc/postfix/virtual