• 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.

PHP sendmail

P

pkonstan

Guest
In the Knowledge base article (http://kb.swsoft.com/article_22_1395_en.html), it says one of the issues with PHP not sending mail relates to the wrapper and symbolic links.

- When mail is sent from PHP script, PHP
usually uses 'sendmail' binary. Plesk has it's own sendmail wrapper, so
/usr/sbin/sendmail should be symbolic link which points to "$QMAIL_ROOT_D/bin/sendmail", please check it.

How do I check if it is a symbolic link and what would I do to create one if it is not?
 
run this command
ls -alh /usr/sbin/sendmail

and you should get output like this. (The arrow shows a symlink)

lrwxrwxrwx 1 root root 23 Apr 19 10:34 /usr/sbin/sendmail -> /var/qmail/bin/sendmail
 
You will probably have to move /usr/sbin/sendmail first:

mv /usr/sbin/sendmail /tmp/sendmail

To make a symlink:

ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail

:D
 
same problem

I'm having probably the same problem. Not sure what the above means however i get this as my result

lrwxrwxrwx 1 root root 21 Dec 12 03:36 /usr/sbin/sendmail -> /etc/alternatives/ mta

/etc/alternatives/ mta really doesn't sound good to me. Then again I have no clue what i'm doing... So is plesk the culprit here? linux? something in a .htaccess file?

working perfectly to not at all just doesn't seem right to me.
 
I am having the exact same problem and this is getting tiresome. The /etc/alternatives/mta is another sym link to qmail
 
Prior to getting any replies on this site, my research on the Web and the Plesk site, led me down this path that worked.

I found these first two steps from an article I found in the Plesk Knowledge Base. http://kb.swsoft.com/article_22_144_en.html

1) 127.0.0.0/8 network is added to white list in Plesk CP (Server-> Mail -> White List)

2) Make sure that /usr/sbin/sendmail and /usr/lib/sendmail are a
symbolic links to Plesk sendmail binary (/var/qmail/bin/sendmail).

When I got to the second step, I did the following:

1. Log in as ROOT to your server and do the following:
2. Issue these root commands:
a. cd /usr/sbin (this changes to the directory)
b. readlink sendmail (this displays where the symbolic link points.)
> In my case it was pointing to: /etc/alternatives/mta/sendmail
> That is good.
c. cd /usr/lib (change to next directory)
d. readlink sendmail (again, show where it points).
> In my case, nothing displayed because the file/link did not exist.
> I then ran the command to create a symbolic link
> ln -s /etc/alternatives/mta sendmail
> Now when I use readlink sendmail it gives me this symbolic link
3. That was it… My sendmail from within PHP now worked.
 
nope

ok

1) 127.0.0.0/8 network is added to white list in Plesk CP (Server-> Mail -> White List)

2) Make sure that /usr/sbin/sendmail and /usr/lib/sendmail are a
symbolic links to Plesk sendmail binary (/var/qmail/bin/sendmail).

step 1 was done, step 2 i did need to add the symbolic link "sendmail" to /usr/lib

restarted it, still is not working

it has been suggested to reinstall qmail as the php install messes it up. I being less than novice at this with hundreds of domains at stake would rather avoid this. My linux guy just wrecked his bike, poor guy, he's going to live, i don't have many other details.

anyone else?
 
Solution!!

Everyone...

i gave up on the linux side and decided this was possibly a mail header issue and i was right.

putenv ("QMAILUSER=USER");
putenv ("QMAILNAME=FULL_USER_NAME");
putenv ("QMAILHOST=DOMAIN");
$headers = "From: name <email>\n";
$headers .= "Reply-To: name <email>\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain;charset=us-ascii\r\n";

$to="emails";
$subject = "Testing email";
$body = "test";
$err = mail($to, $subject, $body, $headers);

this works for everything!

http://kb.swsoft.com/article_51_1251_en.html

is where i got the header code from. I modified it a bit.

on a side note, i NEVER contribute to forums in a constructive way, this would be the first solution i've come up with to date.

I hope this saves some of you some hair...
 
Back
Top