艾瑞克的 Hexo 空間

[筆記] iredmail 的amavisd 預設好像有問題

本文發表於585天之前,文章內容可能已經過時,如有疑問,請聯繫作者。

從外面寄信時,會在 maillog 看到類似這樣的錯誤,不過信件還是可以寄出就是

May 11 17:23:13 iredmail amavis[1582]: (01582-02) TempDir::prepare_file: /var/spool/amavisd/tmp/amavis-20160511T172313-01582-kSxYqpMz/email.txt no longer exists, can’t re-use it
雖然信件還是可以正常寄出,不過看到有error 就是不爽 XD

看起來像是權限的問題

去找了一下/var/spool/amavisd 這個目錄的權限,應該是沒有問題

drwxr-x— 7 amavis amavis 4096 May 11 17:32 amavisd
又看到網路上有人說這是因為clam帳號權限的問題

 

The problem with EPEL is that the “clam” user does not have access to the amavis folders. To get this to work with EPEL is pretty staight forward:

解決方法也很簡單


usermod -a -G amavis clam

chmod g+rx /var/spool/amavisd/tmp

 

不過呢,事情當然沒有這麼簡單..

改完這些設定後,要重啟 amavisd 就出問題了,一直失敗

May 11 17:30:27 iredmail amavis[10713]: starting. /usr/sbin/amavisd at iredmail.cowbay.org amavisd-new-2.9.1 (20140627), Unicode aware, LANG=”en_US.UTF-8”

May 11 17:30:27 iredmail amavis[10713]: (!)Net::Server: 2016/05/11-17:30:27 Pid_file already exists for running process (1323)… aborting\n\n at line 145 in file /usr/share/perl5/vendor_perl/Net/Server.pm
不知道為何,系統的 amavisd 行程會一直咬著不放

解決方法就是去砍掉系統內的 amavisd 再重啟服務

ps -aux |grep amavis
找出 id 後,砍光光

然後 service amavisd start 就可以了!

 

 

 

avatar
[筆記] PHP Opensource Systems