Send From address using SUPHP

B3rt

Verified User
Joined
Oct 12, 2007
Messages
81
When a domain is running in SUPHP and a mail is send using a PHP script this mail is received as:
send from: [email protected]

How can this be changed?

The problem here is that some mail servers cannot resolve this user, especially when using an external mail server or the mail server itself on the server is disabled for this domain.

In this specific case a rule is set in exim.conf that all mail from a domain must be delivered from a special antispam/virus server, but the send from address which is send along is NOT the domain which sended the mail!
The recipient is checking is the sender address is valid but does this based on the "send from" address. This user does not exist (it is the servername) and exim will report that mail is only accepted from 1 server and does not allow checks. The result is that the mail is not accepted by the remote mail server.

SO how can I change where PHP mail specify the send from value?
(this is not a mailheader command in php)
 
i have the same question here...

with an old version of suphp ( suphp0.5.x ) we can bypass it in exim.conf with this example: ( modify this line )

trusted_users = mail:majordomo:apache:diradmin:add-another-username


but with suphp0.6.2 its change nothing.. ( not working.. )

anyone have an idea ?
 
Hello,

The "trusted_users" solution should be the one you want, if you want to override the "From" address using your headers. I don't know what would have changed between the 2 suPhp versions.. however, I don't see how it would change anything. /usr/sbin/sendmail is called by the user in both cases.. so if exim is the same, it *shouldn't* make any difference...

What header values are you setting in your emails to try and override the address? (with the trusted_users being set)

I personally just make sure that the hostnamre resolves and has an MX record to avoid this.
This can be done by simply adding a full dns zone for your hostname, something that DA does at install time with the hostname specified in the setup.

John
 
This fixed it for us;

Code:
You can remove the "Sender:" header by adding:

local_from_check = no

to your "MAIN CONFIGURATION SETTINGS" in the /etc/exim.conf
 
As an addition to John's post, the zone file added by DirectAdmin will only be referenced if the zone file for the main domain is also on the same server. Otherwise you'll have to create the zone file wherever the main domain zone file is located, or create ns records for the hostname in the zone file wherever the main domain zone file is located.

Jeff
 
I must be missing something...I have followed this and my mail from joomla contact forms (php mail) still comes from @full.servername.com instead of @userdomain.com is any suggestions?
 
I had exactly the same problem, after a recent upgrade.

What I did to fix it? (and did not help)

1. Add the user to the trusted_users line in exim.conf
2. Add no_local_from_check to exim.conf
3. Add untrusted_set_sender=*


Now, what helped (a bit at least)

4. Add the fifth parameter to the path of sendmail. In Joomla for example, set the path to /usr/sbin/sendmail -t [email protected]

Set the parameters to your liking, but add the "-f", followed by the e-mail address.
 
Usually when no one responds it's because no one knows and/or you haven't given enough information. My guess (I don't use Joomla) is that you must set "From" somewhere in your Joomla code. Do you?

Jeff
 
Does the same with phplist both I set the from on, it just says full server name in exim mainlog. every peace of mail sent using php comes from [email protected] if I do the same tail on my old hosting account the from is replaced by from address both in phplist and in joomla. Not sure what the difference is, if it is permission related because I use su php or what. I can provide whatever information needed. I am fairly certain that both phplist and joomla provide the correct parameters they are either getting ignored or over written.

TIA
 
Have you made any of those changes to exim.conf? If so, which ones? I wouldn't be the person to work on this for you; I'm NOT an expert in PHP, and I have no experience either in phplist or in Joomla.

Jeff
 
In Joomla, did you set the sendmail path as followed: /usr/sbin/sendmail -t [email protected]

(where you change [email protected] to your user)

Is it safe to presume that -f is appended to the email address in question or is there a space between the two?

I want to make sure that I have this right. I use Joomla for many of the web sites that I build on my server and I have been using the SMTP method to get around the usernameATlongservername.com and with Wordpress I have been utilizing an SMTP plugin to work around that same issue. However with some of the other php scripts like phplist I have been stumped.
 
Back
Top