1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【Opendkimが起動しない】Error compiling regular expression

Posted at

はじめに

迷惑メール対策として、dkim認証の設定をしopendkimを再起動しようとしたら、下記のエラーが出て再起動できない・・・!

# journalctl -xe ※もろもろ省略
Error compiling regular expression

#調査内容
# systemctl status opendkim -lで状態の詳細を確認

# journalctl -xeでログ確認
Error compiling regular expressionというエラーログ発見!

/etc/opendkim.confの確認

/etc/opendkim/KeyTableの確認
→記載内容があっているか確認

/etc/opendkim/SigningTableの確認
→記載内容があっているか確認

/etc/opendkim/keys配下を確認
→所有者・所有グループがopendkimか、権限が600になっているか

原因

/etc/opendkim/SigningTableに不要なものが記載されていました。。。
→再起動をした際に、設定ファイルの読み取りができなくてエラーとなっていたようです。

実際のファイルはこちら↓

# cat SigningTable.backup
=============================================


# OPENDKIM TRUSTED HOSTS
# To use this file, uncomment the #ExternalIgnoreList and/or the #InternalHosts
# option in /etc/opendkim.conf then restart OpenDKIM. Additional hosts
# may be added on separate lines (IP addresses, hostnames, or CIDR ranges).
# The localhost IP (127.0.0.1) should always be the first entry in this file.
127.0.0.1
::1
#host.example.com
#192.168.1.0/24
[root@ip-172-31-9-177 opendkim]#           ←★ここから
[root@ip-172-31-9-177 opendkim]#
[root@ip-172-31-9-177 opendkim]#
[root@ip-172-31-9-177 opendkim]# cat SigningTable  ←★ここまで 
# OPENDKIM SIGNING TABLE
# This table controls how to apply one or more signatures to outgoing messages based
# on the address found in the From: header field. In simple terms, this tells
# OpenDKIM "how" to apply your keys.

# To use this file, uncomment the SigningTable option in /etc/opendkim.conf,
# then uncomment one of the usage examples below and replace example.com with your
# domain name, then restart OpenDKIM.

# WILDCARD EXAMPLE
# Enables signing for any address on the listed domain(s), but will work only if
# "refile:/etc/opendkim/SigningTable" is included in /etc/opendkim.conf.
# Create additional lines for additional domains.

# NON-WILDCARD EXAMPLE
# If "file:" (instead of "refile:") is specified in /etc/opendkim.conf, then
# wildcards will not work. Instead, full user@host is checked first, then simply host,
# then user@.domain (with all superdomains checked in sequence, so "foo.example.com"
# would first check "user@foo.example.com", then "user@.example.com", then "user@.com"),
# then .domain, then user@*, and finally *. See the opendkim.conf(5) man page under
# "SigningTable" for more details.

#example.com default._domainkey.example.com
*@メールドメイン default._domainkey.メールドメイン

全く覚えていないですが、変なのが入っていましたw
気が付かないうちにコピーし、貼り付けていました。。。。

解決策

不要な記載を削除して、opendkimを再起動すれば正常に起動します。

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?