0

I installed iRedMail which would install amavis and spamassassin. When I test sending and receiving email, I have an error in the /var/log/mail.log, I see this line of error:

postfix/amavis/smtp[14582]: connect to 127.0.0.1[127.0.0.1]:10026: Connection refused

when I run this line: $sudo amavisd-new debug I see at the end of the output:

files are in the config directory.\nAt a minimum, v320.pre loads the Check plugin which is required. Jun 12 11:58:25.764 mail.example.com /usr/sbin/amavisd-new[20040]: sd_notify (no socket): STOPPING=1\nSTATUS=TROUBLE in pre_loop_hook: Timeout::_run: check: no loaded plugin implements 'check_main': cannot scan!\nCheck that the necessary '.pre' files are in the config directory.\nAt a minimum, v320.pre loads the Check plugin which is required. Jun 12 11:58:25.764 mail.example.com /usr/sbin/amavisd-new[20040]: (!)_DIE: Suicide () TROUBLE in pre_loop_hook: Timeout::_run: check: no loaded plugin implements 'check_main': cannot scan!\nCheck that the necessary '.pre' files are in the config directory.\nAt a minimum, v320.pre loads the Check plugin which is required. Suicide () TROUBLE in pre_loop_hook: Timeout::_run: check: no loaded plugin implements 'check_main': cannot scan! Check that the necessary '.pre' files are in the config directory. At a minimum, v320.pre loads the Check plugin which is required.

This is also the output of $spamassassin --lint -D:

Timeout::_run: check: no loaded plugin implements 'check_main': cannot scan! Check that the necessary '.pre' files are in the config directory. At a minimum, v320.pre loads the Check plugin which is required

I looked up in the /etc/mail/spamassassin directory and I can't see any '.pre' files in it. I also searched for v320.pre file using this: $sudo find / -iname v320.pre with no result.

If I disbale the amavis using: $sudo nano /etc/amavis/conf.d/50-user and changing these two lines:

@bypass_virus_checks_maps = (1); @bypass_spam_checks_maps = (1);

and then restarting the service: $sudo systemctl restart amavis and then processing the mail queue: $postqueue -f the mail server would work perfectly fine! So it is obvious that I should put some '.pre' files in the /etc/mail/spamassassin directory. I found out that there are some '.pre' files in this url: https://apache.googlesource.com/spamassassin/+/trunk/rules My question is: Is it safe to download these files and put them in my directory? Or in general where can I find '.pre' files or generate them?

Mahsa
  • 111
  • 5
  • Does a log from the time *spamassassin* was installed reveal why its configuration files were not copied to `/etc`? – anx Jun 12 '21 at 10:09
  • @anx I checked the `install.log` file and there is no error regarding the apamassassin installation (or anything else). It doesn't have any information about '.pre' files. It only has these lines in it: ```[ INFO ] Configure SpamAssassin (content-based spam filter). + < DEBUG > Copy sample SpamAssassin config file: /path/to/iRedMail-1.4.0/samples/spamassassin/local.cf -> /etc/mail/spamassassin/local.cf. + < DEBUG > Enable crontabs for SpamAssassin update.``` – Mahsa Jun 12 '21 at 10:31
  • @anx I also checked the installation files: `iRedMail-1.4.0/samples/spamassassin` it only has two files in it: `local.cf` and `razor.conf` – Mahsa Jun 12 '21 at 10:36

1 Answers1

1

To whom it may concern, I downloaded the whole version regarding the one that was installed on my server from (https://spamassassin.apache.org/)[https://spamassassin.apache.org/]. Then I scrolled down to rules directory from the downloaded files and copy v320.pre to my server /etc/mail/spamassassin directory (since v320.pre is the minimum requirement for spamassassin and amavis to work). Then I used this command to update the rules: $sudo sa-update I restarted amavis and spamassassin services:

$sudo systemctl restart amavis

$sudo systemctl restart spamassassin

checked the debug outputs using these command lines:

$sudo amavisd-new debug

$spamassassin --lint -D

After I made sure, there is no error, I enabled the service in this file:

$sudo nano /etc/amavis/conf.d/50-user

and modified these lines:

@bypass_virus_checks_maps = (0);

@bypass_spam_checks_maps = (0);

save and close the file, and restart the service.

$sudo systemctl restart amavis

To make sure everything is working find just send and receive an email. And yeah :)

Mahsa
  • 111
  • 5