Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Mon Apr 21, 2008 1:28 pm 
Offline
Newbie

Joined: Mon Apr 21, 2008 1:14 pm
Posts: 4
Website: http://www.ecinteractive.co.uk
WLM: multimedia@hotmail.co.uk
Location: UK
I've created a php application on linode that sends out emails - the received emails are shown as being sent from '[user]@mydomain.net on behalf of [email]@mydomain.net' where [user] is the user php-cgi is running under, and [email] is what I want to have as the sender.

The email only appears in certain clients like this (e.g outlook).

distro is centos 5.

hostname is set to mydomain.net in /etc/sysconfig/network.
In the linode control panel 'dashboard->utilities->reverse dns manager' I've set : my.ip.addr.ress to mydomain.net
I've restarted networking.

I'm stuck now as what to try next.. I've never had this issue on other vps I've used, probably something very simple I'm missing..


Top
   
 Post subject:
PostPosted: Mon Apr 21, 2008 2:23 pm 
Offline
Junior Member

Joined: Fri Jun 02, 2006 10:02 am
Posts: 26
How are you sending mail through php? I presume you're using the default mail() function so what settings do you have in php.ini for "SMTP", "sendmail_from", and "sendmail_path"? If you're sending using sendmail have you tried using the "-t" argument to sendmail? This forces the from address.


Top
   
 Post subject:
PostPosted: Mon Apr 21, 2008 3:13 pm 
Offline
Newbie

Joined: Mon Apr 21, 2008 1:14 pm
Posts: 4
Website: http://www.ecinteractive.co.uk
WLM: multimedia@hotmail.co.uk
Location: UK
I'm using the swiftmailer library with it's 'native mail' sending option. Swiftmailer does a good job of making sure all headers and fields are correctly defined, so I'm fairly sure the headers are being rewritten post-php. I've been using the same code on other centos vps providers without any issue, so don't know if it's a quirk that may be specific to linode.


Top
   
 Post subject:
PostPosted: Mon Apr 21, 2008 3:25 pm 
Offline
Senior Newbie

Joined: Sun Mar 09, 2008 8:12 pm
Posts: 9
I'm not familiar with swiftmailer or how to configure it, but I think this has to do with the email headers. Outlook displays the "on behalf of" if there is a "Sender" header in the email.

So most likely, your headers are something like this:
Code:
From: "John Doe" <[user]@mydomain.net>
Sender: [email]@mydomain.net
To: some-email@somehost.com

If you can get swiftmailer to not send the "Sender" header, then Outlook won't display the "on behalf of."


Top
   
 Post subject:
PostPosted: Tue Apr 22, 2008 7:43 am 
Offline
Senior Member
User avatar

Joined: Mon Dec 10, 2007 4:30 pm
Posts: 341
Website: http://markwalling.org
Doesn't lookOut mark a message "On Behalf Of" when the From: header doesn't equal the envelope from?


Top
   
 Post subject:
PostPosted: Tue Apr 22, 2008 1:07 pm 
Offline
Senior Member
User avatar

Joined: Tue Apr 13, 2004 6:54 pm
Posts: 833
OutHouse doesn't get to see the envelope of the message; that's handled by the MTA and not the MUA.

_________________
Rgds
Stephen
(Linux user since kernel version 0.11)


Top
   
 Post subject:
PostPosted: Tue Apr 22, 2008 1:38 pm 
Offline
Senior Member
User avatar

Joined: Mon Dec 10, 2007 4:30 pm
Posts: 341
Website: http://markwalling.org
Code:
Microsoft Mail Internet Headers Version 2.0
Received: from WorkSMTP ([0.0.0.0]) by WorkSMTP with Microsoft SMTPSVC(6.0.3790.2499);
    Mon, 3 Dec 2007 15:49:02 -0500
Received: from WorkSMTP ([0.0.0.0]) by WorkSMTP with Microsoft SMTPSVC(6.0.3790.2499);
    Mon, 3 Dec 2007 15:49:01 -0500
Received: from WorkSMTP (WorkSMTP [0.0.0.0])
   by WorkSMTP (8.13.6/8.13.6/20050510-SVVS) with ESMTP id lB3Kn19r026576
   for <markw.walling@work>; Mon, 3 Dec 2007 15:49:01 -0500
Received: from www.theshore.net (ns.theshore.net [67.18.92.50])
   by WorkSMTP (8.13.6/8.13.6/20051114-SVVS-TLS-DNSBL) with ESMTP id lB3KmCjc012831
   for <markw.walling@work>; Mon, 3 Dec 2007 15:48:59 -0500
Received: from localhost (localhost [127.0.0.1])
   by www.theshore.net (8.13.6/8.9.1) with ESMTP id lB3Klluq027848;
   Mon, 3 Dec 2007 15:47:47 -0500
Message-Id: <200712032047.lB3Klluq027848@www.theshore.net>
Content-type: text/plain
Date: Mon, 03 Dec 2007 15:47:34 -0500
From: service@linode.com
Subject: Linode Account Activation
To: markw.walling@work
Return-Path: service@linode.com
X-OriginalArrivalTime: 03 Dec 2007 20:49:01.0702 (UTC) FILETIME=[EF383A60:01C835ED]


Quoting RFC 2821, section 4.4:

Quote:
When the delivery SMTP server makes the "final delivery" of a
message, it inserts a return-path line at the beginning of the mail
data. This use of return-path is required; mail systems MUST support
it. The return-path line preserves the information in the <reverse-
path> from the MAIL command. Here, final delivery means the message
has left the SMTP environment. Normally, this would mean it had been
delivered to the destination user or an associated mail drop, but in
some cases it may be further processed and transmitted by another
mail system.


So, no, it doesn't see the actual envelope, but it sees the envelope data as added to the message by the MTA.


Top
   
 Post subject:
PostPosted: Wed Apr 23, 2008 8:37 am 
Offline
Newbie

Joined: Mon Apr 21, 2008 1:14 pm
Posts: 4
Website: http://www.ecinteractive.co.uk
WLM: multimedia@hotmail.co.uk
Location: UK
I seem to have sorted this -

I added the user php is running under to the exim.conf file:

trusted_users = mail:apache:my-php-cgi-user

It would appear that exim by default rewrites the headers if it doesn't 'trust' the user the sending application is running under. Normally I'd be running php under user apache but int his instance I have 2 seperate php installs for v4 & v5 with the cgi version running under another user.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


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

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group