You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ponymail.apache.org by sebb <se...@gmail.com> on 2019/07/09 20:00:47 UTC

Re: [incubator-ponymail] branch master updated: Fix FROM header and MTA command so emails will get through.

On Tue, 9 Jul 2019 at 10:57, <hu...@apache.org> wrote:
>
> This is an automated email from the ASF dual-hosted git repository.
>
> humbedooh pushed a commit to branch master
> in repository https://gitbox.apache.org/repos/asf/incubator-ponymail.git
>
>
> The following commit(s) were added to refs/heads/master by this push:
>      new d1ec976  Fix FROM header and MTA command so emails will get through.
> d1ec976 is described below
>
> commit d1ec976464886f8e63b7440abbf1c74d8d8b8553
> Author: Daniel Gruno <hu...@apache.org>
> AuthorDate: Tue Jul 9 11:57:33 2019 +0200
>
>     Fix FROM header and MTA command so emails will get through.
>
>     This fixes #496.
> ---
>  site/api/compose.lua | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/site/api/compose.lua b/site/api/compose.lua
> index e2ce560..cb36683 100644
> --- a/site/api/compose.lua
> +++ b/site/api/compose.lua
> @@ -63,13 +63,13 @@ function handle(r)
>                      fname = account.preferences.fullname
>                  end
>                  -- construct sender name+address
> -                local fr = ([["%s"<%s>]]):format(fname or account.credentials.fullname, account.credentials.email)
> +                local fr = ([[%s<%s>]]):format(fname or account.credentials.fullname, account.credentials.email)

Shouldn't there be a space between the display name and the address?
Also, surely display names must be quoted if they contain a non-atomic
character?

>                  -- Using alt email??
>                  if account.credentials.altemail and post.alt then
>                      for k, v in pairs(account.credentials.altemail) do
>                          if v.email == post.alt then
> -                            fr = ([["%s"<%s>]]):format(fname or account.credentials.fullname, v.email)
> +                            fr = ([[%s<%s>]]):format(fname or account.credentials.fullname, v.email)

Ditto

>                              break
>                          end
>                      end
> @@ -114,7 +114,7 @@ function handle(r)
>
>                  -- send email!
>                  local rv, er = smtp.send{
> -                    from = fr,
> +                    from = fr:gsub(".-<", "<"), -- MTAs only need the email address in MAIL FROM, cut out the name.
>                      rcpt = to,
>                      source = source,
>                      server = config.mailserver
>