Alex Posted October 3, 2013 Report Posted October 3, 2013 I reported this to Paul a while back, but haven't had time to get it on the forums until now. Whenever we use SMTP for outgoing mail in Blesta (have tried 3 different servers) we do not get any mail logging of the content. However, if we use PHP piping for outgoing mail, the log works just fine. I have attached some screenshots displaying the problem while using the Rackspace mail servers. Just to be clear, SMTP mail logging has never worked for us at any point, this is not something that "broke"
Cody Posted October 3, 2013 Report Posted October 3, 2013 Looks like it's logging just fine, based on your second screenshot. To confirm, check the log_mail table for entries. I believe the issue you're seeing is that only plain-text versions of emails are displayed in the UI, and it looks like you have no plain-text versions of your emails. Blesta should automatically convert your HTML emails to plain-text when delivered, but if the plain-text email template contains anything (including white space) that would prevent the automatic conversion from taking place.
Alex Posted October 3, 2013 Author Report Posted October 3, 2013 Looks like it's logging just fine, based on your second screenshot. To confirm, check the log_mail table for entries. I believe the issue you're seeing is that only plain-text versions of emails are displayed in the UI, and it looks like you have no plain-text versions of your emails. Blesta should automatically convert your HTML emails to plain-text when delivered, but if the plain-text email template contains anything (including white space) that would prevent the automatic conversion from taking place. Logging just fine? Logging without content. We have no HTML emails, all we use is plain text. The HTML tab is empty for all of the templates, there is only content in the Text tab. Also, as I said, it works fine with PHP piping without changing the templates.
Cody Posted October 3, 2013 Report Posted October 3, 2013 Logging just fine? Logging without content. We have no HTML emails, all we use is plain text. The HTML tab is empty for all of the templates, there is only content in the Text tab. Also, as I said, it works fine with PHP piping without changing the templates. In that case, Include your configuration settings, i.e. OS, version of Blesta, PHP & MySQL.
Cody Posted October 3, 2013 Report Posted October 3, 2013 I was just able to duplicate. Created CORE-795. When HTML emails are disabled, the email component is not able to find the plain-text version of the email content for logging. Michael 1
Cody Posted October 3, 2013 Report Posted October 3, 2013 CORE-795 is fixed for 3.0.4. To patch yourself update /components/email/email.php lines 260-276: from: $body_text = null; foreach ($this->message->getChildren() as $child) { if ($child->getContentType() == "text/plain") $body_text = $child->getBody(); } $vars = array_merge($vars, array( 'to_address'=>implode(',', array_keys((array)$this->message->getTo())), 'from_address'=>implode(',', array_keys((array)$this->message->getFrom())), 'from_name'=>implode(',', array_values((array)$this->message->getFrom())), 'cc_address'=>$cc_address, 'subject'=>$this->message->getSubject(), 'body_text'=>($body_text), 'body_html'=>($this->message->getContentType() != 'text/plain' ? $this->message->getBody() : null) ) ); to: $body_text = null; $body_html = null; foreach ($this->message->getChildren() as $child) { if ($child->getContentType() == "text/plain") $body_text = $child->getBody(); } if ($body_text === null) $body_text = $this->message->getBody(); else $body_html = $this->message->getBody(); $vars = array_merge($vars, array( 'to_address'=>implode(',', array_keys((array)$this->message->getTo())), 'from_address'=>implode(',', array_keys((array)$this->message->getFrom())), 'from_name'=>implode(',', array_values((array)$this->message->getFrom())), 'cc_address'=>$cc_address, 'subject'=>$this->message->getSubject(), 'body_text'=>$body_text, 'body_html'=>$body_html ) ); Michael 1
Recommended Posts