1 (edited by sudhanshu 2022-10-17 14:25:55)

Topic: 2 mail server on iredmail not sending mails to each other

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.60
- Linux/BSD distribution name and version:  Rocky Linux
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  Mysql
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? no

Have 2 email server setup on VirtualBox running on different local IP - connected Global for sending mail outside and receiving mail

Global Mail working - Sending to outside world and receiving
Local mail - Both Mail Server not able to send email to another mail server shows connection refused

We did telnet check below for connect
telnet mail.xxxx.com 22 --- able to connect


But still both email ired-mail-server not sending email to each other

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: 2 mail server on iredmail not sending mails to each other

What's the original error log lines in /var/log/maillog?

3 (edited by sudhanshu 2022-10-18 14:15:16)

Re: 2 mail server on iredmail not sending mails to each other

Below is the log


Oct 18 11:23:46 localhost postfix/qmgr[1452]: 4MryG90xX3z7Xp6Y: from=<xxxxx@xxx.ltd>, size=12500, nrcpt=1 (queue active)
Oct 18 11:23:46 localhost postfix/smtp[2814629]: connect to xxxxx.xxxx.com[xx.xx.xx.xx]:25: Connection refused
Oct 18 11:23:46 localhost postfix/smtp[2814629]: 4MryG90xX3z7Xp6Y: to=<sudhanshu@xxxx.com>, relay=none, delay=12905, delays=12905/0.03/0.05/0, dsn=4.4.1, status=deferred (connect to xxx.xxxxx.com[x.x.x.xx5]:25: Connection refused)
Oct 18 11:28:41 localhost clamd[863]: SelfCheck: Database status OK.
Oct 18 11:31:38 localhost postfix/postscreen[2815489]: CONNECT from [139.162.99.243]:33114 to [192.168.0.211]:25
Oct 18 11:31:38 localhost postfix/postscreen[2815489]: HANGUP after 0.27 from [139.162.99.243]:33114 in tests before SMTP handshake
Oct 18 11:31:38 localhost postfix/postscreen[2815489]: DISCONNECT [139.162.99.243]:33114
Oct 18 11:38:41 localhost clamd[863]: SelfCheck: Database status OK.

4

Re: 2 mail server on iredmail not sending mails to each other

I guess you misunderstood, the log of the refuesing mailserver would be needed

5

Re: 2 mail server on iredmail not sending mails to each other

Sending mail server log


