From 6228490c5313a38efbe4c66934fe9aaddbd5347f Mon Sep 17 00:00:00 2001 From: Yannik Sembritzki Date: Thu, 14 May 2020 10:48:00 +0200 Subject: [PATCH] Allow different from email than smtp user --- README.md | 4 +++- templates/sender_canonical_maps | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 374c77b..f63a6e4 100644 --- a/README.md +++ b/README.md @@ -42,8 +42,10 @@ Role Variables * `relaymail_smtp_user`: username to authenticate with at the relaying mailserver (required) * Example: `user@example.org` * `relaymail_smtp_password`: password to authenticate with at the rayling mailserver (required) -* `relaymail_force_from_address`: force the from address to be the `relaymail_smtp_user` +* `relaymail_force_from_address`: force the from address to `relaymail_smtp_user` or `relaymail_from_address` if it is defined * Default: `true` +* `relaymail_from_address`: optional from address to be used by `relaymail_force_from_address` instead of `relaymail_smtp_user` + * Example: `user` or `user@example.com` * `relaymail_overwrite_to`: `all` overwrites the to address for all emails, `local` overwrites the to address for emails addressed to local users, `none` does never overwrite the to address * Default: `all` * `relaymail_overwrite_to_target`: email address which mails with overwritten to should be sent to (required when `relaymail_overwrite_to` is not `none`) diff --git a/templates/sender_canonical_maps b/templates/sender_canonical_maps index a699011..d624efd 100644 --- a/templates/sender_canonical_maps +++ b/templates/sender_canonical_maps @@ -1,3 +1,3 @@ #{{ ansible_managed }} -/.+/ {{ relaymail_smtp_user }} +/.+/ {{ relaymail_from_address|default(relaymail_smtp_user) }}