1

Topic: Can't send out emails

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.4.2 PGSQL edition.
- Deployed with iRedMail Easy or the downloadable installer? via apt-get
- Linux/BSD distribution name and version:  Debian 11 x64
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): PGSQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Setup looks like working fine in general, can access mailboxes via RoundCube and via IMAP by desktop and mobile clients, and all mail clients can receive and send emails.
But sent email doesn't leave the server. Tried different destinations and none received anything (did check Spam folder).
And few days later I got this bounce in my postmaster mailbox:

-----8<-----
This is the mail system at host mx1.noXXXX.XX.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

The mail system

<amavis@mx1.noXXXX.XX> (expanded from ): connect to
127.0.0.1[127.0.0.1]:10026: Connection refused
config: created user preferences file: /var/lib/amavis/.spamassassin/user_prefs
-----8<-----

And attachment had this text file:

-----8<-----
Reporting-MTA: dns; mx1.noXXXX.XX
X-Postfix-Queue-ID: 4J6yWz0Kvfz40dt
X-Postfix-Sender: rfc822; amavis@mx1.noXXXX.XX
Arrival-Date: Mon,  6 Dec 2021 09:18:06 +0000 (UTC)

Final-Recipient: rfc822; amavis@mx1.noXXXX.XX
Original-Recipient: rfc822;amavis@mx1.noXXXX.XX
Action: failed
Status: 4.4.1
Diagnostic-Code: X-Postfix; connect to 127.0.0.1[127.0.0.1]:10026: Connection
    refused
-----8<-----

Two questions:

1. Not clear if it's related or not.

2. How do I check what's happening with the sent email and find the root cause of the issue?

Thank you.

----

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

2

Re: Can't send out emails

Can you check your amavis status with 'service amavis status'? Should show: "Active: active (running)"

# service amavis status
● amavis.service - Interface between MTA and virus scanner/content filters
     Loaded: loaded (/lib/systemd/system/amavis.service; enabled; vendor preset>
     Active: active (running) since Sat 2021-11-27 16:59:23 CET; 2 weeks 1 days>
       Docs: http://www.ijs.si/software/amavisd/#doc
    Process: 929 ExecStartPre=/usr/bin/find /var/lib/amavis -maxdepth 1 -name a>
    Process: 973 ExecStartPre=/usr/bin/find /var/lib/amavis/tmp -maxdepth 1 -na>
   Main PID: 1008 (/usr/sbin/amavi)
      Tasks: 64 (limit: 77044)
     Memory: 3.0G
        CPU: 1min 27.179s
     CGroup: /system.slice/amavis.service
             ├─1008 /usr/sbin/amavisd-new (master)
[...]

3

Re: Can't send out emails

alexindigo wrote:

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.4.2 PGSQL edition.
- Deployed with iRedMail Easy or the downloadable installer? via apt-get
- Linux/BSD distribution name and version:  Debian 11 x64
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): PGSQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Setup looks like working fine in general, can access mailboxes via RoundCube and via IMAP by desktop and mobile clients, and all mail clients can receive and send emails.
But sent email doesn't leave the server. Tried different destinations and none received anything (did check Spam folder).
And few days later I got this bounce in my postmaster mailbox:

-----8<-----
This is the mail system at host mx1.noXXXX.XX.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

The mail system

<amavis@mx1.noXXXX.XX> (expanded from ): connect to
127.0.0.1[127.0.0.1]:10026: Connection refused
config: created user preferences file: /var/lib/amavis/.spamassassin/user_prefs
-----8<-----

And attachment had this text file:

-----8<-----
Reporting-MTA: dns; mx1.noXXXX.XX
X-Postfix-Queue-ID: 4J6yWz0Kvfz40dt
X-Postfix-Sender: rfc822; amavis@mx1.noXXXX.XX
Arrival-Date: Mon,  6 Dec 2021 09:18:06 +0000 (UTC)

Final-Recipient: rfc822; amavis@mx1.noXXXX.XX
Original-Recipient: rfc822;amavis@mx1.noXXXX.XX
Action: failed
Status: 4.4.1
Diagnostic-Code: X-Postfix; connect to 127.0.0.1[127.0.0.1]:10026: Connection
    refused
-----8<-----

Two questions:

1. Not clear if it's related or not.

2. How do I check what's happening with the sent email and find the root cause of the issue?

Thank you.

Hi,

Are you changed the DKIM key?

If yes, you need the modify the next file: /etc/amavis/conf.d/50-user
With the next documentation: https://docs.iredmail.org/sign.dkim.sig … omain.html
The location of the config file is in this web: https://docs.iredmail.org/file.locations.html#amavisd

Best regards

4

Re: Can't send out emails

Thanks.

This is what I got:

