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 <humbed...@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)
                 
                 -- 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)
                             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

Reply via email to