~dricottone/huttese-apk

bc536ccb7997bffa95efc3fceda5bcef16e7bf7e — Drew DeVault 3 years ago b5aa00e
py3-aiosmtpd: upgrade to 1.2.4
2 files changed, 4 insertions(+), 66 deletions(-)

D sr.ht/py3-aiosmtpd/0001-Make-LHLO-behave-like-EHLO.patch
M sr.ht/py3-aiosmtpd/APKBUILD
D sr.ht/py3-aiosmtpd/0001-Make-LHLO-behave-like-EHLO.patch => sr.ht/py3-aiosmtpd/0001-Make-LHLO-behave-like-EHLO.patch +0 -58
@@ 1,58 0,0 @@
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 +4 -8
@@ 2,8 2,8 @@
# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=py3-aiosmtpd
_pyname=aiosmtpd
pkgver=1.2.2
pkgrel=1
pkgver=1.2.4
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,7 @@ license="Apache-2.0"
depends="py3-atpublic"
makedepends="python3-dev py3-setuptools py3-pytest"
_pypiprefix="${_pyname%${_pyname#?}}"
source="
	https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz
	0001-Make-LHLO-behave-like-EHLO.patch
"
source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"
replaces="py-aiosmtpd"
builddir="$srcdir"/$_pyname-$pkgver



@@ 30,5 27,4 @@ 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"
sha512sums="dc6041e284daceb89f8ca83b5cd715a5811eb4cf76504c23112e24c97d6c88480667c713ce094c2dcbc5b12a80605e551b6aadc4b1ce499089be68c7c4e7df8c  aiosmtpd-1.2.4.tar.gz"