```
# service amavis status
● amavis.service - Interface between MTA and virus scanner/content filters
     Loaded: loaded (/lib/systemd/system/amavis.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2021-12-14 03:18:11 UTC; 3min 44s ago
       Docs: http://www.ijs.si/software/amavisd/#doc
    Process: 822166 ExecStartPre=/usr/bin/find /var/lib/amavis -maxdepth 1 -name amavis-* -type d -exec rm -rf {} ; (code=exit>
    Process: 822167 ExecStartPre=/usr/bin/find /var/lib/amavis/tmp -maxdepth 1 -name amavis-* -type d -exec rm -rf {} ; (code=>
   Main PID: 822169 (/usr/sbin/amavi)
      Tasks: 1 (limit: 1132)
     Memory: 150.5M
        CPU: 3.326s
     CGroup: /system.slice/amavis.service
             └─822169 /usr/sbin/amavisd-new (master)

Dec 14 03:18:13 mx1.noXXXX.XX amavis[822169]: starting. /usr/sbin/amavisd-new at mx1.noXXXX.XX amavisd-new-2.11.1 (20181009), >
Dec 14 03:18:13 mx1.noXXXX.XX amavis[822169]: perl=5.032001, user=114, EUID: 114 (114);  group=, EGID: 122 122 (122 122)
Dec 14 03:18:14 mx1.noXXXX.XX amavis[822169]: Net::Server: Group Not Defined.  Defaulting to EGID '122 122'
Dec 14 03:18:14 mx1.noXXXX.XX amavis[822169]: Net::Server: User Not Defined.  Defaulting to EUID '114'
Dec 14 03:18:14 mx1.noXXXX.XX amavis[822169]: No ext program for   .F, tried: unfreeze, freeze -d, melt, fcat
Dec 14 03:18:14 mx1.noXXXX.XX amavis[822169]: No ext program for   .zoo, tried: zoo, unzoo
Dec 14 03:18:14 mx1.noXXXX.XX amavis[822169]: No decoder for       .F
Dec 14 03:18:14 mx1.noXXXX.XX amavis[822169]: No decoder for       .zoo
Dec 14 03:18:14 mx1.noXXXX.XX amavis[822169]: Using primary internal av scanner code for clamav-socket
Dec 14 03:18:14 mx1.noXXXX.XX amavis[822169]: Found secondary av scanner clamav-clamscan at /usr/bin/clamscan
```

5

Re: Can't send out emails

Thank you for the links, I'll check. But I haven't touched DKIM key.
Although I wasn't able to add DKIM to the DNS, as I have domain on hover.com and I got error that TXT value is too long. I created support ticket with them, but no response yet. Not sure if it's the reason, or there is more to it.

6

Re: Can't send out emails

Actually, that specific domain wasn't on hover.com (I'm trying multiple domains in parallel), so I was able to add DKIM record to DNS, not sure if it'd help or not.

Also, what's the best place to check what's going on with the sent email within my server?

Thank you.

7 (edited by Cthulhu 2021-12-14 13:22:52)

Re: Can't send out emails

what is the result of mailq ?

if yourself get a bounce msg from your own mailserver, something must be really wrong

also, /var/log/mail.log would help a lot in this case

8

Re: Can't send out emails

Thanks for looking into this.

This is what I have in `mailq`:

```
----Queue ID----- --Size-- ---Arrival Time---- --Sender/Recipient------
4JBTtB0RB2z40mD       1227 Sun Dec 12 03:01:06 root@mx1.noXXXX.XX
(host 127.0.0.1[127.0.0.1] said: 421 4.3.2 Service shutting down, closing channel (in reply to end of DATA command))
                                               root@mx1.noXXXX.XX

4JBZQ20G11z40lf       6844 Sun Dec 12 06:25:12 root@mx1.noXXXX.XX
                   (connect to 127.0.0.1[127.0.0.1]:10026: Connection refused)
                                               root@mx1.noXXXX.XX

4JBJNT1y43z40hX       1055 Sat Dec 11 19:53:12 postmaster@noXXXX.XX
(host 127.0.0.1[127.0.0.1] said: 421 4.3.2 Service shutting down, closing channel (in reply to end of DATA command))
                                               test-5hfxxxoti@srv1.mail-tester.com

4J9LVr1v0fz40kt       7549 Fri Dec 10 06:25:09 root@mx1.noXXXX.XX
                   (connect to 127.0.0.1[127.0.0.1]:10026: Connection refused)
                                               root@mx1.noXXXX.XX

4JCBMV2R0tz40lP       6707 Mon Dec 13 06:25:12 root@mx1.noXXXX.XX
                   (connect to 127.0.0.1[127.0.0.1]:10026: Connection refused)
                                               root@mx1.noXXXX.XX

4JC5qk4tqqz40mL       1227 Mon Dec 13 03:01:06 root@mx1.noXXXX.XX
(delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10026: Connection refused)
                                               root@mx1.noXXXX.XX

4J9swd73XDz40lg       1227 Sat Dec 11 03:01:05 root@mx1.noXXXX.XX
(delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10026: Connection refused)
                                               root@mx1.noXXXX.XX

4JCpKD2xrBz40mK       6377 Tue Dec 14 06:25:11 root@mx1.noXXXX.XX
(delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10026: Connection refused)
                                               root@mx1.noXXXX.XX

4J9ySV63gkz40lR       7537 Sat Dec 11 06:25:11 root@mx1.noXXXX.XX
(delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10026: Connection refused)
                                               root@mx1.noXXXX.XX

4JCjnG6NFgz40mb       1227 Tue Dec 14 03:01:06 root@mx1.noXXXX.XX
(delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10026: Connection refused)
                                               root@mx1.noXXXX.XX

4J9Fz63gmHz40lG       1227 Fri Dec 10 03:01:06 root@mx1.noXXXX.XX
                   (connect to 127.0.0.1[127.0.0.1]:10026: Connection refused)
                                               root@mx1.noXXXX.XX

-- 41 Kbytes in 11 Requests.

```

