开发者

Problem with DKIM socket

I have a problem with dkim-milter.

My maillog file is filled with logs

Dec  5 23:59:59 NS1 dkim-filter[31424]: Sendmail DKIM Filter: Unable to bind to port inet:20209@localhost: Address already in use
Dec  5 23:59:59 NS1 dkim-filter[31424]: Sendmail DKIM Filter: Unable to create listening socket on conn inet:20209@localhost
Dec  5 23:59:59 NS1 dkim-filter[31424]: sm开发者_如何学Pythonfi_opensocket() failed

I suspect that the problem is related to Dkim-filter.conf and line:

Socket                  inet:20209@localhost

It looks like something is allready runing on that port so I can't bind it again.

How can I change this and make DKIM running without errors?


As a note, I found that when I manually stopped and restarted the dkim-milter service, my logs filled up with that message. This was due to the config option "AutoRestart" which defaults to Yes"

With that option on, when the service is stopped using "service dkim-milter stop", it automatically restarts, and when my shell script then ran "service dkim-milter start" a few seconds later, it was duplicating the process and was unable to connect to the port as it was already running.

I am not really experienced enough to know the best was to fix it, but the problem above was tested and repeatable.


In my case, I was running the wrong command. Instead of running

sudo opendkim -x /etc/opendkim.conf -p inet:8891@localhost

I was running:

sudo opendkim -x /etc/opendkim.conf -p init:8891@localhost

Not sure how common this is, but it sure took me a while to track down.


port 20209 is already in use, maybe an old zombie dkim-milter?

netstat -nlp | grep 20209 will help you find out whats blocking the port


I had the same problem so with the help of a friend I followed the steps below:

  • Show 25 more recent errors from logs (/path/to/file): tail -n 25 /var/log/maillog
  • Listen to specific port (20209) to see what's blocking it: netstat -nlp | grep 20209
  • Check status of a service (dkim-milter in this case): service dkim-milter status
  • Show all proccesses with "filter" in name, because dkim-milter is running as dkim-filter: ps ax | grep filter
  • Kill process with pid f.e. 32731: kill 32731

Now the process which produced the errors isn't running.

This is how to restart to dkim-milter and postfix:

service dkim-milter stop
service dkim-milter start
service postfix restart

And everything seemed to work ok now

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