public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: [pmg-devel] [PATCH pmg-api/pmg-gui] allow / in local part of pmg-email-address
Date: Fri, 15 Jan 2021 10:46:20 +0100	[thread overview]
Message-ID: <20210115094626.25440-1-s.ivanov@proxmox.com> (raw)

The following patchset is a result of investigating a thread in our
community forum [0].

While I'd consider e-mail addresses with '/' in the local-part quite odd,
as so often smtp RFCs are quite liberal with what smtp servers (have to)
accept. Postfix happily accepts mails with '/' in the local-part, and
should they end up in the quarantine, it is currently not possible to
remove them (short of waiting for quarantine retention period).

the 4 places where we use the pmg-email-address format are:
* quarantine (pmail parameter)
* statistics (contact, receiver, sender detail views)
* fetchmail
* pbsconfig (username)

the first two are problematic in the sense that external sources might
cause a mail-address with '/' to get stored. pbsconfig stores a username
with '/' (which then fails since the repository verification does not
expect a '/' in the username/token), fetchmail accepts it (and stores its
config with all special characters escaped)
only the statistics api calls are problematic, since the detail views pass
the mail-address as path component (and the decoding inside pve-http-server
breaks the api call resolution) - addressing this is the main part of the
patchset.

It follows a similar series by Dominik for the user blocklists [1].

patch 1/5 for the api is a cleanup that caught my eye
patches 2+3 for the api could probably be squashed (happy to send a v2 for
this - but feel free to squash them if this gets applied as is)

tested it a bit on my setup (with a limited set of addresses in the
statistics database).

[0]
https://forum.proxmox.com/threads/pmg-error-parameter-verification-failed-400.82353/
[1] https://lists.proxmox.com/pipermail/pmg-devel/2020-March/000952.html

pmg-api:
Stoiko Ivanov (5):
  api: statistics: remove unneeded RESTEnvironment
  api: statistics: refactor return for detail calls
  api: statistics: refactor detail calls
  api: statistics: make email a parameter
  utils: allow '/' inside email address localpart

 src/PMG/API2/Statistics.pm | 333 +++++++++++++++++++++----------------
 src/PMG/Utils.pm           |   2 +-
 2 files changed, 191 insertions(+), 144 deletions(-)

pmg-gui:
Stoiko Ivanov (1):
  statistics: use new api call for detailed stats

 js/ContactStatistics.js  |  9 ++++-----
 js/ReceiverStatistics.js |  9 ++++-----
 js/SenderStatistics.js   |  9 ++++-----
 js/StatStore.js          | 11 +++++++++--
 4 files changed, 21 insertions(+), 17 deletions(-)

-- 
2.20.1





             reply	other threads:[~2021-01-15  9:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-15  9:46 Stoiko Ivanov [this message]
2021-01-15  9:46 ` [pmg-devel] [PATCH pmg-api 1/5] api: statistics: remove unneeded RESTEnvironment Stoiko Ivanov
2021-01-15  9:46 ` [pmg-devel] [PATCH pmg-api 2/5] api: statistics: refactor return for detail calls Stoiko Ivanov
2021-01-15  9:46 ` [pmg-devel] [PATCH pmg-api 3/5] api: statistics: refactor " Stoiko Ivanov
2021-01-15  9:46 ` [pmg-devel] [PATCH pmg-api 4/5] api: statistics: make email a parameter Stoiko Ivanov
2021-01-15  9:46 ` [pmg-devel] [PATCH pmg-api 5/5] utils: allow '/' inside email address localpart Stoiko Ivanov
2021-01-15  9:46 ` [pmg-devel] [PATCH pmg-gui 1/1] statistics: use new api call for detailed stats Stoiko Ivanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210115094626.25440-1-s.ivanov@proxmox.com \
    --to=s.ivanov@proxmox.com \
    --cc=pmg-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal