New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty mail body #17
Comments
I am seeing the same issue: Using the SMTP plugin I will get an email, but the body is empty, both when using the SMTP test page in the admin panel, and when using any other email feature (password reset, etc.). I am using an in-house exchange server with no authorization. I can also reproduce the debug trail from the forum thread. This indicates that the
I get the following output when trying to send email (from admin test panel):
Note that J2 is missing. SMTP plugin, Installed version: 2017-02-08 |
This seems to be a bug in the way Exchange server is interpreting the mail. Apparently, (some) Exchange servers is not happy with a single end of line character between header and body, but requires TWO (see e.g. https://www.hmailserver.com/forum/viewtopic.php?t=7456 ). While this is most likely a problem on the Exchange server's side, it should be easy to fix in the next update of the plugin by including an extra blank line between header and body. |
Hello, I've looked into the issue and found that, after the "Content-Transfer-Encoding: base64" string, there is no carriage return (\r), but only 2 line feed chars (\n). So, I've added the missing carriage return with the following patch in the "toString()" function inside classes\Message.php:
I'm not sure if this is the best way to do that, but it works on my installation. SMTP server : Exchange server. Hope that helps. |
Ok UNIX problem ..you need to put : \r in line 88 ( $body = join("\r\n", $lines);) of /site/lib/plugins/smtp/classes/message.php |
I followed suggestions in https://forum.dokuwiki.org/thread/14686 which solved the issue for me. Also adds a blank line after the header but in slightly different way.
I hope hope this can help in fixing the plugin (I couldn't easily figure out how to fix code on github) grts |
The suggested fixes did not worked for me. Previous fix mentioned by @Netand1 worked for plain text emails but not for HTML emails. There are likely more issues with new line encoding. My fix was: public function toString() {
// we need to remove the BCC header here
$body = str_replace("\r\n", "\n", $this->body); // added line
$lines = explode("\n", $body); // changed line
$count = count($lines);
for($i=0; $i<$count; $i++) {
if(trim($lines[$i]) === '') break; // end of headers, we're done
if(substr($lines[$i],0, 4) == 'Bcc:') {
unset($lines[$i]); // we found the Bcc: header and remove it
while(substr($lines[++$i],0, 1) === ' ') {
unset($lines[$i]); // indented lines are header continuiation
}
break; // header removed, we're done
}
}
$body = join("\r\n", $lines); // fix suggested by @Netand1
return $body . $this->CRLF . $this->CRLF . "." . $this->CRLF;
} This fix works both for plaintext and html emails. |
that thing also worked for me, simply add "\r" in the line specified. |
Resolves issue splitbrain#17
Had the same issue, your workaround #17 (comment) works for me too. In my case the file is uppercase (Message.php), so (path_to_dokuwiki_htdocs)/lib/plugins/smtp/classes/Message.php |
Can confirm that adding /r on line 88 of Message.php fixes the empty mail body when using the plugin with Exchange (in our case, Exchange 2019). Works for both plain text and HTML mails. |
When I create a new user the DokuWiki sents out a mail with the password info but the mail body is completely empty... The same happens when I get a notification about a changed article.
Release 2016-06-26a "Elenor of Tsort"
SMTP Server is an Exchange Server 2013
With the SwiftMailer Plugin everything works fine
If more information is needed, let me know.
The text was updated successfully, but these errors were encountered: