Ubuntu: 4.7.1 Service Unavailable - try again later


I'm not sure this is the best place for this question, but I have googled around and can't seem to find a resolution to my issue. Please feel free to redirect me somewhere else if necessary. :)

So, I am hosting a mail server on Ubuntu 14.04, using postfix. I have noticed recently that I haven't gotten any mail since last week. In


I am seeing a lot of

milter-reject: END-OF-MESSAGE from localhost[]: 4.7.1 Service unavailable - try again later;  

messages. The only thread I can find about that particular error(https://serverfault.com/questions/676473/postfix-milter-reject-end-of-message-from-4-7-1-service-unavailable-try-again) says to move from DKIM to OpenDKIM. However, I am already using OpenDKIM, so that (probably) isn't the issue.

I have also noticed that the messages are sitting in


but have no idea how to get the out of there/why they are there. There are some errors saying that the following destination in unwritable, but I have given it the correct permissions now ... I think.

/var/lib/spamassassin/sa-update-keys/    root@ip-00-00-00-00:/var/spool/postfix/maildrop# ls -l /var/lib/spamassassin/sa-update-keys/  total 8  -rw------- 1 spamd spamd 2783 Oct 28  2015 pubring.gpg  -rw------- 1 spamd spamd    0 Oct 28  2015 pubring.gpg~  -rw------- 1 spamd spamd    0 Oct 28  2015 secring.gpg  -rw------- 1 spamd spamd 1200 Oct 28  2015 trustdb.gpg  

I've tried restarting all the services, and reboot all to no avail. I'm a little stuck on where to go now, so any help would be appreciated.

Regards B


So, I realised that the clamav-daemon wasn't restarting properly, which also uses(correct terminology??) the milter. On reviewing the log for the clamav-milter (/var/log/clamav/clamav-milter.log) I can see that the clamd server isn't starting correctly

Sun Jun 12 06:29:00 2016 -> WARNING: No clamd server appears to be available  Sun Jun 12 06:29:25 2016 -> ERROR: Failed to initiate streaming/fdpassing  

on looking in the clamav.log (/var/log/clamav/clamav.log) I can see that there is an issue with the memory allocation:

Mon Jun 13 13:20:55 2016 -> LOCAL: Unix socket file /var/run/clamav/clamd.ctl  Mon Jun 13 13:20:55 2016 -> LOCAL: Setting connection queue length to 15  Mon Jun 13 13:20:55 2016 -> ERROR: daemonize() failed: Cannot allocate memory  Mon Jun 13 13:20:55 2016 -> Socket file removed.  

Looking at memory usage:

             total       used       free     shared    buffers     cached  Mem:           992        759        232         10          6         75  -/+ buffers/cache:        677        314  

So instead of making my AWS instance bigger (and thus more expensive :P) I used this (https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04) to add a swapspace and voila, the service started! :)

I could then follow this (http://www.anta.net/misc/telnet-troubleshooting/smtp.shtml) to check that I was receiving mail via telnet.

I hope my tragedy helps someone out.

Happy Ubuntuing.

Edit 1: removing my tragic "postfix flush" suggestion, which sadly deletes the main queue, and not as I initially read it "processes" the mail queue. :(

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »