1 (edited by AndrzejL 2022-07-09 17:52:46)

Topic: [SOLVED] Amavis stopped.

SOLUTION:

AndrzejL wrote:

So I had an idea...

Replaced:

Restart=on-failure

with

Restart=always

in the

/usr/lib/systemd/system/amavis.service

Then running

systemctl daemon-reload
systemctl restart amavis

Will see if this helps with the "stopped" issue.

Kindest regards.

AndrzejL

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release):
1.6.0
- Deployed with iRedMail Easy or the downloadable installer?
Downloadable installer
- Linux/BSD distribution name and version:
Debian Bullseye 11
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
MySQL
- Web server (Apache or Nginx):
Nginx
- Manage mail accounts with iRedAdmin-Pro?
No - as far as I know its a regular iRedAdmin. Not pro...
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hello.

Freshly installed (maybe 2 weeks ago) iredmail 1.6.0. Installed using the downloadable .sh script.

Everything seems to be fine. I seem to receive / send e-mails as expected. However. On the occasion I see this:

● amavis.service - Interface between MTA and virus scanner/content filters
     Loaded: loaded (/lib/systemd/system/amavis.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Thu 2022-07-07 20:06:42 IST; 1h 2min ago
       Docs:
    Process: 3438 ExecStartPre=/usr/bin/find /var/lib/amavis -maxdepth 1 -name amavis-* -type d -exec rm -rf {} ; (code=exited, status=0/SUCCESS)
    Process: 3443 ExecStartPre=/usr/bin/find /var/lib/amavis/tmp -maxdepth 1 -name amavis-* -type d -exec rm -rf {} ; (code=exited, status=0/SUCCESS)
    Process: 3445 ExecStart=/usr/sbin/amavisd-new foreground (code=exited, status=0/SUCCESS)
   Main PID: 3445 (code=exited, status=0/SUCCESS)
        CPU: 5.416s

Jul 07 19:46:44 mail.williwonka.eu amavis[3445]: (03445-13) Passed CLEAN {RelayedInternal}, ORIGINATING LOCAL [66.77.88.99]:48068 [66.77.88.99] ESMTP/ESMTP <williwonka@williwonka.eu> -> <williwonka@williwonka.eu>, (ESMTPSA://[66.77.88.99]:48068), Queue-ID: 4Lf53m3f8Hz1dL, Message-ID: <20220707184644.51E62232C@an>
Jul 07 20:01:39 mail.williwonka.eu amavis[3445]: (03445-14) Passed CLEAN {RelayedInternal}, ORIGINATING LOCAL [66.77.88.99]:47468 [66.77.88.99] ESMTP/ESMTP <williwonka@williwonka.eu> -> <williwonka@williwonka.eu>, (ESMTPSA://[66.77.88.99]:47468), Queue-ID: 4Lf0b15fY2z240, Message-ID: <20220707152501.870A3230C@an>
Jul 07 20:01:46 mail.williwonka.eu amavis[3445]: (03445-15) Passed CLEAN {RelayedInternal}, ORIGINATING LOCAL [66.77.88.99]:55258 [66.77.88.99] ESMTP/ESMTP <williwonka@williwonka.eu> -> <williwonka@williwonka.eu>, (ESMTPSA://[66.77.88.99]:55258), Queue-ID: 4Lf5P61vqNz1dD, Message-ID: <20220707190146.0C7862456@an>
Jul 07 20:06:39 mail.williwonka.eu amavis[3445]: (03445-16) Passed CLEAN {RelayedInternal}, ORIGINATING LOCAL [66.77.88.99]:51764 [66.77.88.99] ESMTP/ESMTP <williwonka@williwonka.eu> -> <williwonka@williwonka.eu>, (ESMTPSA://[66.77.88.99]:51764), Queue-ID: 4Ldz4T1VFJz22Q, Message-ID: <20220707141657.03F3E593@pri>
Jul 07 20:06:39 mail.williwonka.eu amavis[3445]: (03445-17) Passed CLEAN {RelayedInternal}, ORIGINATING LOCAL [66.77.88.99]:57786 [66.77.88.99] ESMTP/ESMTP <williwonka@williwonka.eu> -> <williwonka@williwonka.eu>, (ESMTPSA://[66.77.88.99]:57786), Queue-ID: 4Ldz4C0MNhz22J, Message-ID: <20220707141642.CFD6E23C3@an>
Jul 07 20:06:39 mail.williwonka.eu amavis[3445]: (03445-17-2) Passed CLEAN {RelayedInternal}, ORIGINATING LOCAL [66.77.88.99]:52650 [66.77.88.99] ESMTP/ESMTP <williwonka@williwonka.eu> -> <williwonka@williwonka.eu>, (ESMTPSA://[66.77.88.99]:52650), Queue-ID: 4Ldz820kscz22T, Message-ID: <20220707142001.DF21723C3@>
Jul 07 20:06:40 mail.williwonka.eu amavis[3445]: (03445-17-3) Passed CLEAN {RelayedInternal}, ORIGINATING LOCAL [66.77.88.99]:39958 [66.77.88.99] ESMTP/ESMTP <williwonka@williwonka.eu> -> <williwonka@williwonka.eu>, (ESMTPSA://[66.77.88.99]:39958), Queue-ID: 4Lf0hn3Gxjz244, Message-ID: <20220707153001.3345E23C3@>
Jul 07 20:06:40 mail.williwonka.eu amavis[3445]: (03445-17-4) Passed CLEAN {RelayedInternal}, ORIGINATING LOCAL [66.77.88.99]:39956 [66.77.88.99] ESMTP/ESMTP <williwonka@williwonka.eu> -> <williwonka@williwonka.eu>, (ESMTPSA://[66.77.88.99]:39956), Queue-ID: 4Lf0hn39t8z243, Message-ID: <20220707153001.311ED23E2@>
Jul 07 20:06:42 mail.williwonka.eu systemd[1]: amavis.service: Succeeded.
Jul 07 20:06:42 mail.williwonka.eu systemd[1]: amavis.service: Consumed 5.416s CPU time.

I am unable to figure out why amavis dies but then when restarted I seem to be getting a lot of backlogged e-mails.

Can you please try and help?

Ask for any additional info like command outputs or logs and you shall receive it.

Kindest regards.

AndrzejL

----

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

2

Re: [SOLVED] Amavis stopped.

how much vram do you have?

3

Re: [SOLVED] Amavis stopped.

Cthulhu wrote:

how much vram do you have?

Excellent question. This virtual machine has 4GB of RAM allocated to it.

I will increase it to 6 and see if behaviour persists.

Thank you for your reply! I appreciate it.

Kindest regards.

AndrzejL

4

Re: [SOLVED] Amavis stopped.

You should check why amavis crashed, since it starts up normally, but i guess it uses too much vram for spam and virus scanning so it shuts down


I also would suggest this:
https://docs.iredmail.org/completely.di … assin.html

5 (edited by AndrzejL 2022-07-08 19:38:21)

Re: [SOLVED] Amavis stopped.

Cthulhu wrote:

You should check why amavis crashed, since it starts up normally, but i guess it uses too much vram for spam and virus scanning so it shuts down


I also would suggest this:

Hi!

Unfortunately the service crashed last night around 2:30 again:

root@mail:~# systemctl status amavis
● amavis.service - Interface between MTA and virus scanner/content filters
     Loaded: loaded (/lib/systemd/system/amavis.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Fri 2022-07-08 02:31:41 IST; 5h 30min ago
.
.
Jul 08 02:31:41 mail.williwonka.eu systemd[1]: amavis.service: Succeeded.
Jul 08 02:31:41 mail.williwonka.eu systemd[1]: amavis.service: Consumed 5.351s CPU time.

I will up the ram for the vm to 8 see if it happens again.

I would rather not disable the mentioned above services. Its scary...

Edit: Disabled clamav. Left amavis and spam assassin running. Lets see how that goes.

Kindest regards.

AndrzejL

6

Re: [SOLVED] Amavis stopped.

Unfortunately it keeps happening every now and then so I created a cron job to restart amavis every hour... Its a silly solution I know but I need this working.

Last time I was able to "catch it" was today at 16:46:42

Jul 08 16:46:42 mail.williwonka.eu postfix/submission/smtpd[9770]: connect from 66-77-88-99-hostname [66.77.88.99]
Jul 08 16:46:42 mail.williwonka.eu postfix/submission/smtpd[9770]: Anonymous TLS connection established from 66-77-88-99-hostname [66.77.88.99]: TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
Jul 08 16:46:42 mail.williwonka.eu python3[882]: iredapd [51.171.4.95] RCPT, williwonka@williwonka.eu => root@williwonka.eu, DUNNO [sasl_username=williwonka@williwonka.eu, sender=williwonka@williwonka.eu, client_name=51-171-4-95-dynamic.agg9.chf.chf-qkr.eircom.net, reverse_client_name=51-171-4-95-dynamic.agg9.chf.chf-qkr.eircom.net, helo=williwonka.eu, encryption_protocol=TLSv1.3, encryption_cipher=TLS_AES_256_GCM_SHA384, server_port=587, process_time=0.0067s]
Jul 08 16:46:42 mail.williwonka.eu postfix/submission/smtpd[9770]: 4Lfd1Z3HRKz1dJ: client=66-77-88-99-hostname [66.77.88.99], sasl_method=PLAIN, sasl_username=williwonka@williwonka.eu
Jul 08 16:46:42 mail.williwonka.eu python3[882]: iredapd [51.171.4.95] END-OF-MESSAGE, williwonka@williwonka.eu => root@williwonka.eu, DUNNO [recipient_count=1, size=688, process_time=0.0008s]
Jul 08 16:46:42 mail.williwonka.eu postfix/cleanup[9771]: 4Lfd1Z3HRKz1dJ: prepend: header Content-Transfer-Encoding: 8bit from 66-77-88-99-hostname [66.77.88.99]; from=<williwonka@williwonka.eu> to=<root@williwonka.eu> proto=ESMTP helo=<williwonka.eu>: List-Unsubscribe: mailto:<sender-email-address>?subject=unsubscribe>"
Jul 08 16:46:42 mail.williwonka.eu postfix/cleanup[9771]: 4Lfd1Z3HRKz1dJ: message-id=<20220708154642.43197243B@williwonka.eu>
Jul 08 16:46:42 mail.williwonka.eu postfix/qmgr[1626]: 4Lfd1Z3HRKz1dJ: from=<williwonka@williwonka.eu>, size=978, nrcpt=1 (queue active)
Jul 08 16:46:42 mail.williwonka.eu postfix/submission/smtpd[9770]: disconnect from 66-77-88-99-hostname [66.77.88.99] ehlo=2 starttls=1 auth=1 mail=1 rcpt=1 data=1 quit=1 commands=8
Jul 08 16:46:42 mail.williwonka.eu postfix/10025/smtpd[9775]: connect from mail.williwonka.eu[127.0.0.1]
Jul 08 16:46:42 mail.williwonka.eu postfix/10025/smtpd[9775]: 4Lfd1Z57tKz1dK: client=mail.williwonka.eu[127.0.0.1]
Jul 08 16:46:42 mail.williwonka.eu postfix/cleanup[9771]: 4Lfd1Z57tKz1dK: message-id=<20220708154642.43197243B@williwonka.eu>
Jul 08 16:46:42 mail.williwonka.eu postfix/10025/smtpd[9775]: disconnect from mail.williwonka.eu[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
Jul 08 16:46:42 mail.williwonka.eu postfix/qmgr[1626]: 4Lfd1Z57tKz1dK: from=<williwonka@williwonka.eu>, size=2247, nrcpt=1 (queue active)
Jul 08 16:46:42 mail.williwonka.eu amavis[2034]: (02034-20) Passed CLEAN {RelayedInternal}, ORIGINATING LOCAL [51.171.4.95]:49106 [51.171.4.95] ESMTP/ESMTP <williwonka@williwonka.eu> -> <williwonka@williwonka.eu>, (ESMTPSA://[51.171.4.95]:49106), Queue-ID: 4Lfd1Z3HRKz1dJ, Message-ID: <20220708154642.43197243B@williwonka.eu>, mail_id: TrTAnwdtc5W4, b: i-JpaJPjB, Hits: -1.01, size: 990, queued_as: 4Lfd1Z57tKz1dK, Subject: "Cron <root@williwonka> /root/.bin/Fix_WWW_Permissions.sh", From: <williwonka.eu@williwonka.eu>, helo=williwonka.eu, Tests: [ALL_TRUSTED=-1,T_SCC_BODY_TEXT_LINE=-0.01], autolearn=ham autolearn_force=no, autolearnscore=-0.01, dkim_new=dkim:williwonka.eu, 253 ms
Jul 08 16:46:42 mail.williwonka.eu postfix/amavis/smtp[9773]: 4Lfd1Z3HRKz1dJ: to=<williwonka@williwonka.eu>, orig_to=<root@williwonka.eu>, relay=127.0.0.1[127.0.0.1]:10026, delay=0.3, delays=0.03/0.01/0/0.26, 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 4Lfd1Z57tKz1dK)
Jul 08 16:46:42 mail.williwonka.eu postfix/qmgr[1626]: 4Lfd1Z3HRKz1dJ: removed
Jul 08 16:46:42 mail.williwonka.eu dovecot[9777]: lda(williwonka@williwonka.eu)<9777><TaIJLWJRyGIxJgAAFXfAmQ>: sieve: from=williwonka.eu@williwonka.eu, envelope_sender=williwonka@williwonka.eu, subject=Cron <root@williwonka> /root/.bin/Fix_WWW_Permissions.sh, msgid=<20220708154642.43197243B@williwonka.eu>, size=2275, delivery_time=19ms, stored mail into mailbox 'INBOX'
Jul 08 16:46:42 mail.williwonka.eu postfix/pipe[9776]: 4Lfd1Z57tKz1dK: to=<williwonka@williwonka.eu>, relay=dovecot, delay=0.05, delays=0.01/0.01/0/0.04, dsn=2.0.0, status=sent (delivered via dovecot service)
Jul 08 16:46:42 mail.williwonka.eu postfix/qmgr[1626]: 4Lfd1Z57tKz1dK: removed
Jul 08 16:46:42 mail.williwonka.eu systemd[1]: amavis.service: Succeeded.
░░ Subject: Unit succeeded
░░ Defined-By: systemd
░░ Support: Link removed.
░░
░░ The unit amavis.service has successfully entered the 'dead' state.
Jul 08 16:46:42 mail.williwonka.eu systemd[1]: amavis.service: Consumed 4.566s CPU time.
░░ Subject: Resources consumed by unit runtime
░░ Defined-By: systemd
░░ Support: Link removed.
░░
░░ The unit amavis.service completed and consumed the indicated resources.

I have 6 gigs of ram attached to the VM and it wasn't using even 1/3 of it when amavis crashed.

Kindest regards.

AndrzejL

7

Re: [SOLVED] Amavis stopped.

Uh just a thought... Is there a limit of memory amavis can use? As in software limit configurable in the file somewhere? Maybe once its reaching it it crashes? Or am I the one that's reaching?

Kindest regards.

AndrzejL

8

Re: [SOLVED] Amavis stopped.

So I had an idea...

Replaced:

Restart=on-failure

with

Restart=always

in the

/usr/lib/systemd/system/amavis.service

Then running

systemctl daemon-reload
systemctl restart amavis

Will see if this helps with the "stopped" issue.

Kindest regards.

AndrzejL

9 (edited by AndrzejL 2022-07-11 01:00:25)

Re: [SOLVED] Amavis stopped.

Yes, issue is fixed.

I've checked the status of amavis this morning and it was running / active since 44 minutes ago. Which means at some stage 44 minutes ago it failed and restarted. That's the behaviour I was hoping to see.

Kindest regards.

AndrzejL