Re: What DKIM RSA key length to use

2021-04-10 Thread Thomas Bohl

Hello,


In the filter-dkimsign readme I suggest to use 2048 and I stand by it.


Thanks for mentioning and coding filter-dkimsign! Somehow I was unaware 
of it. I used rspamd just for DKIM. Which is overkill. The daemon racks 
up nearly 28000 daily DNS requests to free services (like dnswl.org, 
senderscore.com, spamhaus.org etc.) just by running. (I didn't use it as 
an inbound filter. I overwrote rbl.conf. I have no clue what it is 
doing.) So I switched to filter-dkimsign.


I also switched to a 2048 bits key. Which looks good so far. Ironically 
only dkimvalidator.com had a problem verifying until I relaxed the 
canonicalization algorithms.
(Other tests like mail-tester.com or github.com/lieser/dkim_verifier had 
no problem with it being simple.)




[patch] RCPT TO with quoted user part

2021-04-10 Thread Edgar Pettijohn
Added a block to smtp_mailaddr() in smtp_session.c to allow for quoted
usernames. Only tested on my laptop and seems to work. However, I'm
thinking it might should be moved past the point of splitting on ':'.

Edgar
Index: smtp_session.c
===
RCS file: /cvs/src/usr.sbin/smtpd/smtp_session.c,v
retrieving revision 1.429
diff -u -p -u -r1.429 smtp_session.c
--- smtp_session.c  5 Mar 2021 12:37:32 -   1.429
+++ smtp_session.c  10 Apr 2021 12:57:55 -
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtp_session.c,v 1.429 2021/03/05 12:37:32 eric Exp $ */
+/* $OpenBSD: smtp_sesson.c,v 1.429 2021/03/05 12:37:32 eric Exp $  */
 
 /*
  * Copyright (c) 2008 Gilles Chehade 
@@ -2224,7 +2224,7 @@ static int
 smtp_mailaddr(struct mailaddr *maddr, char *line, int mailfrom, char **args,
 const char *domain)
 {
-   char   *p, *e;
+   char   *p, *e, *q, *s;
 
if (line == NULL)
return (0);
@@ -2233,15 +2233,28 @@ smtp_mailaddr(struct mailaddr *maddr, ch
return (0);
 
e = strchr(line, '>');
+
if (e == NULL)
return (0);
+
*e++ = '\0';
+
while (*e == ' ')
e++;
*args = e;
 
if (!text_to_mailaddr(maddr, line + 1))
return (0);
+
+   q = strchr(maddr->user, '"');
+   if (q != NULL) {
+   q++;
+   s = strrchr(q, '"');
+   if (s == NULL)
+   return (0);
+   *s = '\0';
+   memmove(maddr->user, q, strlen(q) + 1);
+   }
 
p = strchr(maddr->user, ':');
if (p != NULL) {