~sircmpwn/sr.ht-dev

todo.sr.ht: Only care about the mail handler's sock-group when using LMTP v1 APPLIED

David Florness: 1
 Only care about the mail handler's sock-group when using LMTP

 1 files changed, 4 insertions(+), 2 deletions(-)
#433868 alpine.yml success
#433869 archlinux.yml success
#433870 debian.yml success
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/sr.ht-dev/patches/20411/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH todo.sr.ht] Only care about the mail handler's sock-group when using LMTP Export this patch

The "not None" logic was copied from listssrht:
https://git.sr.ht/~sircmpwn/lists.sr.ht/tree/372eda06cbef5f45946444ececad42751dad61d0/item/listssrht-lmtp#L349-352
---
 todosrht-lmtp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/todosrht-lmtp b/todosrht-lmtp
index d469339..3820219 100755
--- a/todosrht-lmtp
+++ b/todosrht-lmtp
@@ -332,7 +332,6 @@ class MailHandler:
            return "250 Unsubscribed"

async def create_server():
    sock_gid = getgrnam(cfg("todo.sr.ht::mail", "sock-group")).gr_gid
    handler = MailHandler()
    sock = cfg("todo.sr.ht::mail", "sock")
    if "/" in sock:
@@ -340,7 +339,10 @@ async def create_server():
                lambda: LMTP(handler, enable_SMTPUTF8=True),
                path=sock)
        os.chmod(sock, 0o775)
        os.chown(sock, os.getuid(), sock_gid)
        sock_group = cfg("todo.sr.ht::mail", "sock-group", default=None)
        if sock_group is not None:
            sock_gid = getgrnam(sock_group).gr_gid
            os.chown(sock, os.getuid(), sock_gid)
    else:
        host, port = sock.split(":")
        await loop.create_server(
-- 
2.30.1
builds.sr.ht
todo.sr.ht/patches: SUCCESS in 2m5s

[Only care about the mail handler's sock-group when using LMTP][0] from [David Florness][1]

[0]: https://lists.sr.ht/~sircmpwn/sr.ht-dev/patches/20411
[1]: mailto:david@florness.com

✓ #433868 SUCCESS todo.sr.ht/patches/alpine.yml    https://builds.sr.ht/~sircmpwn/job/433868
✓ #433869 SUCCESS todo.sr.ht/patches/archlinux.yml https://builds.sr.ht/~sircmpwn/job/433869
✓ #433870 SUCCESS todo.sr.ht/patches/debian.yml    https://builds.sr.ht/~sircmpwn/job/433870
Thanks!

To git@git.sr.ht:~sircmpwn/todo.sr.ht
   4fba3b7..396fe85  master -> master