• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Changing "anonymous@mydomain" default PHP Sender

jnarvaez

Basic Pleskian
Hi,

I have a box with several domains and every user that send a mail from php without specifying "from address" the mail is sended from "anonymous@mydomain", I would like to change this to something like "not@specified".

I have been looking into php.ini and sendmail.mc and .cf and nothing was found.

Any help would be appreciated.
 
Try this, if this doesnt work for you - google is your friend :)

Found this here

Here's how the section might look on a typical Windows server, or on a Linux server without sendmail:

[mail function]
; Setup for Windows systems
SMTP = smtp.my.isp.net
sendmail_from = me@myserver.com

And here's how it might look on a Linux server with sendmail:

[mail function]
; Setup for Linux systems
sendmail_path = /usr/sbin/sendmail -t
sendmail_from = me@myserver.com

With those settings in place, restart your Web server and you're ready to go!
 
Hi, thanks for your answer.

Google is my best right now :D
but I can't find any solution

My php.ini looks like this now:

[mail function]
; Setup for Linux systems
sendmail_path = /usr/sbin/sendmail -t
sendmail_from = me@myserver.com

and after restarting httpd i keep recieveng php mails from anonymous@...

any idea?
 
Yeah it was a long shot, typically that php option is only available for windows php installs since most of that stuff on linux is done by sendmail.

Sorry I cant be more help then that right now - I'll keep thinking about it, I've done it before a couple years ago for a client but I cant remember for the life of me what i did....
 
If you want different addresses for each domain, basically you need to create a vhost.conf for each domain in /home/httpd/vhosts/domain.com/conf:

<Directory /home/httpd/vhosts/domain.com/httpdocs>
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f whatever@whatever.com"
</Directory>

then use websrvmng -u -a (check the syntax -- this may not be correct)

Or you can just try adding the -f whatever@whatever.com to the sendmail path in php.ini if you want the same address for all domains on the server.

Note that your path may be /var/www/vhosts instead of /home/httpd/vhosts

Faris.
 
Thanks Faris,

If Im not mistaken they can also do this in an htaccess file right?
 
I don't honestly know if it can be done via an .htaccess file - I've never tried it.

Faris.
 
According to php.net you can't.. :(
php_admin_value name value

Sets the value of the specified directive. This can not be used in .htaccess files. Any directive type set with php_admin_value can not be overridden by .htaccess. To clear a previously set value use none as the value.

I did find this: http://forum.swsoft.com/showthread.php?s=&threadid=45074

But changing code on each site isn't a great option either.
 
Back
Top