Skip to content

Commit

Permalink
Add ability to force Sendmail transport from config file
Browse files Browse the repository at this point in the history
  • Loading branch information
BastienDurel committed Feb 10, 2017
1 parent 0bc700c commit d3066ab
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions api/src/Mailer.php
Expand Up @@ -17,6 +17,7 @@
use Horde_Mail_Rfc822_List;
use Horde_Mail_Exception;
use Horde_Mail_Transport;
use Horde_Mail_Transport_Sendmail;
use Horde_Mail_Transport_Null;
use Horde_Mime_Headers_MessageId;
use Horde_Text_Flowed;
Expand Down Expand Up @@ -503,6 +504,13 @@ function send(Horde_Mail_Transport $transport=null, $resend=true, $flowed=null)
{
unset($resend); // parameter is not used, but required by function signature

if ($transport === null &&
isset($GLOBALS['egw_info']['server']['sendmail']) &&
$GLOBALS['egw_info']['server']['sendmail'])
{
$transport = new Horde_Mail_Transport_Sendmail();
}

This comment has been minimized.

Copy link
@ralfbecker

ralfbecker Feb 10, 2017

This is not a good place to add that code, better would be to add it here:

https://github.com/EGroupware/egroupware/blob/master/api/src/Mail/Account.php#L484

if (!empty($GLOBALS['egw_info']['server']['sendmail'])))
{
$this->smtpTransport = new Horde_Mail_Transport_Sendmail();
}
else

if (!($message_id = $this->getHeader('Message-ID')) &&
class_exists('Horde_Mime_Headers_MessageId')) // since 2.5.0
{
Expand Down

0 comments on commit d3066ab

Please sign in to comment.