Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 489872

Summary: mail-mta/ssmtp-2.64-r2 case sensitive from header
Product: Gentoo Linux Reporter: Puggan <from_gentoo>
Component: Current packagesAssignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed>
Status: CONFIRMED ---    
Severity: normal CC: net-mail+disabled
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Patch copied from comment

Description Puggan 2013-10-30 12:59:34 UTC
I noticed some of our mails got the wrong return path 
when the header is writen as:
FROM: user@domain.com
while it works fine for
From: user@domain.com
and
FROM: <user@domain.com>

the problem seams to be in from_strip
that uses a case-senstive compare.

The following patch should fix that.

---------------------
--- ssmtp-2.64/ssmtp.c  2009-11-23 10:55:11.000000000 +0100
+++ ssmtp.c     2013-10-30 13:43:30.000000000 +0100
@@ -433,7 +433,7 @@
        (void)fprintf(stderr, "*** from_strip(): str = [%s]\n", str);
 #endif
 
-       if(strncmp("From:", str, 5) == 0) {
+       if(strncasecmp("From:", str, 5) == 0) {
                str += 5;
        }
----------------------
Comment 1 Puggan 2019-03-27 16:40:44 UTC
Created attachment 570928 [details, diff]
Patch copied from comment

The comment included a patch, uploading it as a file