[PATCH 4 of 6] email: allow specifying a different noreply email than app_email_from

Mads Kiilerich mads at kiilerich.com
Wed Sep 2 17:46:01 UTC 2015


This is getting more clear and easier to review - thanks!


On 09/01/2015 06:28 PM, Thomas De Schampheleire wrote:
> # HG changeset patch
> # User Thomas De Schampheleire <thomas.de.schampheleire at gmail.com>
> # Date 1441051494 -7200
> #      Mon Aug 31 22:04:54 2015 +0200
> # Node ID 3ca9738eb4f87f38b99404a1eda22fb889e2d0d9
> # Parent  6f6acca6da4ad913f45eb18441575ea04d27eedd
> email: allow specifying a different noreply email than app_email_from

Perhaps make it more clear what config setting you are introducing.

> The configuration setting app_email_from is currently used both for the SMTP
> envelope sender as for the From header inside the email (what mail clients
> show). It is recommended to use an anonymous but monitored address here.
> However, when no such mailbox can be created (e.g. due to corporate
> IT rules), app_email_from would need to be set to that of a real (admin)
> user. As this address would then be used in the From header of various
> emails, to which users could be tempted to reply to, the admin user would
> unwillingly be spammed with such reply mails (including out-of-office
> mails).
>
> Instead, add an extra configuration setting app_email_noreply that is used
> for the From header. Setting app_email_from remains being used for the SMTP
> envelope.
>
> diff --git a/development.ini b/development.ini
> --- a/development.ini
> +++ b/development.ini
> @@ -24,13 +24,23 @@ pdebug = false
>   ## validation and spam filtering in mail servers.                             ##
>   ################################################################################
>   
> -## 'From' header for application emails. You can optionally add a name.
> +## SMTP envelope sender for application emails.
> +## This setting also provides the default for app_email_noreply.
>   ## Default:
>   #app_email_from = Kallithea
>   ## Examples:
>   #app_email_from = Kallithea <kallithea-noreply at example.com>
>   #app_email_from = kallithea-noreply at example.com
>   
> +## 'From' header for application emails. You can optionally add a name.
> +## Defaults to the value of app_email_from.
> +## This setting is only useful if you cannot use the value of app_email_from
> +## for app_email_noreply, for example because app_email_from is not an anonymous
> +## address and you do not wish it to be visible to recipients of email.
> +## Examples:
> +#app_email_noreply = Kallithea <kallithea-noreply at example.com>
> +#app_email_noreply = kallithea-noreply at example.com

"noreply" feels wrong. "noreply" is just a policy thing and one way of 
using it. It could also go to a place where replies actually are handled.

Also, comparing the names "app_email_noreply" and "app_email_from", it 
is far from obvious which is which.

One of them could perhaps be "app_email_envelope_from", 
"app_envelope_from", or perhaps even better something with "bounce" 
(which might be a more user friendly explanation of "envelope from"). 
(Alternatively, considering this is for smtp and very close to the smtp 
settings like smtp_username, it could perhaps be smtp_from?)

These also suggests that the existing header should be preserved for the 
email address users can see and know: the from header. Also because that 
is where people are used to specify a name. It could be clarified that 
the new envelope from config only will use the email address.

What are your thoughts about that?

>   ## Subject prefix for application emails.
>   ## A space between this prefix and the real subject is automatically added.
>   ## Default:
> diff --git a/docs/usage/email.rst b/docs/usage/email.rst
> --- a/docs/usage/email.rst
> +++ b/docs/usage/email.rst
> @@ -35,14 +35,23 @@ When Kallithea wants to send an email bu
>   determine the intended recipients, the administrators and the addresses
>   specified in ``email_to`` in the configuration file are used as fallback.
>   
> -Recipients will see these emails originating from the sender specified in the
> -``app_email_from`` setting in the configuration file. This setting can either
> +The email address used as the SMTP envelope sender -- a technical address which
> +is not visible to the recipients of the email

but is used for bounce processing.

> -- is specified in the
> +``app_email_from`` setting in the configuration file.  This setting can either
> +contain only an email address, like `kallithea-noreply at example.com`, or both a
> +name and an address in the following format: `Kallithea
> +<kallithea-noreply at example.com>`.
> +
> +Recipients will see application emails originating from the sender specified in
> +the ``app_email_noreply`` setting in the configuration file, which defaults to
> +the value of ``app_email_from`` and thus normally need not be set explicitly if
> +``app_email_from`` is already set. This setting can either
>   contain only an email address, like `kallithea-noreply at example.com`, or both
>   a name and an address in the following format: `Kallithea
>   <kallithea-noreply at example.com>`. However, if the email is sent due to an
>   action of a particular user, for example when a comment is given or a pull
>   request created, the name of that user will be combined with the email address
> -specified in ``app_email_from`` to form the sender (and any name part in that
> +specified in ``app_email_noreply`` to form the sender (and any name part in that
>   configuration setting disregarded).
>   
>   The subject of these emails can optionally be prefixed with the value of
>



More information about the kallithea-general mailing list