And in mail.log:

```
Dec 15 01:18:20 mx1 postfix/dnsblog[911888]: addr 163.123.142.200 listed by domain zen.spamhaus.org as 127.0.0.3
Dec 15 01:42:34 mx1 postfix/qmgr[7672]: 4JBJNT1y43z40hX: from=<postmaster@noXXXX.XX>, size=1055, nrcpt=1 (queue active)
Dec 15 01:42:34 mx1 amavis[910879]: (910879-01) (!)connect to /var/run/clamav/clamd.ctl failed, attempt #1: Can't connect to a UNIX socket /var/run/clamav/clamd.ctl: No such file or directory
Dec 15 01:42:35 mx1 amavis[910879]: (910879-01) (!)connect to /var/run/clamav/clamd.ctl failed, attempt #1: Can't connect to a UNIX socket /var/run/clamav/clamd.ctl: No such file or directory
Dec 15 01:42:35 mx1 amavis[910879]: (910879-01) (!)clamav-socket: All attempts (1) failed connecting to /var/run/clamav/clamd.ctl, retrying (2)
Dec 15 01:42:41 mx1 amavis[910879]: (910879-01) (!)connect to /var/run/clamav/clamd.ctl failed, attempt #1: Can't connect to a UNIX socket /var/run/clamav/clamd.ctl: No such file or directory
Dec 15 01:42:41 mx1 amavis[910879]: (910879-01) (!)clamav-socket av-scanner FAILED: run_av error: Too many retries to talk to /var/run/clamav/clamd.ctl (All attempts (1) failed connecting to /var/run/clamav/clamd.ctl) at (eval 102) line 659.\n
Dec 15 01:42:41 mx1 amavis[910879]: (910879-01) (!)WARN: all primary virus scanners failed, considering backups
Dec 15 01:43:16 mx1 amavis[910879]: (910879-01) (!)TempDir removal: tempdir is to be PRESERVED: /var/lib/amavis/tmp/amavis-20211215T014234-910879-QFIyIlIv
Dec 15 01:43:16 mx1 postfix/amavis/smtp[913236]: 4JBJNT1y43z40hX: to=<test-5hfxxxoti@srv1.mail-tester.com>, relay=127.0.0.1[127.0.0.1]:10026, delay=280203, delays=280162/0.06/0.01/41, dsn=4.3.2, status=deferred (host 127.0.0.1[127.0.0.1] said: 421 4.3.2 Service shutting down, closing channel (in reply to end of DATA command))
Dec 15 01:43:18 mx1 amavis[913285]: starting. /usr/sbin/amavisd-new at mx1.noXXXX.XX amavisd-new-2.11.1 (20181009), Unicode aware, LANG="C.UTF-8"
Dec 15 01:43:18 mx1 amavis[913285]: perl=5.032001, user=114, EUID: 114 (114);  group=, EGID: 122 122 (122 122)
Dec 15 01:43:19 mx1 amavis[913285]: Net::Server: Group Not Defined.  Defaulting to EGID '122 122'
Dec 15 01:43:19 mx1 amavis[913285]: Net::Server: User Not Defined.  Defaulting to EUID '114'
Dec 15 01:43:19 mx1 amavis[913285]: No ext program for   .F, tried: unfreeze, freeze -d, melt, fcat
Dec 15 01:43:19 mx1 amavis[913285]: No ext program for   .zoo, tried: zoo, unzoo
Dec 15 01:43:19 mx1 amavis[913285]: No decoder for       .F   
Dec 15 01:43:19 mx1 amavis[913285]: No decoder for       .zoo
Dec 15 01:43:19 mx1 amavis[913285]: Using primary internal av scanner code for clamav-socket
Dec 15 01:43:19 mx1 amavis[913285]: Found secondary av scanner clamav-clamscan at /usr/bin/clamscan
```

9 (edited by Cthulhu 2021-12-15 11:06:51)

Re: Can't send out emails

first of all, clear the mailq:

postsuper -d ALL

it seems the mailq tries to deliver the mails but is failing to do so, so it gets stuck

after that, do the following:
apt-get purge clamav
apt-get install clamav clamav-daemon

reboot the server afterwards and look if it is working again

10

Re: Can't send out emails

Thank you. Will try.

11

Re: Can't send out emails

Hmm.

```
# apt-get install clamav-daemon
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
clamav-daemon is already the newest version (0.103.3+dfsg-0+deb11u1).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
```

And shouldn't iRedMail install it automatically?

Btw, I have the same issue on another machine on Linode (this one is on DigitalOcean), with the same symptoms and `clamav-daemon` is installed there as well.

Both are Debian 11.

12

Re: Can't send out emails

Sorry, just noticed your update. Will purge.

(had to wait 60 seconds between posts) smile

13

Re: Can't send out emails

Hmm, something is wrong with my setup:

purged, installed, rebooted.

Did `tail -f` on the mail.log, and this is what I got right after I hit Send in my mail client:

```
Dec 15 03:17:56 mx1 postfix/submission/smtpd[3042]: connect from c-XX-XX-XX-XXX.hsd1.XX.comcast.net[XX.XX.XX.XXX]
Dec 15 03:17:57 mx1 postfix/submission/smtpd[3042]: Anonymous TLS connection established from c-XX-XX-XX-XXX.hsd1.XX.comcast.net[XX.XX.XX.XXX]: TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)
Dec 15 03:17:58 mx1 postfix/submission/smtpd[3042]: 4JDL6G14wcz40XC: client=c-XX-XX-XX-XXX.hsd1.XX.comcast.net[XX.XX.XX.XXX], sasl_method=PLAIN, sasl_username=postmaster@noXXXX.XX
Dec 15 03:17:58 mx1 postfix/cleanup[3060]: 4JDL6G14wcz40XC: message-id=<etPan.61b95e64.2e4cd1f7.13afe@noXXXX.XX>
Dec 15 03:17:58 mx1 postfix/qmgr[2426]: 4JDL6G14wcz40XC: from=<postmaster@noXXXX.XX>, size=1071, nrcpt=1 (queue active)
Dec 15 03:17:58 mx1 postfix/submission/smtpd[3042]: disconnect from c-XX-XX-XX-XXX.hsd1.XX.comcast.net[XX.XX.XX.XXX] ehlo=2 starttls=1 auth=1 mail=1 rcpt=1 data=1 quit=1 commands=8
Dec 15 03:17:58 mx1 amavis[769]: (00769-01) (!)connect to /var/run/clamav/clamd.ctl failed, attempt #1: Can't connect to a UNIX socket /var/run/clamav/clamd.ctl: No such file or directory
Dec 15 03:17:59 mx1 amavis[769]: (00769-01) (!)connect to /var/run/clamav/clamd.ctl failed, attempt #1: Can't connect to a UNIX socket /var/run/clamav/clamd.ctl: No such file or directory
Dec 15 03:17:59 mx1 amavis[769]: (00769-01) (!)clamav-socket: All attempts (1) failed connecting to /var/run/clamav/clamd.ctl, retrying (2)
Dec 15 03:18:05 mx1 amavis[769]: (00769-01) (!)connect to /var/run/clamav/clamd.ctl failed, attempt #1: Can't connect to a UNIX socket /var/run/clamav/clamd.ctl: No such file or directory
Dec 15 03:18:05 mx1 amavis[769]: (00769-01) (!)clamav-socket av-scanner FAILED: run_av error: Too many retries to talk to /var/run/clamav/clamd.ctl (All attempts (1) failed connecting to /var/run/clamav/clamd.ctl) at (eval 102) line 659.\n
Dec 15 03:18:05 mx1 amavis[769]: (00769-01) (!)WARN: all primary virus scanners failed, considering backups
```


And then half a minute later this:

```
Dec 15 03:18:42 mx1 amavis[769]: (00769-01) (!)TempDir removal: tempdir is to be PRESERVED: /var/lib/amavis/tmp/amavis-20211215T031758-00769-4QTIdFmA
Dec 15 03:18:42 mx1 postfix/amavis/smtp[3065]: 4JDL6G14wcz40XC: to=<XXX@XXXXXXXXXX.com>, relay=127.0.0.1[127.0.0.1]:10026, delay=44, delays=0.68/0.04/0.01/44, dsn=4.3.2, status=deferred (host 127.0.0.1[127.0.0.1] said: 421 4.3.2 Service shutting down, closing channel (in reply to end of DATA command))
Dec 15 03:18:44 mx1 amavis[3134]: starting. /usr/sbin/amavisd-new at mx1.noXXXX.XX amavisd-new-2.11.1 (20181009), Unicode aware, LANG="C.UTF-8"
Dec 15 03:18:44 mx1 amavis[3134]: perl=5.032001, user=114, EUID: 114 (114);  group=, EGID: 122 122 (122 122)
Dec 15 03:18:45 mx1 amavis[3134]: Net::Server: Group Not Defined.  Defaulting to EGID '122 122'
Dec 15 03:18:45 mx1 amavis[3134]: Net::Server: User Not Defined.  Defaulting to EUID '114'
Dec 15 03:18:45 mx1 amavis[3134]: No ext program for   .F, tried: unfreeze, freeze -d, melt, fcat
Dec 15 03:18:45 mx1 amavis[3134]: No ext program for   .zoo, tried: zoo, unzoo
Dec 15 03:18:45 mx1 amavis[3134]: No decoder for       .F   
Dec 15 03:18:45 mx1 amavis[3134]: No decoder for       .zoo
Dec 15 03:18:45 mx1 amavis[3134]: Using primary internal av scanner code for clamav-socket
Dec 15 03:18:45 mx1 amavis[3134]: Found secondary av scanner clamav-clamscan at /usr/bin/clamscan
```

And this is mailq:

```
----Queue ID----- --Size-- ---Arrival Time---- --Sender/Recipient------
4JDL6G14wcz40XC       1071 Wed Dec 15 03:17:57 postmaster@noXXXX.XX
(host 127.0.0.1[127.0.0.1] said: 421 4.3.2 Service shutting down, closing channel (in reply to end of DATA command))
                                               XXX@XXXXXXXXXX.com

-- 1 Kbytes in 1 Request.

```

Hmm...

14

Re: Can't send out emails

/etc/amavis/conf.d/50-user

@bypass_virus_checks_maps = (1);  # controls running of anti-virus code

this disables clamav

restart amavis after and try sending mail again

15

Re: Can't send out emails

That worked. Thank you.

Also, clamav is strange, same issue on the same two boxes (Do and Linode, both Debian 11), fresh iRedMail install.

clamav-daemon isn't started, when trying to start nothing happens, clamav.log is empty.

Here is service status:

```
# service clamav-daemon status
● clamav-daemon.service - Clam AntiVirus userspace daemon
     Loaded: loaded (/lib/systemd/system/clamav-daemon.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/clamav-daemon.service.d
             └─extend.conf
     Active: failed (Result: oom-kill) since Wed 2021-12-15 03:43:21 UTC; 11min ago
       Docs: man:clamd(8)
             man:clamd.conf(5)
             https://www.clamav.net/documents/
    Process: 5934 ExecStartPre=/bin/mkdir -p /run/clamav (code=exited, status=0/SUCCESS)
    Process: 5935 ExecStartPre=/bin/chown clamav /run/clamav (code=exited, status=0/SUCCESS)
    Process: 5936 ExecStart=/usr/sbin/clamd --foreground=true (code=killed, signal=KILL)
   Main PID: 5936 (code=killed, signal=KILL)
        CPU: 11.740s

Dec 15 03:42:41 mx1.noseri.jp systemd[1]: Started Clam AntiVirus userspace daemon.
Dec 15 03:42:41 mx1.noseri.jp clamd[5936]: WARNING: Ignoring deprecated option AllowSupplementaryGroups at /etc/clamav/clamd.c>
Dec 15 03:42:41 mx1.noseri.jp clamd[5936]: LibClamAV Warning: **************************************************
Dec 15 03:42:41 mx1.noseri.jp clamd[5936]: LibClamAV Warning: ***  The virus database is older than 7 days!  ***
Dec 15 03:42:41 mx1.noseri.jp clamd[5936]: LibClamAV Warning: ***   Please update it as soon as possible.    ***
Dec 15 03:42:41 mx1.noseri.jp clamd[5936]: LibClamAV Warning: **************************************************
Dec 15 03:43:20 mx1.noseri.jp systemd[1]: clamav-daemon.service: A process of this unit has been killed by the OOM killer.
Dec 15 03:43:21 mx1.noseri.jp systemd[1]: clamav-daemon.service: Main process exited, code=killed, status=9/KILL
Dec 15 03:43:21 mx1.noseri.jp systemd[1]: clamav-daemon.service: Failed with result 'oom-kill'.
Dec 15 03:43:21 mx1.noseri.jp systemd[1]: clamav-daemon.service: Consumed 11.740s CPU time.
```

On another box same thing:

```
# service clamav-daemon status
● clamav-daemon.service - Clam AntiVirus userspace daemon
     Loaded: loaded (/lib/systemd/system/clamav-daemon.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/clamav-daemon.service.d
             └─extend.conf
     Active: failed (Result: oom-kill) since Wed 2021-12-15 03:53:57 UTC; 9s ago
       Docs: man:clamd(8)
             man:clamd.conf(5)
             https://www.clamav.net/documents/
    Process: 3986 ExecStartPre=/bin/mkdir -p /run/clamav (code=exited, status=0/SUCCESS)
    Process: 3987 ExecStartPre=/bin/chown clamav /run/clamav (code=exited, status=0/SUCCESS)
    Process: 3988 ExecStart=/usr/sbin/clamd --foreground=true (code=killed, signal=KILL)
   Main PID: 3988 (code=killed, signal=KILL)
        CPU: 21.591s

Dec 15 03:53:23 mx1 systemd[1]: Starting Clam AntiVirus userspace daemon...
Dec 15 03:53:23 mx1 systemd[1]: Started Clam AntiVirus userspace daemon.
Dec 15 03:53:23 mx1 clamd[3988]: WARNING: Ignoring deprecated option AllowSupplementaryGroups at /etc/clamav/clamd>
Dec 15 03:53:57 mx1 systemd[1]: clamav-daemon.service: A process of this unit has been killed by the OOM killer.
Dec 15 03:53:57 mx1 systemd[1]: clamav-daemon.service: Main process exited, code=killed, status=9/KILL
Dec 15 03:53:57 mx1 systemd[1]: clamav-daemon.service: Failed with result 'oom-kill'.
Dec 15 03:53:57 mx1 systemd[1]: clamav-daemon.service: Consumed 21.591s CPU time.
```

16

Re: Can't send out emails

failed (Result: oom-kill)

What are the system specs? especially how much RAM ?

17

Re: Can't send out emails

Cthulhu wrote:

failed (Result: oom-kill)

What are the system specs? especially how much RAM ?

Post's attachments

Screen Shot 2021-12-14 at 10.08.41 PM.png
Screen Shot 2021-12-14 at 10.08.41 PM.png 12.83 kb, 2 downloads since 2021-12-15 

You don't have the permssions to download the attachments of this post.

18

Re: Can't send out emails

wow, ok

Also, clamav is strange -> how can you expect these specs to work? clamav ALONE needs ~1.5GB ram, not to mention all other services, 4GB are MINIMUM to keep a iredmail server alive, and that is on the very low end

19 (edited by alexindigo 2021-12-16 14:09:27)

Re: Can't send out emails

Cthulhu wrote:

wow, ok

Also, clamav is strange -> how can you expect these specs to work? clamav ALONE needs ~1.5GB ram, not to mention all other services, 4GB are MINIMUM to keep a iredmail server alive, and that is on the very low end

Woah. I assumed 4GB is for production server is some real life traffic, not just for my test setup with one test email a day.

Also this setup (https://github.com/sovereign/sovereign) has very similar "shopping list" (Dovecot, Postfix, Postgres, Roundcube, etc) and they measure memory in MB, so it kind of fueled my assumption further.

Curious what does clamav do with that 1.5GB of RAM smile

--

Thank you for all the help and following through with my issues.

PS. Do you think it would be helpful to have memory check during iRedMail install script, so it could yell at users like me, and prevent them from multi day headache?

20

Re: Can't send out emails

root@mail:~# tail /var/log/mail.log
Aug 27 17:14:05 mail postfix/postscreen[419600]: CONNECT from [94.156.177.147]:60813 to [150.95.115.15]:25
Aug 27 17:14:05 mail postfix/dnsblog[419601]: addr 94.156.177.147 listed by domain b.barracudacentral.org as 127.0.0.2
Aug 27 17:14:05 mail postfix/dnsblog[419602]: addr 94.156.177.147 listed by domain zen.spamhaus.org as 127.0.0.9
Aug 27 17:14:05 mail postfix/dnsblog[419602]: addr 94.156.177.147 listed by domain zen.spamhaus.org as 127.0.0.2
Aug 27 17:14:11 mail postfix/postscreen[419600]: DNSBL rank 5 for [94.156.177.147]:60813
Aug 27 17:14:11 mail postfix/postscreen[419600]: DISCONNECT [94.156.177.147]:60813
Aug 27 17:14:21 mail postfix/postscreen[419600]: CONNECT from [94.156.177.147]:53037 to [150.95.115.15]:25
Aug 27 17:14:21 mail postfix/dnsblog[419601]: addr 94.156.177.147 listed by domain b.barracudacentral.org as 127.0.0.2
Aug 27 17:14:21 mail postfix/dnsblog[419602]: addr 94.156.177.147 listed by domain zen.spamhaus.org as 127.0.0.9
Aug 27 17:14:21 mail postfix/dnsblog[419602]: addr 94.156.177.147 listed by domain zen.spamhaus.org as 127.0.0.2
root@mail:~# tail /var/log/mail.log
Aug 27 17:15:43 mail postfix/submission/smtpd[420341]: discarding EHLO keywords: CHUNKING
Aug 27 17:15:44 mail postfix/submission/smtpd[420341]: 4WtNjD16lfzGr6J: client=localhost[127.0.0.1], sasl_method=LOGIN, sasl_username=happy@iredmail-tc24.online
Aug 27 17:15:44 mail postfix/cleanup[420342]: 4WtNjD16lfzGr6J: message-id=<d9e7bb9c177de51d2154461525a483a1@iredmail-tc24.online>
Aug 27 17:15:44 mail postfix/qmgr[4254]: 4WtNjD16lfzGr6J: from=<happy@iredmail-tc24.online>, size=618, nrcpt=1 (queue active)
Aug 27 17:15:44 mail roundcube: <19d6psk6> User happy@iredmail-tc24.online [118.71.116.202]; Message <d9e7bb9c177de51d2154461525a483a1@iredmail-tc24.online> for tungduongtc24@gmail.com; 250: 2.0.0 Ok: queued as 4WtNjD16lfzGr6J
Aug 27 17:15:44 mail postfix/submission/smtpd[420341]: disconnect from localhost[127.0.0.1] ehlo=2 starttls=1 auth=1 mail=1 rcpt=1 data=1 quit=1 commands=8
Aug 27 17:15:44 mail postfix/amavis/smtp[420343]: cannot load Certification Authority data, CAfile="/etc/letsencrypt/live/mail.your-domain.com/chain.pem", CApath="/etc/ssl/certs": disabling TLS support
Aug 27 17:15:44 mail postfix/amavis/smtp[420343]: warning: TLS library problem: error:80000002:system library::No such file or directory:../crypto/bio/bss_file.c:67:calling fopen(/etc/letsencrypt/live/mail.your-domain.com/chain.pem, r):
Aug 27 17:15:44 mail postfix/amavis/smtp[420343]: warning: TLS library problem: error:10000080:BIO routines::no such file:../crypto/bio/bss_file.c:75:
Aug 27 17:15:44 mail postfix/amavis/smtp[420343]: warning: TLS library problem: error:05880002:x509 certificate routines::system lib:../crypto/x509/by_file.c:228:. Currently I cannot send mail to gmail but I can receive mail from gmail. Please help me fix this

21

Re: Can't send out emails

root@mail:~# tail /var/log/mail.log
Aug 27 17:21:07 mail postfix/cleanup[420727]: 4WtNqR10FrzGr6P: message-id=<fd1be7985bbeef370d2452c89796e485@iredmail-tc24.online>
Aug 27 17:21:07 mail postfix/qmgr[4254]: 4WtNqR10FrzGr6P: from=<happy@iredmail-tc24.online>, size=2345, nrcpt=1 (queue active)
Aug 27 17:21:07 mail postfix/10025/smtpd[420746]: disconnect from localhost[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
Aug 27 17:21:07 mail postfix/smtp[420747]: cannot load Certification Authority data, CAfile="/etc/letsencrypt/live/mail.your-domain.com/chain.pem", CApath="/etc/ssl/certs": disabling TLS support
Aug 27 17:21:07 mail postfix/smtp[420747]: warning: TLS library problem: error:80000002:system library::No such file or directory:../crypto/bio/bss_file.c:67:calling fopen(/etc/letsencrypt/live/mail.your-domain.com/chain.pem, r):
Aug 27 17:21:07 mail postfix/smtp[420747]: warning: TLS library problem: error:10000080:BIO routines::no such file:../crypto/bio/bss_file.c:75:
Aug 27 17:21:07 mail postfix/smtp[420747]: warning: TLS library problem: error:05880002:x509 certificate routines::system lib:../crypto/x509/by_file.c:228:
Aug 27 17:21:07 mail amavis[374911]: (374911-04) Passed CLEAN {RelayedInternal}, ORIGINATING/MYNETS LOCAL [127.0.0.1]:59306 ESMTP/ESMTP <happy@iredmail-tc24.online> -> <dangduong020309@gmail.com>, (), Queue-ID: 4WtNqN5tsjzGpDy, Message-ID: <fd1be7985bbeef370d2452c89796e485@iredmail-tc24.online>, mail_id: 7g25m49RA_cj, b: 6EVnrJMpM, Hits: 2.487, size: 718, queued_as: 4WtNqR10FrzGr6P, Subject: "đi đá bóng (raw: =?UTF-8?Q?=C4=91i_=C4=91=C3=A1_b=C3=B3ng?=)", From: <happy@iredmail-tc24.online>, User-Agent: Roundcube_Webmail, helo=localhost, Tests: [ALL_TRUSTED=-1,FROM_FMBLA_NEWDOM14=0.999,FROM_SUSPICIOUS_NTLD=0.499,FROM_SUSPICIOUS_NTLD_FP=1.999,T_SCC_BODY_TEXT_LINE=-0.01], autolearn=no autolearn_force=no, autolearnscore=3.487, dkim_new=dkim:iredmail-tc24.online, 2196 ms
Aug 27 17:21:07 mail postfix/amavis/smtp[420728]: 4WtNqN5tsjzGpDy: to=<dangduong020309@gmail.com>, relay=127.0.0.1[127.0.0.1]:10026, delay=2.4, delays=0.08/0.02/0.43/1.9, 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 4WtNqR10FrzGr6P)
Aug 27 17:21:07 mail postfix/qmgr[4254]: 4WtNqN5tsjzGpDy: removed.

22 (edited by Cthulhu 2024-08-27 19:31:49)

Re: Can't send out emails

open a own thread pls and don't highjack other issues which aren't even related to your problem

fopen(/etc/letsencrypt/live/mail.your-domain.com/chain.pem, r):

this file does not exist so it fails

23

Re: Can't send out emails

root@mail:/etc/letsencrypt/live/mail.iredmail-tc24.online# ls
README  cert.pem  chain.pem  fullchain.pem  privkey.pem
root@mail:/etc/letsencrypt/live/mail.iredmail-tc24.online# ls
README  cert.pem  chain.pem  fullchain.pem  privkey.pem.
root@mail:~# tail /var/log/mail.log
Aug 27 17:21:07 mail postfix/cleanup[420727]: 4WtNqR10FrzGr6P: message-id=<fd1be7985bbeef370d2452c89796e485@iredmail-tc24.online>
Aug 27 17:21:07 mail postfix/qmgr[4254]: 4WtNqR10FrzGr6P: from=<happy@iredmail-tc24.online>, size=2345, nrcpt=1 (queue active)
Aug 27 17:21:07 mail postfix/10025/smtpd[420746]: disconnect from localhost[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
Aug 27 17:21:07 mail postfix/smtp[420747]: cannot load Certification Authority data, CAfile="/etc/letsencrypt/live/mail.your-domain.com/chain.pem", CApath="/etc/ssl/certs": disabling TLS support
Aug 27 17:21:07 mail postfix/smtp[420747]: warning: TLS library problem: error:80000002:system library::No such file or directory:../crypto/bio/bss_file.c:67:calling fopen(/etc/letsencrypt/live/mail.your-domain.com/chain.pem, r):
Aug 27 17:21:07 mail postfix/smtp[420747]: warning: TLS library problem: error:10000080:BIO routines::no such file:../crypto/bio/bss_file.c:75:
Aug 27 17:21:07 mail postfix/smtp[420747]: warning: TLS library problem: error:05880002:x509 certificate routines::system lib:../crypto/x509/by_file.c:228:
Aug 27 17:21:07 mail amavis[374911]: (374911-04) Passed CLEAN {RelayedInternal}, ORIGINATING/MYNETS LOCAL [127.0.0.1]:59306 ESMTP/ESMTP <happy@iredmail-tc24.online> -> <dangduong020309@gmail.com>, (), Queue-ID: 4WtNqN5tsjzGpDy, Message-ID: <fd1be7985bbeef370d2452c89796e485@iredmail-tc24.online>, mail_id: 7g25m49RA_cj, b: 6EVnrJMpM, Hits: 2.487, size: 718, queued_as: 4WtNqR10FrzGr6P, Subject: "đi đá bóng (raw: =?UTF-8?Q?=C4=91i_=C4=91=C3=A1_b=C3=B3ng?=)", From: <happy@iredmail-tc24.online>, User-Agent: Roundcube_Webmail, helo=localhost, Tests: [ALL_TRUSTED=-1,FROM_FMBLA_NEWDOM14=0.999,FROM_SUSPICIOUS_NTLD=0.499,FROM_SUSPICIOUS_NTLD_FP=1.999,T_SCC_BODY_TEXT_LINE=-0.01], autolearn=no autolearn_force=no, autolearnscore=3.487, dkim_new=dkim:iredmail-tc24.online, 2196 ms
Aug 27 17:21:07 mail postfix/amavis/smtp[420728]: 4WtNqN5tsjzGpDy: to=<dangduong020309@gmail.com>, relay=127.0.0.1[127.0.0.1]:10026, delay=2.4, delays=0.08/0.02/0.43/1.9, 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 4WtNqR10FrzGr6P)
Aug 27 17:21:07 mail postfix/qmgr[4254]: 4WtNqN5tsjzGpDy: removed.
hiện tại tôi k thể gửi nhưng vẫn có thể nhận.

24

Re: Can't send out emails

root@mail:~# telnet smtp.gmail.com 25
Trying 64.233.180.108...
Trying 2607:f8b0:4004:c07::6c...
telnet: Unable to connect to remote host: Network is unreachable
root@mail:~# telnet smtp.gmail.com 587
Trying 64.233.180.108...
Connected to smtp.gmail.com.
Escape character is '^]'.
220 smtp.gmail.com ESMTP 6a1803df08f44-6c162de7826sm54587376d6.139 - gsmtp
^C
quit
Connection closed by foreign host.
root@mail:~# telnet smtp.gmail.com 465
Trying 64.233.180.108...
Connected to smtp.gmail.com.
Escape character is '^]'.
quit
FConnection closed by foreign host.
i don't know ít. Why can I telnet into port 587 but not 465? Please help me thank you everyone

25

Re: Can't send out emails

dangduong020309 wrote:

i don't know ít. Why can I telnet into port 587 but not 465? Please help me thank you everyone

exec three commands

tcptraceroute smtp.gmail.com 25
tcptraceroute smtp.gmail.com 465
tcptraceroute smtp.gmail.com 587

and compare outputs