talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit e134be0de9ad9be730ab984a557991a8fae24970
parent be0f05095c9f5ea75cc6de3d341ffbaf37c2e103
Author: Ricardo Mones <ricardo@mones.org>
Date:   Thu, 28 Jul 2022 17:54:43 +0200

Make custom headers compliant with RFC 2822 § 3.6

And disallow setting header names with colons inside.

Diffstat:
Msrc/customheader.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/customheader.c b/src/customheader.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 1999-2012 Hiroyuki Yamamoto and the Claws Mail team + * Copyright (C) 1999-2022 Hiroyuki Yamamoto and the Claws Mail team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,7 +14,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. - * */ #ifdef HAVE_CONFIG_H @@ -104,6 +103,9 @@ gboolean custom_header_is_allowed(const gchar *header) { cm_return_val_if_fail(header != NULL, FALSE); + if (strchr(header, ':') != NULL) + return FALSE; + if (g_ascii_strcasecmp(header, "Date") != 0 && g_ascii_strcasecmp(header, "From") != 0 && g_ascii_strcasecmp(header, "To") != 0 &&