1 (edited by brijq91 2017-09-11 18:20:26)

Topic: Able to send mail but fail to receive mails

==== Required information ====
- iRedMail version (check /etc/iredmail-release):
- Linux/BSD distribution name and version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro?
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

- iRedMail version (check /etc/iredmail-release): 0.9.7
- Linux/BSD distribution name and version: Debian 9
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MariaDB
- Web server (Apache or Nginx):Nginx

Logs:

Sep 11 03:30:25 mail postfix/10025/smtpd[4781]: connect from mail.mydomain.com.sg[127.0.0.1]
Sep 11 03:30:25 mail postfix/10025/smtpd[4781]: 207B73F2B7: client=mail.mydomain.com.sg[127.0.0.1]
Sep 11 03:30:25 mail postfix/cleanup[4771]: 207B73F2B7: message-id=<20170911033002.4D6153F2B0@mail.mydomain.com.sg>
Sep 11 03:30:25 mail postfix/10025/smtpd[4781]: disconnect from mail.mydomain.com.sg[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
Sep 11 03:30:25 mail postfix/qmgr[4660]: 207B73F2B7: from=<root@mail.mydomain.com.sg>, size=1719, nrcpt=1 (queue active)
Sep 11 03:30:25 mail postfix/cleanup[4771]: 292CD3F2B9: message-id=<20170911033002.4D6153F2B0@mail.mydomain.com.sg>
Sep 11 03:30:25 mail amavis[4469]: (04469-01) Passed CLEAN {RelayedInbound}, [127.0.0.1] <root@mail.mydomain.com.sg> -> <root@mail.mydomain.com.sg>, Message-ID: <20170911033002.4D6153F2B0@mail.mydomain.com.sg>, mail_id: 9K-GZOQrIFRi, Hits: 0.001, size: 1221, queued_as: 207B73F2B7, 22778 ms, Tests: [NO_RELAYS=-0.001,TVD_SPACE_RATIO=0.001,URIBL_BLOCKED=0.001]
Sep 11 03:30:25 mail postfix/qmgr[4660]: 292CD3F2B9: from=<root@mail.mydomain.com.sg>, size=1858, nrcpt=1 (queue active)
Sep 11 03:30:25 mail postfix/local[4784]: 207B73F2B7: to=<root@mail.mydomain.com.sg>, relay=local, delay=0.05, delays=0.02/0.02/0/0.01, dsn=2.0.0, status=sent (forwarded as 292CD3F2B9)
Sep 11 03:30:25 mail postfix/qmgr[4660]: 207B73F2B7: removed
Sep 11 03:30:25 mail postfix/amavis/smtp[4776]: 4D6153F2B0: to=<root@mail.mydomain.com.sg>, relay=127.0.0.1[127.0.0.1]:10024, delay=23, delays=0.09/0.03/0.01/23, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 207B73F2B7)
Sep 11 03:30:25 mail postfix/qmgr[4660]: 4D6153F2B0: removed
Sep 11 03:30:25 mail postfix/pipe[4788]: 292CD3F2B9: to=<postmaster@mydomain.com.sg>, relay=dovecot, delay=0.14, delays=0.01/0.02/0/0.11, dsn=2.0.0, status=sent (delivered via dovecot service)
Sep 11 03:30:25 mail postfix/qmgr[4660]: 292CD3F2B9: removed


There is no sign of any logs in terms of receiving.





The following are my summary for ip-tables:

Chain INPUT (policy DROP 16 packets, 640 bytes)
pkts bytes target     prot opt in     out     source               destination         
31221 4048K f2b-roundcube  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            multiport dports 80,443,25,587,110,995,143,993,4190
31221 4048K f2b-postfix  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            multiport dports 80,443,25,587,110,995,143,993,4190
31221 4048K f2b-dovecot  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            multiport dports 80,443,25,587,110,995,143,993,4190
31221 4048K f2b-postfix  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            multiport dports 80,443,25,587,110,995,143,993,4190
31221 4048K f2b-nginx  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            multiport dports 80,443,25,587,110,995,143,993,4190
3362  256K f2b-sshd-ddos  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            multiport dports 22
3362  256K f2b-sshd   tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            multiport dports 22
150K  177M ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED
  965 57900 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0           
    6   314 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0            icmptype 8
   63  3376 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:22
    7   324 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:80
