Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3768520
D3550.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
8 KB
Referenced Files
None
Subscribers
None
D3550.diff
View Options
diff --git a/GIDs b/GIDs
--- a/GIDs
+++ b/GIDs
@@ -2,6 +2,7 @@
828 deployment
829 nasqueron-irc
835 opensearch
+836 opendkim
842 nasqueron-dev-docker
3001 ops
#3002 is intentionally left unassigned
diff --git a/UIDs b/UIDs
--- a/UIDs
+++ b/UIDs
@@ -4,6 +4,7 @@
833 viperserv
834 tc2
835 opensearch
+836 opendkim
3004 mediawiki
6000 mailbox
8000 web-admin
diff --git a/roles/mailserver/dkim/account.sls b/roles/mailserver/dkim/account.sls
new file mode 100644
--- /dev/null
+++ b/roles/mailserver/dkim/account.sls
@@ -0,0 +1,18 @@
+# -------------------------------------------------------------
+# Salt — OpenDKIM configuration
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+# -------------------------------------------------------------
+# OpenDKIM user account
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+opendkim:
+ group.present:
+ - gid: 836
+ user.present:
+ - uid: 836
+ - gid: 836
+ - home: /var/run/milteropendkim
diff --git a/roles/mailserver/dkim/init.sls b/roles/mailserver/dkim/config.sls
copy from roles/mailserver/dkim/init.sls
copy to roles/mailserver/dkim/config.sls
--- a/roles/mailserver/dkim/init.sls
+++ b/roles/mailserver/dkim/config.sls
@@ -27,22 +27,3 @@
- dir_mode: 711
- user: opendkim
- group: opendkim
-
-# -------------------------------------------------------------
-# OpenDKIM binaries
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-opendkim_software:
- pkg.installed:
- - pkgs:
- - opendkim
- {% if grains['os_family'] == 'Debian' %}
- - opendkim-tools
- {% endif %}
-
-opendkim_extra_utilities:
- file.recurse:
- - name: /usr/local/bin
- - source: salt://roles/mailserver/dkim/files/bin
- - dir_mode: 755
- - file_mode: 755
diff --git a/roles/mailserver/dkim/files/bin/get-dkim-dns-entries b/roles/mailserver/dkim/files/bin/get-dkim-dns-entries
deleted file mode 120000
--- a/roles/mailserver/dkim/files/bin/get-dkim-dns-entries
+++ /dev/null
@@ -1 +0,0 @@
-get-dkim-dns-entries.sh
\ No newline at end of file
diff --git a/roles/mailserver/dkim/files/bin/get-dkim-dns-entry b/roles/mailserver/dkim/files/bin/get-dkim-dns-entry
deleted file mode 120000
--- a/roles/mailserver/dkim/files/bin/get-dkim-dns-entry
+++ /dev/null
@@ -1 +0,0 @@
-get-dkim-dns-entry.php
\ No newline at end of file
diff --git a/roles/mailserver/dkim/files/bin/get-dkim-key-table b/roles/mailserver/dkim/files/bin/get-dkim-key-table
deleted file mode 120000
--- a/roles/mailserver/dkim/files/bin/get-dkim-key-table
+++ /dev/null
@@ -1 +0,0 @@
-get-dkim-key-table.sh
\ No newline at end of file
diff --git a/roles/mailserver/dkim/files/bin/get-dkim-signing-table b/roles/mailserver/dkim/files/bin/get-dkim-signing-table
deleted file mode 120000
--- a/roles/mailserver/dkim/files/bin/get-dkim-signing-table
+++ /dev/null
@@ -1 +0,0 @@
-get-dkim-signing-table.sh
\ No newline at end of file
diff --git a/roles/mailserver/dkim/files/rc/milteropendkim.conf b/roles/mailserver/dkim/files/rc/milteropendkim.conf
new file mode 100644
--- /dev/null
+++ b/roles/mailserver/dkim/files/rc/milteropendkim.conf
@@ -0,0 +1,19 @@
+# -------------------------------------------------------------
+# milter-opendkim — rc configuration
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/mailserver/dkim/files/rc/milteropendkim.conf
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+milteropendkim_enable="YES"
+milteropendkim_uid="{{ user }}"
+milteropendkim_gid="{{ group }}"
+milteropendkim_cfgfile="{{ config }}"
diff --git a/roles/mailserver/dkim/init.sls b/roles/mailserver/dkim/init.sls
--- a/roles/mailserver/dkim/init.sls
+++ b/roles/mailserver/dkim/init.sls
@@ -2,47 +2,10 @@
# Salt — OpenDKIM configuration
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
-# Created: 2017-01-14
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
-{% from "map.jinja" import dirs with context %}
-
-# -------------------------------------------------------------
-# OpenDKIM configuration files
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-opendkim_config_files:
- file.recurse:
- - name: {{ dirs.etc }}/opendkim
- - source: salt://roles/mailserver/dkim/files/etc
- - include_empty: True
- - clean: False
- - dir_mode: 711
- - file_mode: 644
-
-opendkim_keys_directory:
- file.directory:
- - name: {{ dirs.etc }}/opendkim/keys
- - dir_mode: 711
- - user: opendkim
- - group: opendkim
-
-# -------------------------------------------------------------
-# OpenDKIM binaries
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-opendkim_software:
- pkg.installed:
- - pkgs:
- - opendkim
- {% if grains['os_family'] == 'Debian' %}
- - opendkim-tools
- {% endif %}
-
-opendkim_extra_utilities:
- file.recurse:
- - name: /usr/local/bin
- - source: salt://roles/mailserver/dkim/files/bin
- - dir_mode: 755
- - file_mode: 755
+include:
+ - .software
+ - .account
+ - .config
diff --git a/roles/mailserver/dkim/service.sls b/roles/mailserver/dkim/service.sls
new file mode 100644
--- /dev/null
+++ b/roles/mailserver/dkim/service.sls
@@ -0,0 +1,26 @@
+# -------------------------------------------------------------
+# Salt — OpenDKIM configuration
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Created: 2017-01-14
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% from "map.jinja" import dirs with context %}
+
+# -------------------------------------------------------------
+# OpenDKIM service
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% if services["manager"] == "rc" %}
+
+/etc/rc.conf.d/milter-opendkim:
+ file.managed:
+ - source: salt://roles/mailserver/dkim/files/rc/milteropendkim.conf
+ - template: jinja
+ - context:
+ user: opendkim
+ group: mail
+ config: {{ dirs.etc }}/opendkim/opendkim.conf
+
+{% endif %}
diff --git a/roles/mailserver/dkim/init.sls b/roles/mailserver/dkim/software.sls
copy from roles/mailserver/dkim/init.sls
copy to roles/mailserver/dkim/software.sls
--- a/roles/mailserver/dkim/init.sls
+++ b/roles/mailserver/dkim/software.sls
@@ -9,27 +9,7 @@
{% from "map.jinja" import dirs with context %}
# -------------------------------------------------------------
-# OpenDKIM configuration files
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-opendkim_config_files:
- file.recurse:
- - name: {{ dirs.etc }}/opendkim
- - source: salt://roles/mailserver/dkim/files/etc
- - include_empty: True
- - clean: False
- - dir_mode: 711
- - file_mode: 644
-
-opendkim_keys_directory:
- file.directory:
- - name: {{ dirs.etc }}/opendkim/keys
- - dir_mode: 711
- - user: opendkim
- - group: opendkim
-
-# -------------------------------------------------------------
-# OpenDKIM binaries
+# OpenDKIM base software
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
opendkim_software:
@@ -40,9 +20,21 @@
- opendkim-tools
{% endif %}
-opendkim_extra_utilities:
- file.recurse:
- - name: /usr/local/bin
- - source: salt://roles/mailserver/dkim/files/bin
- - dir_mode: 755
- - file_mode: 755
+# -------------------------------------------------------------
+# Keys management utilities
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% set utilities = {
+ "get-dkim-dns-entries": "get-dkim-dns-entries.sh",
+ "get-dkim-dns-entry": "get-dkim-dns-entry.php",
+ "get-dkim-key-table": "get-dkim-key-table.sh",
+ "get-dkim-signing-table": "get-dkim-signing-table.sh",
+}
+%}
+
+{% for target, source in utilities.items() %}
+/usr/local/bin/{{ target }}:
+ file.managed:
+ - source: salt://roles/mailserver/dkim/files/bin/{{ source }}
+ - mode: 755
+{% endfor %}
diff --git a/roles/mailserver/init.sls b/roles/mailserver/init.sls
--- a/roles/mailserver/init.sls
+++ b/roles/mailserver/init.sls
@@ -7,5 +7,6 @@
include:
- .dovecot
+ - .dkim
- .postfix
- .vimbadmin
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 08:29 (12 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2259845
Default Alt Text
D3550.diff (8 KB)
Attached To
Mode
D3550: Refresh DKIM unit
Attached
Detach File
Event Timeline
Log In to Comment