Różnice pomiędzy wersjami 2 i 3
⇤ ← Wersja 2 z 2014-03-29 22:49:01 →
Rozmiar: 5257
Edytor: wtps0n
Komentarz: aktualizacja po instalacji w środowisku 9.x
← Wersja 3 z 2014-03-29 22:54:34 → ⇥
Rozmiar: 5312
Edytor: wtps0n
Komentarz: zmiana domyślnej ścieżki pliku konfiguracyjnego
Usunięcia zostały oznaczone w ten sposób. Dodatki zostały oznaczone w ten sposób.
Linia 31: Linia 31:
cd /usr/local/etc/mail/
cp
opendkim.conf.sample opendkim.conf
cd /usr/local/etc/
cp
mail/opendkim.conf.sample opendkim.conf
Linia 165: Linia 165:
milteropendkim_cfgfile="/usr/local/etc/opendkim.conf"

Konfiguracja OpenDKIM

Dawny milter-dkim zmienił się w OpenDKIM. Zasada działania jest ta sama, plik konfiguracyjny niemalże identyczny. Ale kilka zmian jest.

Instalacja

Wykorzystując niniejsze wiki, w systemie nie ma śladu po sendmailu wraz z biblioteką milter (libmilter). Niemniej skutkuje to potrzebą zainstalowania sendmaila z ports, czyli konflikt z postfixem. Dlatego też można "ręcznie" (nie jest to make buildworld) dokompilować oraz doinstalować libmilter.

Kolejnym krokiem jest zainstalowania OpenDKIM.

Instalacja libmilter ze źródeł systemu

cd /usr/src/lib/libmilter/
make all install

Instalacja samego OpenDKIM

cd /usr/ports/mail/opendkim
make config
# Wybrać opcje: FILTER OPENLDAP QUERY_CACHE STATS STOCK_RESOLVER
# jeżeli lokalnie jest unbound, to można w ostatniej opcji wybrać opcję UNBOUND
make all install clean

Plik konfiguracyjny

cd /usr/local/etc/
cp mail/opendkim.conf.sample opendkim.conf
mkdir -p /var/db/milteropendkim/
touch /var/db/milteropendkim/example.private
chown -R mailnull:mailnull /var/db/milteropendkim/
chmod 0600 /var/db/milteropendkim/example.private

Nałożenie patchy

--- opendkim.conf.sample        2012-01-30 12:40:13.000000000 +0100
+++ opendkim.conf       2012-01-30 12:49:45.000000000 +0100
@@ -106,7 +106,7 @@
 ##
 ##  Indicate whether or not the filter should run in the background.

-# Background           Yes
+Background             Yes

 ##  BaseDirectory path
 ##     default (none)
@@ -115,7 +115,7 @@
 ##  operation.  Thus, cores will be dumped here and configuration files
 ##  are read relative to this location.

-# BaseDirectory                /var/run/opendkim
+BaseDirectory          /var/run/milteropendkim

 ##  BodyLengthDB dataset
 ##     default (none)
@@ -133,7 +133,7 @@
 ##  omitted, "simple" is used.  Valid values for each are "simple" and
 ##  "relaxed".

-# Canonicalization     simple/simple
+Canonicalization       simple/simple

 ##  ClockDrift n
 ##     default 300
@@ -174,7 +174,7 @@
 ##  Specify for which domain(s) signing should be done.  No default; must
 ##  be specified for signing.

-Domain                 example.com
+Domain                 bsdserwis.com

 ##  DomainKeysCompat { yes | no }
 ##     default "no"
@@ -191,7 +191,7 @@
 ##  Gives a list of recipient addresses or address patterns whose mail should
 ##  not be signed.

-# DontSignMailTo       addr1,addr2,...
+DontSignMailTo *

 ##  EnableCoredumps { yes | no }
 ##     default "no"
@@ -214,7 +214,7 @@
 ##  Requests that the library convert "naked" CR and LF characters to
 ##  CRLFs during canonicalization.  The default is "no".

-# FixCRLF              no
+FixCRLF                no

 ##  InternalHosts dataset
 ##     default "127.0.0.1"
@@ -241,7 +241,7 @@
 ##  SigningTable and KeyTable are used.  No default; must be specified for
 ##  signing if SigningTable/KeyTable are not in use.

-KeyFile                        /var/db/dkim/example.private
+KeyFile                        /var/db/milteropendkim/example.private

 ##  KeyTable dataset
 ##     default (none)
@@ -658,7 +658,7 @@
 ##
 ##  Log informational and error activity to syslog?

-# Syslog               No
+Syslog         No

 ##  SyslogFacility      facility
 ##     default "mail"
@@ -684,7 +684,7 @@
 ##  Specifies which directory will be used for creating temporary files
 ##  during message processing.

-# TemporaryDirectory   /var/tmp
+TemporaryDirectory     /var/tmp

 ##  TestPublicKeys filename
 ##     default (none)
@@ -710,7 +710,7 @@
 ##  The system has its own default which will be used (usually 022).
 ##  See the umask(2) man page for more information.

-# UMask                        022
+UMask                  022

 ##  UnboundConfigFile filename
 ##     default (none)
@@ -737,4 +737,4 @@
 ##  Add an X- header to messages passing through this filter to identify
 ##  messages it has processed.

-# X-Header             No
+X-Header               Yes

Alternatywa: krótki plik konfiguracyjny

Jak już odfiltrować wszelkie komentarze, to plik konfiguracyjny sprowadza się do kilku linijek:

Background              Yes
BaseDirectory           /var/run/milteropendkim
Canonicalization        simple/simple
Domain                  gdbd.pl
DontSignMailTo          *
FixCRLF                 no
KeyFile                 /var/db/milteropendkim/example.private
Selector                gdbd-dkim-signer
Socket                  inet:3322@127.0.0.1
Syslog                  No
TemporaryDirectory      /var/tmp
UMask                   022
X-Header                Yes

Dodanie do rc.conf

milteropendkim_enable="NO"
milteropendkim_domain="wtp3.org,modlin.wtp3.org"
milteropendkim_flags="-b v -c simple/simple"
milteropendkim_socket="inet:3322@127.0.0.1"
milteropendkim_cfgfile="/usr/local/etc/opendkim.conf"

Uruchomienie usługi poprzez deamontools

(To już było na stronie głównej)


A reszta to już kwestia postfixa

MilterOpenDkim (ostatnio edytowane 2023-10-07 09:32:55 przez wtps0n)