I finally managed to make it work. I had to make some changes to the postfix configuration file located at /etc/postfix/main.cf
Here is the complete working configuration file and install steps that allows hMailServer use postfix at another machine as an SMTP relayer:
I used the minimal version of Ubuntu server 14.04. It runs fine on 2GB hard disk, 64MB RAM OpenVZ.
apt-get update
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT
iptables -A INPUT -m state --state NEW -m udp -p udp --dport 25 -j ACCEPT
apt-get install postfix
--> mail configuration: 2 (Internet Site )
--> System mail name: do not enter anything
vi /etc/postfix/main.cf
Change main.cf like this (relace yourdomain with your domain name and yourServerIpAddress with your server ip address):
# 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 = mailgate.yourdomain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = $mydomain
mydestination = $myhostname, localhost, $mydomain
relayhost =
mynetworks = 127.0.0.0/8, yourServerIpAddress(also setup reverse DNS for it pointing to mailgate.yourdomain.com)
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
mydomain = yourdomain.com
relay_domains = $mydestination
home_mailbox = Maildir/
local_recipient_maps =
message_size_limit = 20480000
Finally restart postfix
service postfix restart
Now, test your mailserver from: http://mxtoolbox.com/diagnostic.aspx
(everything should be green)
For troubleshooting you can examine postfix log file
cat /var/log/mail.log
Good luck!
1.
There's no reason you can't just use the Windows server. There's no need to add more parts than are necessary.2.
The rDNS record needs to be set up by the entity that manages the ip address space for the public ip address that the server will be sending email from, and as such, has nothing to do with the OS of the email server.