You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2016/12/18 02:15:41 UTC

[1/2] incubator-ponymail git commit: Clear the fields before potential anonymization

Repository: incubator-ponymail
Updated Branches:
  refs/heads/master ff97e6726 -> 00bd1ae2c


Clear the fields before potential anonymization

Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/6284d7ea
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/6284d7ea
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/6284d7ea

Branch: refs/heads/master
Commit: 6284d7eaf750540f28cb09514502a9d931fbacd5
Parents: ff97e67
Author: Sebb <se...@apache.org>
Authored: Sun Dec 18 02:15:00 2016 +0000
Committer: Sebb <se...@apache.org>
Committed: Sun Dec 18 02:15:00 2016 +0000

----------------------------------------------------------------------
 site/api/email.lua | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/6284d7ea/site/api/email.lua
----------------------------------------------------------------------
diff --git a/site/api/email.lua b/site/api/email.lua
index 1b4677c..64eec36 100644
--- a/site/api/email.lua
+++ b/site/api/email.lua
@@ -84,6 +84,14 @@ function handle(r)
             -- Or do we just want the email itself?
             else
                 local eml = utils.extractCanonEmail(doc.from or "unknown")
+
+                -- Anonymize to/cc if full_headers is false
+                -- do this before anonymizing the headers
+                if not config.full_headers or not account then
+                    doc.to = nil
+                    doc.cc = nil
+                end      
+
                 if not account then -- anonymize email address if not logged in
                     doc = utils.anonymizeHdrs(doc, true)
                 end
@@ -94,11 +102,6 @@ function handle(r)
                 end
                 
                 
-                -- Anonymize to/cc if full_headers is false
-                if not config.full_headers or not account then
-                    doc.to = nil
-                    doc.cc = nil
-                end      
                 doc.gravatar = r:md5(eml:lower())
                 r:puts(JSON.encode(doc))
                 return cross.OK


[2/2] incubator-ponymail git commit: Function moved to utils

Posted by se...@apache.org.
Function moved to utils

Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/00bd1ae2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/00bd1ae2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/00bd1ae2

Branch: refs/heads/master
Commit: 00bd1ae2c08fb6d2c542ada8f17f290dc56702ae
Parents: 6284d7e
Author: Sebb <se...@apache.org>
Authored: Sun Dec 18 02:15:25 2016 +0000
Committer: Sebb <se...@apache.org>
Committed: Sun Dec 18 02:15:25 2016 +0000

----------------------------------------------------------------------
 site/api/stats.lua | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/00bd1ae2/site/api/stats.lua
----------------------------------------------------------------------
diff --git a/site/api/stats.lua b/site/api/stats.lua
index cfed0ac..6740b76 100644
--- a/site/api/stats.lua
+++ b/site/api/stats.lua
@@ -606,7 +606,7 @@ function handle(r)
             h = h + 1
 
             -- This is needed by ths slow_count method            
-            local eml = extractCanonEmail(email.from)
+            local eml = utils.extractCanonEmail(email.from)
             local gravatar = r:md5(eml:lower())
             email.gravatar = gravatar
 
@@ -707,7 +707,7 @@ function handle(r)
             end
         elseif config.slow_count then
             for k, v in pairs(top10) do
-                if v.email == extractCanonEmail(email.from) then
+                if v.email == utils.extractCanonEmail(email.from) then
                     v.count = v.count - 1
                     break -- don't count the e-mail again
                 end