「Dkfilter」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(文字列「http://tools.ietf.org/」を「https://tools.ietf.org/」に置換)
(リンクを修正)
 
(2人の利用者による、間の4版が非表示)
1行目: 1行目:
[[Category:インタネットアプリケション]]
+
[[Category:ルサーバー]]
[[en:DomainKeys]]
+
[[en:Dkfilter]]
{{Note|DomainKeys [[OpenDKIM]] に取って代わっています。}}
+
{{Note|DomainKeys has been obsoleted by DKIM, use [[OpenDKIM]].}}
   
  +
[http://jason.long.name/dkfilter/ Dkfilter] is a [[Wikipedia:DomainKeys|DomainKeys]] filter for [[Postfix]].
DomainKeys は電子メール署名・検証技術です。RFC で公開されており多数のメールサーバーによってサポートされています (yahoo や google など)。
 
   
  +
== What is it? ==
送信者は秘密鍵を使ってメールに署名をして、受信者は DNS から公開鍵を要求して検証を行います。検証によってメールの送信者を確認することができます。詳しくは [https://tools.ietf.org/html/rfc4870 RFC 4870] を見てください。
 
  +
  +
It is digital email signing/verification technology, which included into RFCs and already supported by many mail servers. (For example yahoo, google, etc).
  +
  +
=== How it works? ===
  +
  +
Sender signs email with private key.
  +
  +
Receiver gets signed email, request public key from DNS and verify it.
  +
  +
So you can check who actualy sent this email.
  +
  +
See [[RFC:4870|RFC 4870]] for more information.
   
 
== インストール ==
 
== インストール ==

2022年1月12日 (水) 12:23時点における最新版

ノート: DomainKeys has been obsoleted by DKIM, use OpenDKIM.

Dkfilter is a DomainKeys filter for Postfix.

What is it?

It is digital email signing/verification technology, which included into RFCs and already supported by many mail servers. (For example yahoo, google, etc).

How it works?

Sender signs email with private key.

Receiver gets signed email, request public key from DNS and verify it.

So you can check who actualy sent this email.

See RFC 4870 for more information.

インストール

dkfilter パッケージをインストールしてください。

デフォルトでは dkfilter ユーザーとグループを追加する必要があります。追加したくない場合、/etc/conf.d/dkfilter を編集して DKFILTER_USERDKFILTER_GROUP を書き換えてください。

設定

  • 鍵を生成:
$ openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out private.key
$ openssl rsa -in private.key -pubout -out public.key
  • /etc/conf.d/dkfilter を編集してください。
  • セレクタと鍵を記述した DNS レコードを追加 (/etc/conf.d/dkfilter の DKFILTER_SELECTOR を参照、ランダムな名前を使うこともできます):
server1._domainkey IN TXT "k=rsa; p=MHwwDQYJK ... OprwIDAQAB; t=y"
  • dkfilter-in.servicedkfilter-out.service起動してください。

Postfix の統合

Inbound フィルター

Inbound フィルターはポート 10025 から接続を受け取ってフィルタリングしたデータをポート 10026 から出力します (Inbound フィルターはデータを削除せず、メールに検証結果を追加します)。

/etc/postfix/master.cf に以下を追加:

#
# Before-filter SMTP server. Receive mail from the network and
# pass it to the content filter on localhost port 10025.
#
smtp      inet  n       -       n       -       -       smtpd
    -o smtpd_proxy_filter=127.0.0.1:10025
    -o smtpd_client_connection_count_limit=10
#
# After-filter SMTP server. Receive mail from the content filter on
# localhost port 10026.
#
127.0.0.1:10026 inet n  -       n       -        -      smtpd
    -o smtpd_authorized_xforward_hosts=127.0.0.0/8
    -o smtpd_client_restrictions=
    -o smtpd_helo_restrictions=
    -o smtpd_sender_restrictions=
    -o smtpd_recipient_restrictions=permit_mynetworks,reject
    -o smtpd_data_restrictions=
    -o mynetworks=127.0.0.0/8
    -o receive_override_options=no_unknown_recipient_checks

Outbound フィルター

Outbound フィルターはポート 10027 から接続を受け取って署名済みデータをポート 10028 に出力します。

/etc/postfix/master.cf に以下を追加:

#
# modify the default submission service to specify a content filter
# and restrict it to local clients and SASL authenticated clients only
#
submission  inet  n     -       n       -       -       smtpd
    -o smtpd_etrn_restrictions=reject
    -o smtpd_sasl_auth_enable=yes
    -o content_filter=dksign:[127.0.0.1]:10027
    -o receive_override_options=no_address_mappings
    -o smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject

#
# specify the location of the DomainKeys signing filter
#
dksign    unix  -       -       n       -       10      smtp
    -o smtp_send_xforward_command=yes
    -o smtp_discard_ehlo_keywords=8bitmime

#
# service for accepting messages FROM the DomainKeys signing filter
#
127.0.0.1:10028 inet  n  -      n       -       10      smtpd
    -o content_filter=
    -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
    -o smtpd_helo_restrictions=
    -o smtpd_client_restrictions=
    -o smtpd_sender_restrictions=
    -o smtpd_recipient_restrictions=permit_mynetworks,reject
    -o mynetworks=127.0.0.0/8
    -o smtpd_authorized_xforward_hosts=127.0.0.0/8