From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 4B6ED6A0A4 for ; Thu, 21 Jan 2021 16:52:08 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 3EDAE13D19 for ; Thu, 21 Jan 2021 16:51:38 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 311BC13CFF for ; Thu, 21 Jan 2021 16:51:36 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id E9402460BE for ; Thu, 21 Jan 2021 16:51:35 +0100 (CET) From: Stoiko Ivanov To: pmg-devel@lists.proxmox.com Date: Thu, 21 Jan 2021 16:51:01 +0100 Message-Id: <20210121155107.1971-1-s.ivanov@proxmox.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.066 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [utils.pm, statistics.pm, proxmox.com] Subject: [pmg-devel] [PATCH pmg-api v2 0/5] allow / in local part of pmg-email-address X-BeenThere: pmg-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Mail Gateway development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2021 15:52:08 -0000 v1->v2: * Had a chat with Thomas off-list - who (righfully) pointed out that the paths 'contact' and 'contacts' seem a bit shoddy and counterintuitive * reimplemented the change so that it still uses '/contact' as prefix, but instead of providing the address as next component uses 'detail' (and provides the address in the detailaddress parameter) (the two points above apply to 'sender' and 'receiver' as well) * individual notes below the individual patches (where applicable) original cover-letter: 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 | 278 ++++++++++++++++--------------------- src/PMG/Utils.pm | 2 +- 2 files changed, 122 insertions(+), 158 deletions(-) pmg-gui: Stoiko Ivanov (1): statistics: use new api structure 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