By default, the SMTP server is configured in the way that it is only possible to send mail from localhost, so the server may be put onto a public IP address and nobody will be able to send their mail through it (spam). So ISPadmin does not send mail out (only locally).
Mail server configuration is done in /etc/postfix/main.cf:
nano /etc/postfix/main.cf
mydestination = domains to be accepted by your server
relayhost = superior SMTP server
mynetworks = networks accepted by postfix for receiving emails without authentication for further processing (relay, local, etc.).
Postfix service must be restarted every time you modify configuration file:
/etc/init.d/postfix restart
Configuration of mail sending via superior mail server
To set up mail via external SMTP server, you have to enter IP address of this server to Postfix SMTP service configuration in ISPadmin. Authentication is not possible in Postfix so you have to enable ISPadmin for sending mail without authentication to superior SMTP server.
Edit relayhost in /etc/postfix/main.cf configuration file of Postfix server:
relayhost = SMTP_SERVER # IP address of superior mail server
Now restart the service:
/etc/init.d/postfix restart
From now on, all emails from ISPadmin will be forwarded to the Internet via superior SMTP server.
Problems with sending emails
First of all, test if target mail server answers where it should by telnet command. In other words, if the service is available. It may happen that server becomes unavailable due to firewall congestion, domain names collision etc.
These are the most common reasons for problems with sending/receiving emails.
telnet mail_server 25
admin.ispadmin.cz:~# telnet demo.ispadmin.eu 25
Trying 95.173.193.36...
Connected to demo.ispadmin.eu.
Trying 81.2.194.128...
telnet: Unable to connect to remote host: Connection timed out
So if SMTP server is available then check mail server log. Based on it, you can identify a specific problem, and rectify it. You can display Postfix service log, or mail queue with the following commands:
This listing will show you that record A on DNS server is wrong or not configured - Host or domain name not found.
tail /var/log/mail.log
admin.ispadmin.cz:~# tail /var/log/mail.log
Apr 1 11:18:01 admin postfix/pickup[11262]: 3AF4961C850: uid=0 from=
Apr 1 11:18:01 admin postfix/cleanup[12439]: 3AF4961C850: message-id=<This email address is being protected from spambots. You need JavaScript enabled to view it.>
Apr 1 11:18:01 admin postfix/qmgr[2225]: 3AF4961C850: from=<This email address is being protected from spambots. You need JavaScript enabled to view it.>, size=610, nrcpt=1 (queue active)
Apr 1 11:18:01 admin postfix/smtp[12441]: 3AF4961C850: to=<This email address is being protected from spambots. You need JavaScript enabled to view it.>, orig_to=, relay=none, delay=0.01,
delays=0.01/0/0/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=admin.ispadmin.cz type=A: Host not
found)
Apr 1 11:18:01 admin postfix/cleanup[12439]: 3C4D961C858: message-id=<This email address is being protected from spambots. You need JavaScript enabled to view it.>
Apr 1 11:18:01 admin postfix/bounce[11699]: 3AF4961C850: sender non-delivery notification: 3C4D961C858
Apr 1 11:18:01 admin postfix/qmgr[2225]: 3C4D961C858: from=<>, size=2552, nrcpt=1 (queue active)
Apr 1 11:18:01 admin postfix/qmgr[2225]: 3AF4961C850: removed
Apr 1 11:18:01 admin postfix/smtp[12441]: 3C4D961C858: to=<This email address is being protected from spambots. You need JavaScript enabled to view it.>, relay=none, delay=0.01, delays=0.01/0/0/0, dsn=5.4.4,
status=bounced (Host or domain name not found. Name service error for name=admin.ispadmin.cz type=A: Host not found)
Apr 1 11:18:01 admin postfix/qmgr[2225]: 3C4D961C858: removed
Check the queue with
mailq
Mail queue is empty
or with
postqueue -p
Mail queue is empty
You delete the queue with
postsuper -d ALL
Domain name translation not working
If domain name translation does not work, neither sending mail can work. If you find the following record in mail server log you will have to configure domain name translation correctly:
tail -f /var/log/mail.log
delays=29/0.26/0/0.06, dsn=4.4.3, status=deferred (delivery temporarily suspended:
Host or domain name not found. Name service error for name=admin.ispadmin.cz type=MX: Host not found, try again)
You can check correct DNS translation with the following command. If DNS server does not respond to the query, yet IP does, the problem is here.
Trying 81.2.194.128...
nano /etc/resolv.conf
nameserver 8.8.8.8
nameserver IP_DNS_of_used_server
And then restart service:
/etc/init.d/bind9 restart
Missing reverse DNS record of PTR
Not only does DNS system support mechanism for translation of domain names to IP addresses but also for translation of IP addresses to domain names. Nowadays, this is primarily used for delivering of e-mail, when mail server, which receives a message from the client, firstly translates client IP address to a name (thus it can find out at least approximately who might that be) and then it will translate the acquired name back to IP address. If the real and acquired IP address does not correspond, it can consider the mail source untrustworthy and refuse it.
PTR records are important namely in the mail area, because some mail server presume and demand setting of PTR record. If PTR record is not set, the mail can be refused, classified as spam, or the score of tools of spam-assassin type will increase.
You usually set PTR records at your ISP, which either delegates you specific DNS branch to your own DNS server or which sets you PTR records on its own server.
Missing MX record
For correct mail forwarding it is necessary to have correct MX records on your mail server, otherwise the mail does not have to be delivered to you.
How to find missing MX record:
> set q=mx
> net-service.cz
net-service.cz MX preference = 10, mail exchanger = sentinel.net-service.cz
If the reverse record does not work “Unauthorised response” notification is displayed.
Incorrect setting of ISPadmin
If no emails go out from your network and you are sure the settings of a superior server is correct, check the following ID in Settings System Settings General:
- smtp_restriction - SMTP port 25 blocking ISPadmin supports blocking outgoing mail via SMTP protocol on port 25 globally for your entire network. This setting is suitable to use as a defence against spam sending from infected client computers, when there is a thread of your inclusion to worldwide blacklists, superior provider can even disconnect you.
- smtp_trust_servers - Allowed SMTP servers in network. Add trustworthy SMTP servers to the list of authorized servers. These servers will not be restricted when sending mail. You should see your main mail server as the first record. Other addresses usually are company mail servers of your clients.
POP before SMTP
Configuration of POSTFIX, which in ISPadmin and LK serves as SMTP server, does not require verification. For access control, however, a method "pop before smtp" is used.
So to make a client capable of sending mail correctly, he has to first log into pop3 account (this way mail clients such as MS Outlook and etc. behave). Otherwise smtp server takes over only post from localhost, that is why even on a public address there is no problem with spam. In configuration file, it is also possible to set, for which sub-networks smtp will not be verified, so that your clients can use it as smtp server without verification. Otherwise it is possible to set in the mail server configuration a superior smtp server, through which all emails created in ISPadmin will be sent.