diff options
author | Omar Polo <op@cvs.openbsd.org> | 2024-01-28 17:23:18 +0000 |
---|---|---|
committer | Omar Polo <op@cvs.openbsd.org> | 2024-01-28 17:23:18 +0000 |
commit | e2a5c75b38233d25d02b7b92170ccb8dbff8340d (patch) | |
tree | 22bb6c27adc35f6ca3653dafb9b199a70da21d56 /usr.sbin/smtpd | |
parent | 4da4dffb447534e8dea58b4ec3e6079d01b212e2 (diff) |
allow escaping inside quotes
RFC5322 allows for escapes using \ inside quotes. Otherwise, headers
such as
From: "\"Doe, John\"" <op>
get mangled as "\"Doe@localhost, John\" <op> since \ would be treated as
ordinary character and not the escape for the quote.
Bug reported by TobiasEgg on the OpenSMTPD-portable github repository.
ok millert@
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r-- | usr.sbin/smtpd/smtp_session.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c index 94763e6d078..3a99cb4f6b9 100644 --- a/usr.sbin/smtpd/smtp_session.c +++ b/usr.sbin/smtpd/smtp_session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtp_session.c,v 1.440 2024/01/20 09:01:03 claudio Exp $ */ +/* $OpenBSD: smtp_session.c,v 1.441 2024/01/28 17:23:17 op Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -489,7 +489,7 @@ header_domain_append_callback(struct smtp_tx *tx, const char *hdr, quote = !quote; if (line[i] == ')' && !escape && !quote && comment) comment--; - if (line[i] == '\\' && !escape && !comment && !quote) + if (line[i] == '\\' && !escape && !comment) escape = 1; else escape = 0; |