I am sending email using PHP's mail()
function. However, when I set the ReturnPath header like '[email protected]
', however the email fails with the return path 5th parameter but when not used, [email protected]
return path is added. Is this an error and how do we get around to using specific return path.
Kind regards,
Khuram
Assuming you're using Sendmail with
root
access to the server:I've tested the result on my server where Sendmail is basically in it's factory configuration:
When using -f, Sendmail must know that you are a trusted user. You must add the server user to
/etc/mail/trusted-users
. For example, if the web server user isapache
orwww-data
, you must put that into thetrusted-users
file.Once you've done this, you probably have to enable the feature. Edit
/etc/mail/submit.mc
and add the following line properly:Once you're done
service sendmail restart
should do the job.