How to setup SMTP server to allow mailing to any recipient? [closed]

I have a windows server, acting as a web server and mail server.
For the mailserver I use hmailserver and works fine recieving emails but not so good sending emails because I cannot setup reverse DNS on that machine.

So, I purchased an Ubuntu linux VPS, configured reverse DNS and installed postfix.

Now, in the nwindows machine, in hMailserver there is an option to specify the Host name and port of the SMTP relayer (the linux box). I did this, but now what else should I configure in postfix to allow sending email to/from any recipient?

EDIT 1: I can telnet the SMTP server but I can not go after the rcpt to command. Here is the output:

220 ESMTP Postfix (Ubuntu)
250-SIZE 10240000
250 DSN
mail from:<>
250 2.1.0 Ok
rcpt to:<>
451 4.3.0 <>: Temporary lookup failure

And in mail.log I see:

Jul 30 17:23:20 mailgate postfix/smtpd[1824]: warning: non-existent:/32 is unavailable. openfile /32: no such file or directory

Jul 30 17:23:20 mailgate postfix/smtpd[1824]: warning: table lookup problem


I finally managed to make it work. I had to make some changes to the postfix configuration file located at /etc/postfix/

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/

Change like this (relace yourdomain with your domain name and yourServerIpAddress with your server ip address):

# See /usr/share/postfix/ 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_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 =
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = $mydomain
mydestination = $myhostname, localhost, $mydomain
relayhost =
mynetworks =, yourServerIpAddress(also setup reverse DNS for it pointing to
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
mydomain =
relay_domains = $mydestination
home_mailbox = Maildir/
local_recipient_maps =
message_size_limit = 20480000

Finally restart postfix

service postfix restart

Now, test your mailserver from:
(everything should be green)

For troubleshooting you can examine postfix log file

cat /var/log/mail.log

Good luck!

Source : Link , Question Author : Yiannis Mpourkelis , Answer Author : Yiannis Mpourkelis

Leave a Comment