Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
communication
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
infra
ansible-shared
communication
Commits
e6d391bf
Commit
e6d391bf
authored
1 year ago
by
Hinrikus Wolf
Browse files
Options
Downloads
Patches
Plain Diff
Implement first steps for opendkim
parent
3b3467d4
No related branches found
No related tags found
1 merge request
!22
Implement dkim
Pipeline
#5527
failed
1 year ago
Stage: test
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
postfix/tasks/dkim.yml
+55
-0
55 additions, 0 deletions
postfix/tasks/dkim.yml
postfix/templates/opendkim.conf.j2
+52
-0
52 additions, 0 deletions
postfix/templates/opendkim.conf.j2
with
107 additions
and
0 deletions
postfix/tasks/dkim.yml
0 → 100644
+
55
−
0
View file @
e6d391bf
---
-
name
:
ensure we have opendkim
apt
:
name
:
-
opendkim
-
opendkim-tools
state
:
present
-
name
:
ensure we have keys for any domain
command
:
cmd
:
"
opendkim-genkey
--directory=/etc/dkimkeys
--domain={{
item
}}
--selector={{
item
}}-{{
dkim_selector
}}
--nosubdomains"
creates
:
-
"
/etc/dkimkeys/{{
item
}}-{{
dkim_selector
}}.private"
-
"
/etc/dkimkeys/{{
item
}}-{{
dkim_selector
}}.txt"
become
:
yes
become_user
:
opendkim
loop
:
"
{{
postfix_domains
+
postfix_virtual_domains
}}"
-
name
:
ensure we have a folder for systemd overrides
file
:
state
:
directory
path
:
"
/etc/systemd/system/opendkim.service.d/"
mode
:
'
0755'
owner
:
root
group
:
root
-
name
:
ensure we run the service without root
copy
:
src
:
"
opendkim-systemd-service-override.conf"
dest
:
"
/etc/systemd/system/opendkim.service.d/override.conf"
-
name
:
ensure we have our config
template
:
src
:
"
opendkim.conf.j2"
dest
:
"
/etc/opendkim.conf"
owner
:
root
group
:
root
mode
:
'
0644'
-
name
:
ensure we have the key table
template
:
src
:
"
opendkim-{{
item
}}.j2"
dest
:
"
/etc/dkimkeys/{{
item
}}"
owner
:
root
group
:
root
mode
:
'
0644'
loop
:
-
"
keytable"
-
"
signingtable"
-
"
trustedhosts"
This diff is collapsed.
Click to expand it.
postfix/templates/opendkim.conf.j2
0 → 100644
+
52
−
0
View file @
e6d391bf
# This is a basic configuration for signing and verifying. It can easily be
# adapted to suit a basic installation. See opendkim.conf(5) and
# /usr/share/doc/opendkim/examples/opendkim.conf.sample for complete
# documentation of available configuration parameters.
Syslog yes
SyslogSuccess yes
#LogWhy no
# Common signing and verification parameters. In Debian, the "From" header is
# oversigned, because it is often the identity key used by reputation systems
# and thus somewhat security sensitive.
Canonicalization relaxed/simple
#Mode sv
#SubDomains no
OversignHeaders From
# In Debian, opendkim runs as user "opendkim". A umask of 007 is required when
# using a local socket with MTAs that access the socket as a non-privileged
# user (for example, Postfix). You may need to add user "postfix" to group
# "opendkim" in that case.
UserID opendkim
UMask 007
# Socket for the MTA connection (required). If the MTA is inside a chroot jail,
# it must be ensured that the socket is accessible. In Debian, Postfix runs in
# a chroot in /var/spool/postfix, therefore a Unix socket would have to be
# configured as shown on the last line below.
Socket local:/run/opendkim/opendkim.sock
#Socket inet:8891@localhost
#Socket inet:8891
#Socket local:/var/spool/postfix/opendkim/opendkim.sock
PidFile /run/opendkim/opendkim.pid
# Hosts for which to sign rather than verify, default is 127.0.0.1. See the
# OPERATION section of opendkim(8) for more information.
#InternalHosts 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
# The trust anchor enables DNSSEC. In Debian, the trust anchor file is provided
# by the package dns-root-data.
TrustAnchorFile /usr/share/dns/root.key
#Nameservers 127.0.0.1
# Specify the list of keys
KeyTable file:/etc/dkimkeys/keytable
# Match keys and domains. To use regular expressions in the file, use refile: instead of file:
SigningTable refile:/etc/dkimkeys/signingtable
# Match a list of hosts whose messages will be signed. By default, only localhost is considered as internal host.
InternalHosts refile:/etc/dkimkeys/trustedhosts
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment