Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made from_strip case-insesitive #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Made from_strip case-insesitive #3

wants to merge 1 commit into from

Conversation

puggan
Copy link

@puggan puggan commented Oct 30, 2013

if the from-header looks like
"FROM: [email protected]"
the return-path becomes
"Return-path: <"FROM:user"@domain.net>"

while
"From: [email protected]"
and
"FROM: [email protected]"
makes
"Return-path: [email protected]"

@ajwans
Copy link
Owner

ajwans commented Nov 6, 2013

Is this available on all platforms? If not does it need a configure check?

@puggan
Copy link
Author

puggan commented Nov 6, 2013

Sorry for not saying somthing about the config file,
i guess its the "FromLineOverride=YES"

the other 2 options dosn't look relevant

cat /etc/ssmtp/ssmtp.conf | grep -v -P "^(#|$)"
root=postmaster
mailhub=faceways.se
FromLineOverride=YES

@puggan
Copy link
Author

puggan commented Nov 6, 2013

In gentoo, with the config file above, if i run:
echo -e "FROM: [email protected]\nTO: [email protected]\nSUBJECT: Test ssmtp\n\ntest ssmtp" | sendmail -t

the mail header end up as "Return-Path: <"FROM:puggan"@faceways.se>"

I see no reason for other platforms to have other results

@xenlo
Copy link

xenlo commented Aug 23, 2017

Observed the same behavior on an Debian 7.11 (wheezy) with ssmtp version: 2.64-7.
In function of the "From:" format put in the header used with the PHP mail() function we get the following answers from other mail servers:

status=bounced (host gmail-smtp-in.l.google.com[…] said: 553-5.1.2 The sender address FROM:[email protected] is not a valid RFC-5321 553 5.1.2 address. gsmtp (in reply to MAIL FROM command))

Here are several header combination that I tested:

<?php
     $to      = '[email protected]';
     $subject = 'The Subject';
     $message = 'Content';
//    $headers  = "From: <[email protected]>\r\n";                  // Works
//    $headers  = "From: \"[email protected]\"\r\n";                // Works
//    $headers  = "FROM: <[email protected]>\r\n";                  // Works
//    $headers  = "From: [email protected]\r\n";                    // Works
//    $headers  = "FROM: [email protected]\r\n";                    // Fails
    $headers  = "FROM:[email protected]\r\n";                       // Fails
     $headers .= "MIME-Version: 1.0\r\n";
     $headers .= "Content-type: text/txt; charset=iso-8859-1\r\n";
     mail($to, $subject, $message, $headers);
 ?>

@xenlo
Copy link

xenlo commented Aug 23, 2017

Please note that, according the the RFC 5322 section 3.6.2 FROM: [email protected] don't really follow the recommendation, nevertheless it is not incorrect neither (still following the same RFC section 1.2.2).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants