• 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!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • 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.

Resolved Change header email / Apache invalide : AH00526: Syntax error on line 1

Erwan

Regular Pleskian
Hi all,

I have to put a directive for domain for sending emails using a header with a different domain.
But plesk change the header.
Domain: mydomainA.com
PHP function set this header: [email protected] but Plesk change it by the default [email protected].

So i've found this: https://support.plesk.com/hc/en-us/...n-are-rejected-on-some-recipient-mail-servers

But if i add the following line to the additional configuration directives:
sendmail_path="/usr/sbin/sendmail -t -i -f [email protected]"

I've this error:
Configuration Apache invalide : AH00526: Syntax error on line 1 of /var/www/vhosts/system/mydomainA.com/conf/vhost_ssl.conf: Invalid command 'sendmail_path="/usr/sbin/sendmail', perhaps misspelled or defined by a module not included in the server configuration

And there isn't directory "conf" in /var/www/vhosts/system/mydomainA.com/.
How can i solve the problem?
Is there another way to impose a header or disable Plesk header by default for a domain?

Thank you

Erwan
 
Hi Peter,

No, this is not the header that i want.

I want "From": [email protected]
But Plesk change it to: [email protected] (default domain).

PHP
$to = '[email protected]';
$subject = 'Test';
$message = 'Hello !';
$headers = 'From: [email protected]' . "\r\n" .
'Reply-To: [email protected]' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);


But the email i receive:
Subject: Test A
Reply-To: <[email protected]> OK
X-Mailer: PHP/8.1
X-PPP-Message-ID: <.......>
From: [email protected] NOT OK / CHANGE BY PLESK
X-PPP-Vhost: mydomainA.com


So i've try this to force: https://support.plesk.com/hc/en-us/...n-are-rejected-on-some-recipient-mail-servers
But i can not save, i've this error:
Configuration Apache invalide : AH00526: Syntax error on line 1 of /var/www/vhosts/system/mydomainA.com/conf/vhost_ssl.conf: Invalid command 'sendmail_path="/usr/sbin/sendmail', perhaps misspelled or defined by a module not included in the server configuration
 
So i've try this to force: https://support.plesk.com/hc/en-us/...n-are-rejected-on-some-recipient-mail-servers
But i can not save, i've this error:
Configuration Apache invalide : AH00526: Syntax error on line 1 of /var/www/vhosts/system/mydomainA.com/conf/vhost_ssl.conf: Invalid command 'sendmail_path="/usr/sbin/sendmail', perhaps misspelled or defined by a module not included in the server configuration

I've tested setting sendmail_path="/usr/sbin/sendmail -t -i -f [email protected]" to the PHP additional configuration directives on a domain on my server and that worked without any issue. What Plesk version are you running?
 
Last edited:
Obsedian 18.0.34 / Centos 7.9 / FPM by Apache

If i put command in "Additional Apache directives", error:
Configuration Apache invalide : AH00526: Syntax error on line 1 of /var/www/vhosts/system/mydomainA.com/conf/vhost_ssl.conf: Invalid command 'sendmail_path="/usr/sbin/sendmail', perhaps misspelled or defined by a module not included in the server configuration

If i put command in PHP "Additional directives", no error but header still the same.
 
The command needs to go into the PHP additional directives, not Apache. It has nothing to do with the web server, but only with PHP.

Have you tried to add the 5th parameter to the mail() function as described above?
 
Peter,

So i've added in the the PHP additional directives:
sendmail_path="/usr/sbin/sendmail -t -i -f [email protected]"

And my PHP function:
$to = '[email protected]';
$subject = 'Test';
$message = 'Hello !';
$headers = 'From: [email protected]' . "\r\n" .
'Reply-To: [email protected]' ;

//$additionnal_param = "-f [email protected]";
$additionnal_param = "[email protected]";
mail($to, $subject, $message, $headers, $additionnal_param);

No error when i execute but i still receive email from [email protected].

Subject: Test A
Reply-To: <[email protected]> ==> OK
X-Mailer: PHP/8.1
X-PPP-Message-ID: <....>
From: [email protected] ==> NOT OK
X-PPP-Vhost: mydomainA.com
Message-ID: <....>
Date: Wed, 8 Mar 2023 11:52:48 +0100
Return-Path: [email protected] ==> NOT OK
 
Peter,

Because i've found example on the php documentation without whitespace: PHP: mail - Manual
But i've also tested with a whitespace:

$to = '[email protected]';
$subject = 'Test';
$message = 'Hello !';
$headers = 'From: [email protected]' . "\r\n" .
'Reply-To: [email protected]' . "\r\n" .

'Return-Path: [email protected]';
$additionnal_param = "-f [email protected]";
mail($to, $subject, $message, $headers, $additionnal_param);

Same result...

Subject: Test A
Reply-To: <[email protected]>
...
From: [email protected]
...
...
Date: Wed, 8 Mar 2023 13:12:32 +0100
Return-Path: [email protected]
...
 
What is the setting of Tools & Settings > Mail > Mail Server Settings > Fix incorrectly set sender for outgoing mail. Is this on or off? Does it change the result when you toggle it?
 
Grrrr.. yes it change...
It was on. When i turn off, email is correct.

It is possible to turn on (this is a server with multiple clients) and to desactivate this option for one domain only?
 
Back
Top