Page 1 of 1

smtp 451 local error fix..

Posted: Sat Jan 04, 2020 11:59 am
by murdocklawless
I was getting smtp 451 error while trying to send mails. I checked exim4 logs and I saw clamav is trying to reach the directory /run/clamav and report that couldn't find the folder or sometimes reach the folder but couldn't read file clamd.ctl because of the permissions. when I checked status of clamav-daemon I saw it stopped. it seems like coudn't create the directory /run/clamav. when clamav-daemon is starting /run/clamav directory is beeing recreating again but because of folder existing clamav-daemon returns with an error and saying can not create folder and disables itself.

I found clamav-daemon service conf file in /etc/systemd/system/clamav-daemon.service.d and edit the file extend.conf and add this fist line after the [Service] ;

ExecStartPre=-/bin/rm -rf /run/clamav

then edit the last line like this ;

ExecStartPre=/bin/chown clamav:clamav /run/clamav

by doing this, in the first line when clamav-daemon starts first it deletes the /run/clamav directory so we are getting rid off error which clamav-daemon is saying can not create folder. editing third line is for the permission error.

after you save the extend.conf stop the clamav and start again ;

service clamav-daemon stop

and then;

service clamav-daemon start

check the status of clamav after starting for the errors;

service clamav-daemon status

that is the way how I get rid off the smtp 451 error.