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/17 19:25:25 UTC
[1/5] incubator-ponymail git commit: More API
Repository: incubator-ponymail
Updated Branches:
refs/heads/master 2994eb1a4 -> 9ce995e26
More API
Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/6c9398be
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/6c9398be
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/6c9398be
Branch: refs/heads/master
Commit: 6c9398be7d07e0afaefd7a0e1006126c6196375c
Parents: 2994eb1
Author: Sebb <se...@apache.org>
Authored: Sat Dec 17 16:37:17 2016 +0000
Committer: Sebb <se...@apache.org>
Committed: Sat Dec 17 16:37:17 2016 +0000
----------------------------------------------------------------------
docs/API.md | 10 ++++++++++
1 file changed, 10 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/6c9398be/docs/API.md
----------------------------------------------------------------------
diff --git a/docs/API.md b/docs/API.md
index ef195f9..0d868a1 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -176,3 +176,13 @@ Response example:
}
~~~
+### Fetching a month's data as an mbox file
+Usage:
+`GET /api/mbox.lua?list=issues@ponymail.apache.org&date=2016-06`
+
+Response example:
+
+~~~
+TBA
+~~~
+
[2/5] incubator-ponymail git commit: allow preferences to use
non-default mail port
Posted by se...@apache.org.
allow preferences to use non-default mail port
This fixes #303
Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/ae7669f8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/ae7669f8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/ae7669f8
Branch: refs/heads/master
Commit: ae7669f8ed5c2689617db27e9399e507344f2cbd
Parents: 6c9398b
Author: Sebb <se...@apache.org>
Authored: Sat Dec 17 17:28:25 2016 +0000
Committer: Sebb <se...@apache.org>
Committed: Sat Dec 17 17:28:25 2016 +0000
----------------------------------------------------------------------
CHANGELOG.md | 1 +
site/api/preferences.lua | 3 ++-
tools/setup.py | 1 +
3 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/ae7669f8/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7ff6249..46ca9c2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -79,6 +79,7 @@
- ponymail.js uses unsupported preferences.lua parameter (#165)
- preferences.lua never fetches descriptions (#163)
- API.md does not document all the stats.lua parameters (#115)
+- allow preferences to use non-default mail port (#303)
## CHANGES in 0.9b:
http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/ae7669f8/site/api/preferences.lua
----------------------------------------------------------------------
diff --git a/site/api/preferences.lua b/site/api/preferences.lua
index f585833..0f95fbb 100644
--- a/site/api/preferences.lua
+++ b/site/api/preferences.lua
@@ -112,7 +112,8 @@ Pony Mail - Email for Ponies and People.
from = ("\"Pony Mail\"<no-reply@%s>"):format(r.hostname),
rcpt = get.associate,
source = source,
- server = config.mailserver
+ server = config.mailserver,
+ port = config.mailport or nil -- if not specified, use the default
}
r:puts(JSON.encode{requested = rv or er})
return cross.OK
http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/ae7669f8/tools/setup.py
----------------------------------------------------------------------
diff --git a/tools/setup.py b/tools/setup.py
index efb74b1..aa34c2b 100755
--- a/tools/setup.py
+++ b/tools/setup.py
@@ -465,6 +465,7 @@ with open(os.path.join(config_path,config_file), "w") as f:
local config = {
es_url = "http://%s:%u/%s/",
mailserver = "%s",
+-- mailport = 1025, -- override the default port (25)
accepted_domains = "%s",
wordcloud = %s,
slow_count = false,
[3/5] incubator-ponymail git commit: preferences.lua should not
return list data if it was not requested
Posted by se...@apache.org.
preferences.lua should not return list data if it was not requested
This fixes #305
Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/54b7d52a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/54b7d52a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/54b7d52a
Branch: refs/heads/master
Commit: 54b7d52a3a753d12cdbbce5a19e7de451c995b15
Parents: ae7669f
Author: Sebb <se...@apache.org>
Authored: Sat Dec 17 19:00:24 2016 +0000
Committer: Sebb <se...@apache.org>
Committed: Sat Dec 17 19:00:24 2016 +0000
----------------------------------------------------------------------
CHANGELOG.md | 1 +
site/api/preferences.lua | 14 +++++++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/54b7d52a/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 46ca9c2..645366d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -80,6 +80,7 @@
- preferences.lua never fetches descriptions (#163)
- API.md does not document all the stats.lua parameters (#115)
- allow preferences to use non-default mail port (#303)
+- preferences.lua should not return list data if it was not requested (#305)
## CHANGES in 0.9b:
http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/54b7d52a/site/api/preferences.lua
----------------------------------------------------------------------
diff --git a/site/api/preferences.lua b/site/api/preferences.lua
index 0f95fbb..b6552e1 100644
--- a/site/api/preferences.lua
+++ b/site/api/preferences.lua
@@ -210,7 +210,19 @@ Pony Mail - Email for Ponies and People.
r:puts[[{"saved": true}]]
return cross.OK
end
-
+
+ -- don't allow failed options to drop-thru
+ for _, v in pairs({'associate', 'verify', 'removealt', 'save', 'addfav', 'remfav'}) do
+ if get['header_' .. v] then
+ if not account then
+ r:puts(JSON.encode{error="Not logged in"})
+ else
+ r:puts(JSON.encode{error="Missing or invalid parameter(s)"})
+ end
+ return cross.OK
+ end
+ end
+
-- Get lists (cached if possible)
local lists = {}
local NOWISH = math.floor(os.time() / 600)
[4/5] incubator-ponymail git commit: preferences.lua should not save
user account if the mail is not sent
Posted by se...@apache.org.
preferences.lua should not save user account if the mail is not sent
This fixes #306
Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/55a2658f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/55a2658f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/55a2658f
Branch: refs/heads/master
Commit: 55a2658f5713c093123d46acda5314c9b0c984f0
Parents: 54b7d52
Author: Sebb <se...@apache.org>
Authored: Sat Dec 17 19:05:53 2016 +0000
Committer: Sebb <se...@apache.org>
Committed: Sat Dec 17 19:05:53 2016 +0000
----------------------------------------------------------------------
CHANGELOG.md | 1 +
site/api/preferences.lua | 9 ++++++---
2 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/55a2658f/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 645366d..f0eb8e3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -81,6 +81,7 @@
- API.md does not document all the stats.lua parameters (#115)
- allow preferences to use non-default mail port (#303)
- preferences.lua should not return list data if it was not requested (#305)
+- preferences.lua should not update the user account if the mail is not sent OK (#306)
## CHANGES in 0.9b:
http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/55a2658f/site/api/preferences.lua
----------------------------------------------------------------------
diff --git a/site/api/preferences.lua b/site/api/preferences.lua
index b6552e1..71fbb8a 100644
--- a/site/api/preferences.lua
+++ b/site/api/preferences.lua
@@ -74,9 +74,6 @@ function handle(r)
end
local hash = r:md5(math.random(1,999999) .. os.time() .. account.cid)
- account.credentials.altemail = account.credentials.altemail or {}
- table.insert(account.credentials.altemail, { email = get.associate, hash = hash, verified = false})
- user.save(r, account, true)
local scheme = "https"
if r.port == 80 then
scheme = "http"
@@ -115,6 +112,12 @@ Pony Mail - Email for Ponies and People.
server = config.mailserver,
port = config.mailport or nil -- if not specified, use the default
}
+ -- only update the account if the mail was sent OK
+ if rv then
+ account.credentials.altemail = account.credentials.altemail or {}
+ table.insert(account.credentials.altemail, { email = get.associate, hash = hash, verified = false})
+ user.save(r, account, true)
+ end
r:puts(JSON.encode{requested = rv or er})
return cross.OK
end
[5/5] incubator-ponymail git commit: Docn
Posted by se...@apache.org.
Docn
Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/9ce995e2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/9ce995e2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/9ce995e2
Branch: refs/heads/master
Commit: 9ce995e2622a1b0c40d7a70dd41aa9bf9c3fb1d7
Parents: 55a2658
Author: Sebb <se...@apache.org>
Authored: Sat Dec 17 19:24:01 2016 +0000
Committer: Sebb <se...@apache.org>
Committed: Sat Dec 17 19:24:01 2016 +0000
----------------------------------------------------------------------
site/api/preferences.lua | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/9ce995e2/site/api/preferences.lua
----------------------------------------------------------------------
diff --git a/site/api/preferences.lua b/site/api/preferences.lua
index 71fbb8a..54a6834 100644
--- a/site/api/preferences.lua
+++ b/site/api/preferences.lua
@@ -34,7 +34,7 @@ Parameters: (cookie required)
- associate=$email - associate the account with the $email address
- verify&hash=$hash - verify an association request $hash
- removealt=$email - remove an alternate $email address
- - save - save preferences
+ - save - save preferences as specified (does not merge)
- addfav=$list - add a favourite $list
- remfav=$list - remove a favourite $list
]]--