首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >后缀:连接到Milter服务内:127.0.0.1:8891:连接被拒绝

后缀:连接到Milter服务内:127.0.0.1:8891:连接被拒绝
EN

Server Fault用户
提问于 2017-07-01 15:50:20
回答 4查看 29.1K关注 0票数 13

我注意到,如果键入service后缀状态,milter会出现错误:

代码语言:javascript
复制
Jul 01 17:39:01 mail postfix/cleanup[13921]: warning: connect to Milter service inet:127.0.0.1:8891: Connection refused

但这意味着什么,我该如何解决呢?与DKIM有关吗?因为我试着设置它,但它仍然不起作用。你需要帮助哪些文件?这是我的opendkim.conf:

代码语言:javascript
复制
## CONFIGURATION OPTIONS

# Specifies the path to the process ID file.
PidFile /var/run/opendkim/opendkim.pid

# Selects operating modes. Valid modes are s (signer) and v (verifier). Default is v.
Mode    sv

# Log activity to the system log.
Syslog  yes

# Log additional entries indicating successful signing or verification of messages.
SyslogSuccess yes

# If logging is enabled, include detailed logging about why or why not a message was
# signed or verified. This causes a large increase in the amount of log data generated
# for each message, so it should be limited to debugging use only.
#LogWhy yes

# Attempt to become the specified user before starting operations.
UserID  opendkim:opendkim

# Create a socket through which your MTA can communicate.
Socket  inet:8891@127.0.0.1

# Required to use local socket with MTAs that access the socket as a non-
# privileged user (e.g. Postfix)
Umask   002

# This specifies a file in which to store DKIM transaction statistics.
#Statistics              /var/spool/opendkim/stats.dat

## SIGNING OPTIONS

# Selects the canonicalization method(s) to be used when signing messages.
Canonicalization        relaxed/simple

# Domain(s) whose mail should be signed by this filter. Mail from other domains will
# be verified rather than being signed. Uncomment and use your domain name.
# This parameter is not required if a SigningTable is in use.
# Domain                  DOMAIN.de

# Defines the name of the selector to be used when signing messages.
Selector                default

# Gives the location of a private key to be used for signing ALL messages.
#ORIG (AUSGEKLAMMERT): KeyFile                 /etc/opendkim/keys/default.private
KeyFile                 /etc/opendkim/keys/default.private

# Gives the location of a file mapping key names to signing keys. In simple terms,
# this tells OpenDKIM where to find your keys. If present, overrides any KeyFile
# setting in the configuration file.
KeyTable                 refile:/etc/opendkim/KeyTable

# Defines a table used to select one or more signatures to apply to a message based
# on the address found in the From: header field. In simple terms, this tells
# OpenDKIM how to use your keys.
SigningTable                 refile:/etc/opendkim/SigningTable

# Identifies a set of "external" hosts that may send mail through the server as one
# of the signing domains without credentials as such.
ExternalIgnoreList      refile:/etc/opendkim/TrustedHosts

# Identifies a set internal hosts whose mail should be signed rather than verified.
InternalHosts           refile:/etc/opendkim/TrustedHosts
EN

回答 4

Server Fault用户

发布于 2019-01-31 21:51:40

正如Esa回答的那样,它与OpenDKIM有关。

但是,通过查看服务文件(Ubuntu16.04,使用systemctl),我注意到服务使用位于/etc/default/opendkim中的一个文件

代码语言:javascript
复制
# Command-line options specified here will override the contents of
# /etc/opendkim.conf. See opendkim(8) for a complete list of options.
#DAEMON_OPTS=""
#
# Uncomment to specify an alternate socket
# Note that setting this will override any Socket value in opendkim.conf
# default:
SOCKET="local:/var/run/opendkim/opendkim.sock"
# listen on all interfaces on port 54321:
#SOCKET="inet:54321"
# listen on loopback on port 12345:
#SOCKET="inet:12345@localhost"
# listen on 192.0.2.1 on port 12345:
#SOCKET="inet:12345@192.0.2.1"

注意第6行,它声明这里的设置将覆盖opendkim.conf中的任何套接字值。

我试着简单地注释掉这里的所有行,以便将其还原回配置,但它似乎对我不起作用。

若要解决此问题,请修改文件以将套接字环境变量设置为所需。

代码语言:javascript
复制
# Command-line options specified here will override the contents of
# /etc/opendkim.conf. See opendkim(8) for a complete list of options.
#DAEMON_OPTS=""
#
# Uncomment to specify an alternate socket
# Note that setting this will override any Socket value in opendkim.conf
# default:
#SOCKET="local:/var/run/opendkim/opendkim.sock"
# listen on all interfaces on port 54321:
#SOCKET="inet:54321"
# listen on loopback on port 12345:
SOCKET="inet:8891@localhost"
# listen on 192.0.2.1 on port 12345:
#SOCKET="inet:12345@192.0.2.1"

最后,使用sudo service opendkim restart重新启动opendkim

sudo nano /etc/default/opendkim,编辑SOCKET设置,然后重新启动opendkim。

票数 8
EN

Server Fault用户

发布于 2017-07-01 18:19:28

OpenDKIM是一种不同的服务。看看它是否在运行。你可以试试

代码语言:javascript
复制
sudo service opendkim restart

看看这是否会导致错误。

考虑到您有Socket inet:8891@127.0.0.1,并且后缀正在尝试连接到端口8891,配置似乎还可以。您可以使用netstat -llsof -i来检查OpenDKIM是否确实在监听端口8891

票数 7
EN

Server Fault用户

发布于 2020-09-15 14:48:56

在我的情况下,对于两个不同的Ubuntu和Debian服务器,问题在于opendkim的systemd服务文件损坏了。配置文件是绝对正常的,但是服务文件可能是由旧版本生成的。要重新生成服务文件并重新处理问题,只需运行以下命令:

代码语言:javascript
复制
sudo /lib/opendkim/opendkim.service.generate

再装

代码语言:javascript
复制
sudo systemctl daemon-reload
sudo service opendkim restart

见此处:https://serverfault.com/a/847442/84962

票数 3
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/858879

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档