Skip to content
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

Sendmail transport #4

Open
wants to merge 5 commits into
base: 16.1
Choose a base branch
from

Conversation

BastienDurel
Copy link

Added a configuration option to force all mail go through local sendmail transport.
This allows mail to work on restrictive shared hosting

@BastienDurel
Copy link
Author

Any comment ?

$api_config = Api\Config::read('phpgwapi');

if (!empty($GLOBALS['egw_info']['server']['sendmail']) ||
!empty($api_config['sendmail']))
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you add that code?

Your $api_config is identical to $GLOBALS['egw_info']['server'].

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I didn't found a way to make the changes in config file persistant across setup.php usage ; so I moved to DB configuration to have an in-browser configuration

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the same thing, first thing EGroupware does is to read what you call DB configuration into $GLOBALS['egw_info']['server'] to the stuff already there from the header.inc.php.

So please remove/revert that, as it is unnecessary.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thanks (I did not knew that)

@ralfbecker
Copy link
Member

Sorry, was quite busy moving our whole hosting to an other infrastructure provider.

If we implement sendmail transport as a global config, which is probably the right thing to do, if provider blocks outgoing SMTP ports, we should also skip SMTP step in wizard:

https://github.com/EGroupware/egroupware/blob/master/admin/inc/class.admin_mail.inc.php#L567

$next_step = empty($GLOBAL['egw_info']['server']['sendmail']) ? 'smtp' : 'edit';
return $this->$next_step($content, lang('Successful connected to %1 server%2.', 'Sieve',
							' '.lang('and logged in')));

and disable SMTP tab in mail account editing:
https://github.com/EGroupware/egroupware/blob/master/admin/inc/class.admin_mail.inc.php#L1279

// disable SMTP tab if we configured sendmail only
if (!empty($GLOBALS['egw_info']['server']['sendmail']))
{
    $readonlys['tabs']['admin.mailaccount.smtp'] = true;
    unset($content['acc_smtp_type']);
}

Ralf

@ralfbecker
Copy link
Member

Same thing I said above is true for your new "Skip SMTP configuration..." commit, no need to read $app_config again, it is already in $GLOBALS['egw_info']['server'].

…hen don't need to run Api\Config::read('phpgwapi')
@BastienDurel
Copy link
Author

Hello,

Will this merge request have a chance to be merged ?

@ralfbecker
Copy link
Member

Sorry, did not found time to test it yet.

The change makes sense to me, so if it works, I'm happy to merge it.

Ralf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants