~dricottone/huttese-apk

5212aa81d3ee7175fc61c4062a41c99a018335ca — Drew DeVault 4 years ago f761f2c
py3-aiosmtpd: upgrade to 1.2.2, patch LHLO
3 files changed, 63 insertions(+), 125 deletions(-)

A sr.ht/py3-aiosmtpd/0001-Make-LHLO-behave-like-EHLO.patch
M sr.ht/py3-aiosmtpd/APKBUILD
D sr.ht/py3-aiosmtpd/test-ssl-certs.patch
A sr.ht/py3-aiosmtpd/0001-Make-LHLO-behave-like-EHLO.patch => sr.ht/py3-aiosmtpd/0001-Make-LHLO-behave-like-EHLO.patch +58 -0
@@ 0,0 1,58 @@
From 0efc8e3404050331c033cc4388a9855f5508dc7b Mon Sep 17 00:00:00 2001
From: Simon Ser <contact@emersion.fr>
Date: Mon, 16 Nov 2020 14:19:31 +0100
Subject: [PATCH] Make LHLO behave like EHLO

The current logic makes LHLO behave like the legacy HELO. However the
RFC says:

> The LHLO command has identical semantics to the EHLO command of ESMTP.

Clients connecting to the LMTP server expect extensions such as 8BITMIME
to be advertised. However aiosmtpd won't send any extension string.

Fix this by making LHLO an alias for EHLO instead of HELO.

[1]: https://tools.ietf.org/html/rfc2033#section-4.1
---
 aiosmtpd/lmtp.py            |  2 +-
 aiosmtpd/tests/test_lmtp.py | 10 +++++++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/aiosmtpd/lmtp.py b/aiosmtpd/lmtp.py
index 53ed087364d2..61e7768f4474 100644
--- a/aiosmtpd/lmtp.py
+++ b/aiosmtpd/lmtp.py
@@ -7,7 +7,7 @@ class LMTP(SMTP):
     @syntax('LHLO hostname')
     async def smtp_LHLO(self, arg):
         """The LMTP greeting, used instead of HELO/EHLO."""
-        await super().smtp_HELO(arg)
+        await super().smtp_EHLO(arg)
         self.show_smtp_greeting = False
 
     async def smtp_HELO(self, arg):
diff --git a/aiosmtpd/tests/test_lmtp.py b/aiosmtpd/tests/test_lmtp.py
index a3855e45b2b0..d32a394e756b 100644
--- a/aiosmtpd/tests/test_lmtp.py
+++ b/aiosmtpd/tests/test_lmtp.py
@@ -25,7 +25,15 @@ class TestLMTP(unittest.TestCase):
         with SMTP(*self.address) as client:
             code, response = client.docmd('LHLO', 'example.com')
             self.assertEqual(code, 250)
-            self.assertEqual(response, bytes(socket.getfqdn(), 'utf-8'))
+            lines = response.splitlines()
+            expecteds = (
+                bytes(socket.getfqdn(), 'utf-8'),
+                b'SIZE 33554432',
+                b'8BITMIME',
+                b'HELP',
+            )
+            for actual, expected in zip(lines, expecteds):
+                self.assertEqual(actual, expected)
 
     def test_helo(self):
         # HELO and EHLO are not valid LMTP commands.
-- 
2.29.2


M sr.ht/py3-aiosmtpd/APKBUILD => sr.ht/py3-aiosmtpd/APKBUILD +5 -4
@@ 2,8 2,8 @@
# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=py3-aiosmtpd
_pyname=aiosmtpd
pkgver=1.2
pkgrel=2
pkgver=1.2.2
pkgrel=0
pkgdesc="A reimplementation of the Python stdlib smtpd.py based on asyncio"
url="https://github.com/aio-libs/aiosmtpd"
arch="noarch"


@@ 11,10 11,9 @@ license="Apache-2.0"
depends="py3-atpublic"
makedepends="python3-dev py3-setuptools py3-pytest"
_pypiprefix="${_pyname%${_pyname#?}}"
# Remove test-ssl-certs.patch for next version
source="
	https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz
	test-ssl-certs.patch
	0001-Make-LHLO-behave-like-EHLO.patch
"
replaces="py-aiosmtpd"
builddir="$srcdir"/$_pyname-$pkgver


@@ 31,3 30,5 @@ package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="7ffc279a73685601496dbfffef30a78cc254a76f8c8fccd0c7b7efe41da66672f0d8662f302eb928e90eb8977b859cb7e713415d0aa5e93f369ef23bdff405fc  aiosmtpd-1.2.2.tar.gz
fac4ce50a992d3d77a57b8da2cf9656f0c3945a446b31121269d7f04290d1e656ee21d9bd044830e1447cc11ddc160baf59ef034e279e12deed1bc25f916a832  0001-Make-LHLO-behave-like-EHLO.patch"

D sr.ht/py3-aiosmtpd/test-ssl-certs.patch => sr.ht/py3-aiosmtpd/test-ssl-certs.patch +0 -121
@@ 1,121 0,0 @@
From f414dcdc0312c4cf3f3d39deb3ea7d15e89a5334 Mon Sep 17 00:00:00 2001
From: Wayne Werner <wayne@waynewerner.com>
Date: Sat, 1 Jun 2019 14:00:30 +0000
Subject: [PATCH] Create new ssl certs

These ones will be valid for 100 years, so that should be plenty of
time for running tests before they have to be recreated.
---
 aiosmtpd/tests/certs/server.crt | 43 +++++++++++++--------------
 aiosmtpd/tests/certs/server.key | 52 ++++++++++++++++-----------------
 2 files changed, 47 insertions(+), 48 deletions(-)

diff --git a/aiosmtpd/tests/certs/server.crt b/aiosmtpd/tests/certs/server.crt
index e4f8f09..04f19cf 100644
--- a/aiosmtpd/tests/certs/server.crt
+++ b/aiosmtpd/tests/certs/server.crt
@@ -1,24 +1,23 @@
 -----BEGIN CERTIFICATE-----
-MIIEEzCCAvugAwIBAgIJANUfzx76nsWrMA0GCSqGSIb3DQEBCwUAMIGfMQswCQYD
-VQQGEwJSVTEZMBcGA1UECAwQU2FpbnQtUGV0ZXJzYnVyZzEZMBcGA1UEBwwQU2Fp
-bnQtUGV0ZXJzYnVyZzETMBEGA1UECgwKSW50ZXJtZWRpYTEQMA4GA1UECwwHRGV2
-VGVhbTEMMAoGA1UEAwwDYWVzMSUwIwYJKoZIhvcNAQkBFhZrdm9sa292QGludGVy
-bWVkaWEubmV0MB4XDTE2MDgyMzEzMDE1NFoXDTE5MDUyMDEzMDE1NFowgZ8xCzAJ
-BgNVBAYTAlJVMRkwFwYDVQQIDBBTYWludC1QZXRlcnNidXJnMRkwFwYDVQQHDBBT
-YWludC1QZXRlcnNidXJnMRMwEQYDVQQKDApJbnRlcm1lZGlhMRAwDgYDVQQLDAdE
-ZXZUZWFtMQwwCgYDVQQDDANhZXMxJTAjBgkqhkiG9w0BCQEWFmt2b2xrb3ZAaW50
-ZXJtZWRpYS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cUOmU+FcM+JHfbfnQy2QEY13CKQfniP
+YBprCg866+ecVC+J+Aeu9ubZgv557SJwJ/0b4rsQ/ETUw95g6AxqdHntDTrWamxQ
+iKiGHt3N9iEdnnjXsKYNMsOFXSHHG10PtBQUpNOSUrp5HMb1Kd0oTdNz/kU=
 -----END CERTIFICATE-----
diff --git a/aiosmtpd/tests/certs/server.key b/aiosmtpd/tests/certs/server.key
index f9e279b..f22e0f5 100644
--- a/aiosmtpd/tests/certs/server.key
+++ b/aiosmtpd/tests/certs/server.key
@@ -1,28 +1,28 @@
 -----BEGIN PRIVATE KEY-----
-MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC0c3sWh3wlBuM2
-1PhiF2AKlYniu697xCv3cvOyqg4ybq+Vd44ldQc+3twIyxtO+p1zgxTWbkxwV+s6
-qBU5i09m8RHX2sBW0e61Vx4dR8dEkGjmqy3hebJy33GZOWh5bp1yZoZp9AsbGQ2d
-NPCBSc75hc/5+CMcyzoK3pXuC09kwXPNmnWgy/dJWk6FVRP3/3u2KkDoZGKDY7+v
-nJ8hYLk+stGZGfu0C6qU7cguRnsuuH6nC6KIhbn3hJNVYMlXRBXF1tE4UBjvdSYl
-Ffyiwc1zJ77TVq8lSnn/9yiBfG+xUqGq7+KEHkg3SezmBFTFaXRc+RT3e3wf/e5W
-JRHl4joxAgMBAAECggEAFLHZv++x0R1FGZi7E6TSouQbeCFGMs+Aq1RHloniLu56
-vI2Fg840EoXEfk2syBX90K2LyjvEEG5Ez+lO5daQOKIVBchUnqBc2/ctwPXmaHqX
-TTz8egtW582wXX4z+RkyfVg8uhH+5BCvewQDQRCR6BPskiJfBIJaGb0FPNOXO1qy
-vI0MupbfHU1J80M6PEzfszswdC+5Lgx0kFRphr8mSLn42dlFsqFVmFCVuaxg6bfn
-zowXppUcUM4lkBrsXpLKYTr2+u64wZkclL/GjMCYuyQ52xiBsw3JPDeDDFI3kFkw
-gOCqDedqyim60qM9Dtq1bf4EW4/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