Commit 5fe4b1ed authored by Joanne Hugé's avatar Joanne Hugé

Mail server

parent cd72095d
postmaster@ors.local alpha@ors.local
postmaster@ors.local bravo@ors.local
postmaster@ors.local charlie@ors.local
alpha@ors.local ors.local/alpha
bravo@ors.local ors.local/bravo
charlie@ors.local ors.local/charlie
...@@ -19,7 +19,7 @@ md5sum = 06e676a14d64c2aa394bab2849aff687 ...@@ -19,7 +19,7 @@ md5sum = 06e676a14d64c2aa394bab2849aff687
[template-default] [template-default]
_update_hash_filename_ = instance-default.cfg.in _update_hash_filename_ = instance-default.cfg.in
md5sum = 8b5f29e2ae0b6ae846530e6f170d8868 md5sum = 5aef6eb8c5172bcedebb79e47c777284
[dovecot.jinja2.conf] [dovecot.jinja2.conf]
_update_hash_filename_ = dovecot.jinja2.conf _update_hash_filename_ = dovecot.jinja2.conf
...@@ -29,11 +29,11 @@ _update_hash_filename_ = dovecot-passwd.jinja2 ...@@ -29,11 +29,11 @@ _update_hash_filename_ = dovecot-passwd.jinja2
md5sum = 9e895c044984534a330328329b8b8462 md5sum = 9e895c044984534a330328329b8b8462
[dovecot-passdb.jinja2.lua] [dovecot-passdb.jinja2.lua]
_update_hash_filename_ = dovecot-passdb.jinja2.lua _update_hash_filename_ = dovecot-passdb.jinja2.lua
md5sum = 72dbac7b1c282c83ab761efd0770082e md5sum = 060107ee6ad0eb9092529bc2bd1ee52f
[postfix_main.jinja2.cf] [postfix_main.jinja2.cf]
_update_hash_filename_ = postfix_main.jinja2.cf _update_hash_filename_ = postfix_main.jinja2.cf
md5sum = ab88b1d1661d9ae9f7a2032101bdef75 md5sum = b0e5870eb65fe70e01e6787e825b78eb
[postfix_master.jinja2.cf] [postfix_master.jinja2.cf]
_update_hash_filename_ = postfix_master.jinja2.cf _update_hash_filename_ = postfix_master.jinja2.cf
md5sum = 7752a8b4af5c18dc404e0a862af89272 md5sum = 7752a8b4af5c18dc404e0a862af89272
...@@ -45,7 +45,7 @@ _update_hash_filename_ = postfix_mailname.jinja2 ...@@ -45,7 +45,7 @@ _update_hash_filename_ = postfix_mailname.jinja2
md5sum = e7eb11cb4485b0d46f968f612643c1b0 md5sum = e7eb11cb4485b0d46f968f612643c1b0
[postfix_vmailbox.jinja2] [postfix_vmailbox.jinja2]
_update_hash_filename_ = postfix_vmailbox.jinja2 _update_hash_filename_ = postfix_vmailbox.jinja2
md5sum = faa54faeb64809027f8dc38f104f28ea md5sum = b01eb42fd9cecc1fcc9bad85f463eea6
[postfix_virtual.jinja2] [postfix_virtual.jinja2]
_update_hash_filename_ = postfix_virtual.jinja2 _update_hash_filename_ = postfix_virtual.jinja2
md5sum = 1dd7a27d7bc43da4db1d87c44a533dea md5sum = 701c95b5542890034444cf82ecf2a5e3
function auth_passdb_lookup(req) function auth_passdb_lookup(req)
if req.user == "alpha" then return dovecot.auth.PASSDB_RESULT_OK, string.format("password=%s", req.password)
return dovecot.auth.PASSDB_RESULT_OK, "password=pass"
end
return dovecot.auth.PASSDB_RESULT_USER_UNKNOWN, "no such user"
end end
function script_init() function script_init()
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
"$schema": "http://json-schema.org/draft-04/schema", "$schema": "http://json-schema.org/draft-04/schema",
"title": "Input Parameters", "title": "Input Parameters",
"properties": { "properties": {
"hostname": { "mail_domain": {
"default": "ors.rapid.space", "default": "ors.rapid.space",
"title": "Hostname", "title": "Mail domain",
"description": "Hostname", "description": "Mail domain",
"type": "string" "type": "string"
} }
} }
......
...@@ -107,6 +107,18 @@ stop-on-error = true ...@@ -107,6 +107,18 @@ stop-on-error = true
command = '${wrapper-postalias:wrapper-path}' '${typed-paths:aliases}' command = '${wrapper-postalias:wrapper-path}' '${typed-paths:aliases}'
update-command = ${:command} update-command = ${:command}
[{{ section('postmap-virtual') }}]
recipe = plone.recipe.command
stop-on-error = true
command = '${wrapper-postmap:wrapper-path}' '${postfix-virtual:output}'
update-command = ${:command}
[{{ section('postmap-vmailbox') }}]
recipe = plone.recipe.command
stop-on-error = true
command = '${wrapper-postmap:wrapper-path}' '${postfix-vmailbox:output}'
update-command = ${:command}
[postfix-conf-main] [postfix-conf-main]
<= config-base <= config-base
url = {{ postfix_main_template }} url = {{ postfix_main_template }}
...@@ -128,6 +140,7 @@ extra-context = ...@@ -128,6 +140,7 @@ extra-context =
key ip_address slap-configuration:ipv6-random key ip_address slap-configuration:ipv6-random
raw xz_utils_location {{ xz_utils_location }} raw xz_utils_location {{ xz_utils_location }}
raw postfix_location {{ postfix_location }} raw postfix_location {{ postfix_location }}
raw mail_domain {{ slapparameter_dict.get('mail-domain', 'ors.rapid.space') }}
[postfix-conf-master] [postfix-conf-master]
<= config-base <= config-base
...@@ -145,10 +158,14 @@ output = ${directory:etc-postfix}/postfix-mailname ...@@ -145,10 +158,14 @@ output = ${directory:etc-postfix}/postfix-mailname
<= config-base <= config-base
url = {{ postfix_vmailbox_template }} url = {{ postfix_vmailbox_template }}
output = ${directory:etc-postfix}/postfix-vmailbox output = ${directory:etc-postfix}/postfix-vmailbox
extra-context =
raw mail_domain {{ slapparameter_dict.get('mail-domain', 'ors.rapid.space') }}
[postfix-virtual] [postfix-virtual]
<= config-base <= config-base
url = {{ postfix_virtual_template }} url = {{ postfix_virtual_template }}
output = ${directory:etc-postfix}/postfix-virtual output = ${directory:etc-postfix}/postfix-virtual
extra-context =
raw mail_domain {{ slapparameter_dict.get('mail-domain', 'ors.rapid.space') }}
[dovecot-wrapper] [dovecot-wrapper]
recipe = slapos.recipe.template recipe = slapos.recipe.template
......
...@@ -21,6 +21,15 @@ setgid_group = {{ setgid_group }} ...@@ -21,6 +21,15 @@ setgid_group = {{ setgid_group }}
alias_maps = hash:{{ alias_file }} alias_maps = hash:{{ alias_file }}
alias_database = hash:{{ alias_file }} alias_database = hash:{{ alias_file }}
virtual_mailbox_domains = {{ mail_domain }}
virtual_mailbox_base = {{ vhosts_directory }}
virtual_mailbox_maps = hash:{{ vmailbox_file }}
virtual_minimum_uid = 100
virtual_uid_maps = static:1001
virtual_gid_maps = static:1022
virtual_alias_maps = hash:{{ virtual_file }}
virtual_transport = lmtp:unix:private/dovecot-lmtp
inet_interfaces = {{ ip_address }} inet_interfaces = {{ ip_address }}
inet_protocols = all inet_protocols = all
smtp_bind_address = 0.0.0.0 smtp_bind_address = 0.0.0.0
...@@ -34,11 +43,13 @@ smtpd_sasl_type = dovecot ...@@ -34,11 +43,13 @@ smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes smtpd_sasl_auth_enable = yes
# smtpd_recipient_restrictions =
# reject_non_fqdn_recipient
# reject_unknown_recipient_domain
# permit_sasl_authenticated
# reject
smtpd_recipient_restrictions = smtpd_recipient_restrictions =
reject_non_fqdn_recipient
reject_unknown_recipient_domain
permit_sasl_authenticated permit_sasl_authenticated
reject
smtpd_relay_restrictions = smtpd_relay_restrictions =
permit_sasl_authenticated permit_sasl_authenticated
defer_unauth_destination defer_unauth_destination
......
postmaster@{{ mail_domain }} postmaster
@{{ mail_domain }} {{ mail_domain }}/catchall
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment