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 A1CF168D84 for ; Fri, 15 Jan 2021 10:47:19 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 9889122DD2 for ; Fri, 15 Jan 2021 10:46:49 +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 B711922DB7 for ; Fri, 15 Jan 2021 10:46:47 +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 8018C4526D for ; Fri, 15 Jan 2021 10:46:47 +0100 (CET) From: Stoiko Ivanov To: pmg-devel@lists.proxmox.com Date: Fri, 15 Jan 2021 10:46:20 +0100 Message-Id: <20210115094626.25440-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.071 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. [statistics.pm, utils.pm, proxmox.com] Subject: [pmg-devel] [PATCH pmg-api/pmg-gui] 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: Fri, 15 Jan 2021 09:47:19 -0000 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