×

Warning

JUser: :_load: Unable to load user with ID: 43

Postfix mail server

 


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

 

myhostname = identification name of your server for public identification - it should be identical to reverse DNS
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

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.

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

 

Console listings in case of server availability:

admin.ispadmin.cz:~# telnet demo.ispadmin.eu 25
Trying 95.173.193.36...
Connected to demo.ispadmin.eu.


Console listings in case of server unavailability: it is likely that some firewall on the route blocks port 25 used for mail.
 
admin.ispadmin.cz:~# telnet mail.test.cz 25
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

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

 

Mar 4 10:25:46 admin postfix/error[19238]: A10D08A487A: to=<This email address is being protected from spambots. You need JavaScript enabled to view it.>, orig_to=, relay=none, delay=30,
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.

 

telnet mail.test.cz 25
Trying 81.2.194.128...
 
Modify configuration file:

nano /etc/resolv.conf
 
options single-request
nameserver 8.8.8.8
nameserver IP_DNS_of_used_server

And then restart service:

/etc/init.d/bind9 restart

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.

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:

 

# nslookup
> 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.

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.

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.

Mikrotik guide

This document approximates crucial information necessary for proper understan...

Removing records from ISPadmin

Delete client Deleted client is not deleted from the system, instead its rec...

Download burst

http://wiki.mikrotik.com/wiki/Manual:Queues_-_Burst (http://wiki.mikrotik....

Binary backups of MikroTik routers not working

The most common error messages regarding binary backups are: Mikrotik E...

Add / Edit Router

HardwareRoutersAll, + Add new router or Edit in the details box of a particul...

Limited data consumed / Traffic graphs are high

If you experience one/both of the following problems Limited data gets consum...

Router connection test

Hardware Routers All Click on Update all routers (test connection to all router...

Router monitoring

If router is monitored, the system does not copy any configurations, it barely p...

Service activation on MikroTik routers

An active communication between router and ISPadmin is a prerequisite for its...

Installation Modems

There are two different ways of adding cable TV clients to the system: A new ...

User rights to access MikroTik router

Also, to ensure correct communication between a router and ISPadmin you have ...

Can the system monitor latency and packet loss rate for each device?

Yes, all devices (including client devices, if you want) are monitored and gr...

How to set up a UBNT router

1. Define the IP address range for clients on the router where shaping is don...

Under what conditions does the WiFi Clients at AP section appear in the overview of routers?

Set up a particular device as an access point and specify where shaping is ...

Supported routers and interfaces

Router SNMP SSH API IPv6 Wlan MAC filter Firewall MAC filter Firewa...

Creating ACCESS LIST

In a situation where the router Mikrotik is only an AP without any routed networ...

Retrieving routing table from MikroTik routers

If there are more than 1,000 rows in the routing table on a Mikrotik router, ...

How to mass delete clients' MAC addresses

You can see the following icon - MAC FILTER - in the header of a router with the...

«
»

CONTACT

NET service solution, s.r.o.
Žerotínova 3056/81a
787 01 Šumperk
Czech Republic