Oct 18 13:13:45 localhost postfix/10025/smtpd[2822937]: 4Ms5TF3Xw7z7Xp6Z: client=mail.ket.ltd[127.0.0.1]
Oct 18 13:13:45 localhost postfix/cleanup[2822929]: 4Ms5TF3Xw7z7Xp6Z: message-id=<7f86410f-dd34-4772-a815-68891e945ba9@xxx.ltd>
Oct 18 13:13:45 localhost postfix/qmgr[1452]: 4Ms5TF3Xw7z7Xp6Z: from=<xxxx@xxx.ltd>, size=2715, nrcpt=1 (queue active)
Oct 18 13:13:45 localhost postfix/10025/smtpd[2822937]: disconnect from xxx.xxx.ltd[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
Oct 18 13:13:45 localhost amavis[2783256]: (2783256-02) Passed CLEAN {RelayedInternal}, ORIGINATING LOCAL [54.90.94.70]:41454 [54.90.94.70] ESMTP/ESMTP <xxxxx@xxxx.ltd> -> <suxxxxxx@xxxx.com>, (ESMTPSA://[54.90.94.70]:41454), Queue-ID: 4Ms5T82Nsyz7Xp6X, Message-ID: <7f86410f-dd34-4772-a815-68891e945ba9@xxx.ltd>, mail_id: L2MJnVuggvct, b: oAWuNOKqD, Hits: 1.527, size: 1504, queued_as: 4Ms5TF3Xw7z7Xp6Z, Subject: "Test 2 mail", From: <xxxx@xxx.ltd>, X-Mailer: Newton, helo=[127.0.0.1], Tests: [ALL_TRUSTED=-1,HTML_IMAGE_ONLY_08=1.781,HTML_MESSAGE=0.001,HTML_MIME_NO_HTML_TAG=0.635,MIME_HTML_ONLY=0.1,T_REMOTE_IMAGE=0.01], autolearn=no autolearn_force=no, autolearnscore=2.527, dkim_new=dkim:ket.ltd, 4332 ms
Oct 18 13:13:45 localhost amavis[2783256]: (2783256-02) Passed CLEAN, <xxxx@xxxx.ltd> -> <xxxxx@xxxx.com>, Hits: 1.527, tag=2, tag2=6.2, kill=6.9, queued_as: 4Ms5TF3Xw7z7Xp6Z, L/0/0/0
Oct 18 13:13:45 localhost postfix/amavis/smtp[2822934]: 4Ms5T82Nsyz7Xp6X: to=<suxxxx@xxxxx.com>, relay=127.0.0.1[127.0.0.1]:10026, delay=5.5, delays=1.2/0.01/0/4.3, 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 4Ms5TF3Xw7z7Xp6Z)
Oct 18 13:13:45 localhost postfix/qmgr[1452]: 4Ms5T82Nsyz7Xp6X: removed
Oct 18 13:13:45 localhost postfix/smtp[2822938]: connect to xxx.xxxxx.com[xx.xx.xx.xx]:25: Connection refused
Oct 18 13:13:45 localhost postfix/smtp[2822938]: 4Ms5TF3Xw7z7Xp6Z: to=<sudhanshu@lensbazaar.com>, relay=none, delay=0.08, delays=0/0.02/0.06/0, dsn=4.4.1, status=deferred (connect to xx.xxx.com[1xx.xx.xx.xx]:25: Connection refused)

6

Re: 2 mail server on iredmail not sending mails to each other

Receiving mail logs shows nothing connecting or connection refused

Only sending mail server logs produced above

7

Re: 2 mail server on iredmail not sending mails to each other

sudhanshu wrote:

Oct 18 13:13:45 localhost postfix/smtp[2822938]: connect to xxx.xxxxx.com[xx.xx.xx.xx]:25: Connection refused

Port 25 is not reachable. Do you have some firewall rule to block port 25?

8

Re: 2 mail server on iredmail not sending mails to each other

ZhangHuangbin wrote:
sudhanshu wrote:

Oct 18 13:13:45 localhost postfix/smtp[2822938]: connect to xxx.xxxxx.com[xx.xx.xx.xx]:25: Connection refused

Port 25 is not reachable. Do you have some firewall rule to block port 25?


Below ports on receiving server
[root@localhost ~]# firewall-cmd --list-ports
100/tcp 25/tcp 25/udp 587/udp 587/tcp 465/tcp 465/udp


Below ports on sending server
[root@localhost ~]# firewall-cmd --list-ports
25/tcp 100/tcp 465/tcp 587/tcp 25/udp 465/udp 587/udp



As you can see port 25 is open

9

Re: 2 mail server on iredmail not sending mails to each other

why did you try to telnet into port 22, when mail uses port 25?

both use hostname localhost, i guess you misconfigured your dns

10

Re: 2 mail server on iredmail not sending mails to each other

Cthulhu wrote:

why did you try to telnet into port 22, when mail uses port 25?

both use hostname localhost, i guess you misconfigured your dns


cat /etc/hosts results below

127.0.0.1   xxx.xxx.ltd localhost.localdomain localhost4 localhost4.localdomain4
::1         xx.xx.ltd localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.78 x.x.com
xx.x.xx.195 x.xx.com

11

Re: 2 mail server on iredmail not sending mails to each other

Wondering if this is an active forum ?

12

Re: 2 mail server on iredmail not sending mails to each other

It is active, but troubleshooting for a test environment which is not in a production state, well...

i still would asume since it is hosted locally on a virtual machine, even if you setup a hostname, there will be no PTR and the reverse hostname of sending server will be dynamic-lookalike which blocks incoming connections