2780  178K ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:443
  265 12720 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:25
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:587
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:110
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:995
    3   120 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:143
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:993

Chain FORWARD (policy DROP 0 packets, 0 bytes)
pkts bytes target     prot opt in     out     source               destination         

Chain OUTPUT (policy ACCEPT 1095 packets, 393K bytes)
pkts bytes target     prot opt in     out     source               destination         

Chain f2b-dovecot (1 references)
pkts bytes target     prot opt in     out     source               destination         
31221 4048K RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain f2b-nginx (1 references)
pkts bytes target     prot opt in     out     source               destination         
31221 4048K RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain f2b-postfix (2 references)
pkts bytes target     prot opt in     out     source               destination         
62442 8096K RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0           
    0     0 RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain f2b-roundcube (1 references)
pkts bytes target     prot opt in     out     source               destination         
31221 4048K RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain f2b-sshd (1 references)
pkts bytes target     prot opt in     out     source               destination         
   19  1696 REJECT     all  --  *      *       218.87.109.150       0.0.0.0/0            reject-with icmp-port-unreachable
3305  252K RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain f2b-sshd-ddos (1 references)
pkts bytes target     prot opt in     out     source               destination         
3362  256K RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0     

Not sure if I did miss out any port issues or something.

Please help. Thank you so much

2 (edited by RikuS 2017-09-11 19:01:07)

Re: Able to send mail but fail to receive mails

Try this from your computer, not the server, and change host name to your real mail server:

telnet your.mailserver.com 25

3

Re: Able to send mail but fail to receive mails

Thank you Rikus

this is my logs as below:


sudo telnet mail.myrealmailserver.com.sg 25
Trying 172.104.183.33...
Connected to mail.myrealmailserver.com.sg.
Escape character is '^]'.
220-mail.myrealmailserver.com.sg ESMTP Postfix
220 mail.myrealmailserver.com.sg ESMTP Postfix

4 (edited by RikuS 2017-09-11 22:59:44)

Re: Able to send mail but fail to receive mails

Great, the port is open. Based on your ip, your DNS settings are a mess and MX is missing completely, so sending servers can't reach your mail server.

Carefully read the documentation and set up your DNS correctly:
http://www.iredmail.org/docs/setup.dns.html

5 (edited by brijq91 2017-09-11 23:39:08)

Re: Able to send mail but fail to receive mails

Thank You Rikus

I have been suspecting that but really have no idea where did I gone wrong:


MX Records
Mail Server    Preference    Subdomain    TTL    Options
mail.mydomain.com.sg    10        Default    Edit | Remove
Add a new MX record

A/AAAA Records
Hostname    IP Address    TTL    Options
mydomain.com.sg    000.000.000.00    Default    Edit | Remove

however my actual my domain.com.sg is running on another server which is my main website.

Anywhere did I gone wrong?

6

Re: Able to send mail but fail to receive mails

Looks like you changed them and they seem to be mostly correct now. Your main domain domain.com has MX record that points to mail.domain.com, which has an A record that points to IP that is your mail server. Your DKIM and SPF are failing and also your server has a self signed certificate.

Emails should go through the DNS now or after the changes has been made to your ISP (might take a while), and if everything's fine on the server, then you should have them on inbox. If greylisting is on, it takes a while for the first emails to arrive. Anyway, you should fix DKIM and SPF as well.

7

Re: Able to send mail but fail to receive mails

RikuS wrote:

Looks like you changed them and they seem to be mostly correct now. Your main domain domain.com has MX record that points to mail.domain.com, which has an A record that points to IP that is your mail server. Your DKIM and SPF are failing and also your server has a self signed certificate.

Emails should go through the DNS now or after the changes has been made to your ISP (might take a while), and if everything's fine on the server, then you should have them on inbox. If greylisting is on, it takes a while for the first emails to arrive. Anyway, you should fix DKIM and SPF as well.


Ok I have noted that

Everything is working fine now the issue was that I have conflicting dns settings on various name servers with my servers hosted on different cloud providers

All dns settings are migrated to one area already and it resolve all problems.

Thank you so much for all the help