Hi.
We are trying to create mail server on a seperate server for our domain.
Currently domain.com is pointed to our webhoster where the website is located. We would like to have the MAIL (only mail) pointed to an OVH VPS Server running webmin/virtualmin/postfix.
We have created an A record pointing mx.domain.com and mail.domain.com to the OVH VPS IP (and also set the MX record of domain.com to point to mx.domain.com).
Have tried to add domain.com, mx.domain.com, and mail.domain.com as virtual server through virtualmin panel - and added a couple of email user accounts, but doesn’t seem to work. Always get Relay access denied or ‘looping back to myself’ - depending on the settings I adjust in postfix’s main.cf.
(PS! Pointing the entire domain.com to OVH VPS IP, creating virtual server and then creating mail accounts works just fine!)
Here is the Postfix main.cf:
See /usr/share/postfix/main.cf.dist for a commented, more complete version
Debian specific: Specifying a file name will cause the first
line of that file to be used as the name. The Debian default
is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
appending .domain is the MUA’s job.
append_dot_mydomain = no
Uncomment the next line to generate “delayed mail” warnings
#delay_warning_time = 4h
readme_directory = no
TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
information on enabling SSL in the smtp client.
myhostname = vps14414141.ovh.net
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = vps14414141.ovh.net, localhost.ovh.net, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
virtual_alias_maps = hash:/etc/postfix/virtual
virtual_mailbox_maps = hash:/etc/postfix/virtual_mailbox_maps
sender_bcc_maps = hash:/etc/postfix/bcc
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
home_mailbox = Maildir/
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
allow_percent_hack = no
message_size_limit = 25000000
smtpd_sasl_authenticated_header = yes
Any help is appreciated. Thanks!