Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
PHP, mail(), ssmtp, Gmail: how to get correct From address?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Tatsh
Apprentice
Apprentice


Joined: 22 Jul 2007
Posts: 181

PostPosted: Sun Oct 30, 2011 2:55 am    Post subject: PHP, mail(), ssmtp, Gmail: how to get correct From address? Reply with quote

I have figured out that if I enable FromLineOverride I no longer see 'added by portage for nginx' as the From name but I still see my Gmail user name instead of the one that is set with PHP. And if I use ssmtp and type From: somename@somename.com it still won't use that either, it always uses my email address in ssmtp.conf.

/etc/ssmtp/ssmtp.conf:
Code:
root=myname@gmail.com
AuthUser=myname@gmail.com
AuthPass=[]

mailhub=smtp.gmail.com:465

#rewriteDomain=

# hostname=_HOSTNAME_

# Set this to never rewrite the "From:" line (unless not given) and to
# use that address in the "from line" of the envelope.
FromLineOverride=YES

UseTLS=YES


Has anyone figured out how to get this to work or is it not possible (Gmail limitation)?
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Sun Oct 30, 2011 8:34 am    Post subject: Reply with quote

"envelope" != header
envelope == what you send as an argument to the MAIL command, RCPT command, or anything in between.

in order to do esmtp auth, the envelope return-path cannot be forged

The "From" field that is displayed when viewing an email on a mail client is generally crafted by whichever "originator address" field you have present in the header, typically the From header or the Reply-To header. This, is indeed, something that can be forged, and while I don't have any specifics on the problem you're encountering (largely, because i dont know if gmail is simply seeing that no originator address header is present, and deciding to tack on the envelope return-path as originator address), maybe this explanation will help you understand what you are seeing. In simpler terms, your MAIL command, and AUTH command, should both be using a gmail address, while what is displayed as the sender should be derived from e.g. the "From" header
_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum