the_jdub
By:
the_jdub

Cant send/receive mail with new iRedMail install on Ubuntu 12.04

April 10, 2014 6.4k views
I recently created a new droplet and installed iRedMail on it by following these directions: https://www.digitalocean.com/community/articles/how-to-install-iredmail-on-ubuntu-12-04-x64 But I cannot send or receive mail on it. The email just gets returned with a "Connection Refused" error. /var/log/mail.err complains that all primary virus scanners failed I'm new to Linux admin, so you may have to walk me though things, but I catch on quick.
13 Answers
Try temporarily resizing your droplet to 1GB. If that doesn't fix it, resize back to 512MB, it's probably something else that's preventing it from starting.
  • I had this same problem - with iRedMail errors. Here's how to solve it:

    1. Shut down the droplet
    2. Saved a snapshot of my 512mb droplet
    3. Destroyed the droplet to free up the same IP address
    4. Created a new 1mb droplet with exact same hostname as snapshot/destroyed droplet
    5. Selected 'My Images' and assigned my snapshot image to the new droplet
    6. Worked like a charm
That did it!!!

I don't know if it was the resize itself, or power cycling the server (maybe it just needed a good restart) but I have successfully sent and received email.

Thank you very much for all your help.

Now maybe I can confidently dump my old host before they bill me for another year in a few days.
Can you post the output of
tail -7 /var/log/mail.err
? Check if the service it's complaining about is running:
sudo ps wwaux | grep NAME
Here is the tail output from mail.err:

Apr 8 13:21:02 www amavis[1418]: (01418-06) (!!)TROUBLE in check_mail: virus_scan FAILED: AV: ALL VIRUS SCANNERS FAILED
Apr 8 13:50:46 www amavis[1417]: (01417-06) (!!)WARN: all primary virus scanners failed, considering backups
Apr 8 13:50:50 www amavis[1417]: (01417-06) (!!)TROUBLE in check_mail: virus_scan FAILED: AV: ALL VIRUS SCANNERS FAILED
Apr 8 13:51:34 www amavis[1418]: (01418-07) (!!)WARN: all primary virus scanners failed, considering backups
Apr 8 13:51:38 www amavis[1418]: (01418-07) (!!)TROUBLE in check_mail: virus_scan FAILED: AV: ALL VIRUS SCANNERS FAILED
Apr 8 14:00:55 www amavis[1418]: (01418-08) (!!)WARN: all primary virus scanners failed, considering backups
Apr 8 14:00:55 www amavis[1417]: (01417-07) (!!)WARN: all primary virus scanners failed, considering backups

I assume in your 'sudo' command I substitute NAME with amavis? In which case amavis does not appear to be running, because if I am reading the right the only thing returning is the grep command:

root 22599 0.0 0.1 9392 900 pts/0 S+ 17:59 0:00 grep --color=auto amavis
I'm not sure if I'm making progress or not. It looks like I got my amavis running by executing 'service amavis start', but I still get the same errors as above. I checked my /var/log/mail.log and saw this:

Apr 11 09:30:47 www amavis[25786]: (25786-01) (!)ClamAV-clamd av-scanner FAILED: run_av error: Too many retries to talk to /tmp/clamd.socket (Can't connect to UNIX socket /tmp/clamd.socket: No such file or directory) at (eval 102) line 375.

So it appears there is something wrong with clamav? I've been searching the web, but haven't been able to diagnose the problem yet.
I tried running "apt-get install clamav-daemon" and it said everything is up to date. When I execute "service clamav-daemon start", I get:

* Starting ClamAV daemon clamd
Killed
[fail]

I even tried running freshclam. It, too, said everything was up to date.

/var/log/clamav/clamav.log is empty

Could it be something in /etc/clamav/clamd.conf? I don't know anything about how that file is supposed to look, but I've seen it mentioned in several places.
It could be crashing because it's running out of memory. What's the output of
sudo dmesg | grep -i oom
? What size is your droplet? Have you added swap to it? https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04.
by Etel Sverdlov
Linux swaps allow a system to harness more memory than was originally physically available. Here's how to set up a linux swap file on Ubuntu 12.04
"sudo dmesg | grep -i oom" returns nothing, however I only have the 512MB/20GB droplet.

I have not added swap, but will that help if it's not an OOM issue? I wouldn't think so.
I'm not sure if 512MB is enough for iRedMail -- add swap anyway, it reduces the chance of programs crashing if they run out of ram. That could also be what's preventing clamav from starting.
Added swap, but still can't start clamav. That would be unfortunate if my droplet is too small to run it.
i am also facing this same issue.
when i execute the command.

dmesg | grep -i oom

output i get is:

clamscan invoked oom-killer: gfp_mask=0x201da, order=0, oom_adj=0, oom_score_adj=0
[250865.031807] [] oom_kill_process+0x5c/0x80
[250865.032876] [ pid ] uid tgid total_vm rss cpu oom_adj oom_score_adj name
[252665.438495] clamscan invoked oom-killer: gfp_mask=0x201da, order=0, oom_adj=0, oom_score_adj=0
[252665.438525] [] oom_kill_process+0x5c/0x80
[252665.439583] [ pid ] uid tgid total_vm rss cpu oom_adj oom_score_adj name
[364077.792997] fail2ban-server invoked oom-killer: gfp_mask=0x201da, order=0, oom_adj=0, oom_score_adj=0
[364077.793027] [] oom_kill_process+0x5c/0x80
[364077.794143] [ pid ] uid tgid total_vm rss cpu oom_adj oom_score_adj name
[364570.612300] clamscan invoked oom-killer: gfp_mask=0x201da, order=0, oom_adj=0, oom_score_adj=0
[364570.612328] [] oom_kill_process+0x5c/0x80
[364570.613425] [ pid ] uid tgid total_vm rss cpu oom_adj oom_score_adj name
[365170.316679] clamscan invoked oom-killer: gfp_mask=0x201da, order=0, oom_adj=0, oom_score_adj=0
[365170.316705] [] oom_kill_process+0x5c/0x80
[365170.317739] [ pid ] uid tgid total_vm rss cpu oom_adj oom_score_adj name
[365316.024421] clamscan invoked oom-killer: gfp_mask=0x201da, order=0, oom_adj=0, oom_score_adj=0
[365316.024447] [] oom_kill_process+0x5c/0x80
[365316.025457] [ pid ] uid tgid total_vm rss cpu oom_adj oom_score_adj name
[365601.689597] clamscan invoked oom-killer: gfp_mask=0x201da, order=0, oom_adj=0, oom_score_adj=0
[365601.689626] [] oom_kill_process+0x5c/0x80
[365601.690791] [ pid ] uid tgid total_vm rss cpu oom_adj oom_score_adj name
[366070.447334] clamscan invoked oom-killer: gfp_mask=0x201da, order=0, oom_adj=0, oom_score_adj=0
[366070.447361] [] oom_kill_process+0x5c/0x80
[366070.448398] [ pid ] uid tgid total_vm rss cpu oom_adj oom_score_adj name
[366370.289040] clamscan invoked oom-killer: gfp_mask=0x201da, order=0, oom_adj=0, oom_score_adj=0
[366370.289067] [] oom_kill_process+0x5c/0x80
[366370.290081] [ pid ] uid tgid total_vm rss cpu oom_adj oom_score_adj name
[366970.209529] clamscan invoked oom-killer: gfp_mask=0x201da, order=0, oom_adj=0, oom_score_adj=0
[366970.209557] [] oom_kill_process+0x5c/0x80
[366970.210551] [ pid ] uid tgid total_vm rss cpu oom_adj oom_score_adj name
[368769.284445] clamscan invoked oom-killer: gfp_mask=0x201da, order=0, oom_adj=0, oom_score_adj=0
[368769.284474] [] oom_kill_process+0x5c/0x80
[368769.285574] [ pid ] uid tgid total_vm rss cpu oom_adj oom_score_adj name
[368774.452359] proxymap invoked oom-killer: gfp_mask=0x201da, order=0, oom_adj=0, oom_score_adj=0
[368774.452386] [] oom_kill_process+0x5c/0x80
[368774.453386] [ pid ] uid tgid total_vm rss cpu oom_adj oom_score_adj name
clamd invoked oom-killer: gfp_mask=0x201da, order=0, oom_adj=0, oom_score_adj=0
[] oom_kill_process+0x5c/0x80
[ pid ] uid tgid total_vm rss cpu oom_adj oom_score_adj name

can you tell what is the problem facing by me?
I have the same problem with iRedMail. I just googled it and it has something to do with clamav permission.


ERROR: Can't open /var/log/clamav/freshclam.log in append mode (check permissions!).
ERROR: Problem with internal logger (UpdateLogFile = /var/log/clamav/freshclam.log).

May be adding amavis to clamav and change permissions for /var/log/clamav will help.

I am unsure how to do it cause I am a linux n00b.
Have another answer? Share your knowledge.