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

New: Native DKIM capability for emails #16421

Open
wants to merge 3 commits into
base: 3.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
55 changes: 55 additions & 0 deletions _build/data/transport.core.system_settings.php
Expand Up @@ -902,6 +902,61 @@
'area' => 'mail',
'editedon' => null,
], '', true, true);

$settings['mail_dkim_selector'] = $xpdo->newObject(modSystemSetting::class);
$settings['mail_dkim_selector']->fromArray([
'key' => 'mail_dkim_selector',
'value' => '',
'xtype' => 'textfield',
'namespace' => 'core',
'area' => 'mail',
'editedon' => null,
], '', true, true);
$settings['mail_dkim_identity'] = $xpdo->newObject(modSystemSetting::class);
$settings['mail_dkim_identity']->fromArray([
'key' => 'mail_dkim_identity',
'value' => '',
'xtype' => 'textfield',
'namespace' => 'core',
'area' => 'mail',
'editedon' => null,
], '', true, true);
$settings['mail_dkim_domain'] = $xpdo->newObject(modSystemSetting::class);
$settings['mail_dkim_domain']->fromArray([
'key' => 'mail_dkim_domain',
'value' => '',
'xtype' => 'textfield',
'namespace' => 'core',
'area' => 'mail',
'editedon' => null,
], '', true, true);
$settings['mail_dkim_privatekeyfile'] = $xpdo->newObject(modSystemSetting::class);
$settings['mail_dkim_privatekeyfile']->fromArray([
'key' => 'mail_dkim_privatekeyfile',
'value' => '',
'xtype' => 'textfield',
'namespace' => 'core',
'area' => 'mail',
'editedon' => null,
], '', true, true);
$settings['mail_dkim_privatekeystring'] = $xpdo->newObject(modSystemSetting::class);
$settings['mail_dkim_privatekeystring']->fromArray([
'key' => 'mail_dkim_privatekeystring',
'value' => '',
'xtype' => 'textfield',
krisznet marked this conversation as resolved.
Show resolved Hide resolved
'namespace' => 'core',
'area' => 'mail',
'editedon' => null,
], '', true, true);
$settings['mail_dkim_passphrase'] = $xpdo->newObject(modSystemSetting::class);
$settings['mail_dkim_passphrase']->fromArray([
'key' => 'mail_dkim_passphrase',
'value' => '',
'xtype' => 'textfield',
krisznet marked this conversation as resolved.
Show resolved Hide resolved
'namespace' => 'core',
'area' => 'mail',
'editedon' => null,
], '', true, true);
$settings['manager_date_format'] = $xpdo->newObject(modSystemSetting::class);
$settings['manager_date_format']->fromArray([
'key' => 'manager_date_format',
Expand Down
18 changes: 18 additions & 0 deletions core/lexicon/en/setting.inc.php
Expand Up @@ -396,6 +396,24 @@
$_lang['setting_mail_smtp_user'] = 'SMTP User';
$_lang['setting_mail_smtp_user_desc'] = 'The user to authenticate to SMTP against.';

$_lang['setting_mail_dkim_selector'] = 'DKIM Selector';
$_lang['setting_mail_dkim_selector_desc'] = 'The DKIM domain selector where the public key stored.';

$_lang['setting_mail_dkim_identity'] = 'DKIM Identity';
$_lang['setting_mail_dkim_identity_desc'] = 'DKIM identity you\'re signing as - usually your From address';

$_lang['setting_mail_dkim_domain'] = 'DKIM Domain';
$_lang['setting_mail_dkim_domain_desc'] = 'DKIM signing domain name.';

$_lang['setting_mail_dkim_privatekeyfile'] = 'DKIM Private key file';
$_lang['setting_mail_dkim_privatekeyfile_desc'] = 'DKIM private key file path. You can use DKIM Private key string instead of this.';

$_lang['setting_mail_dkim_privatekeystring'] = 'DKIM Private key string';
$_lang['setting_mail_dkim_privatekeystring_desc'] = 'Takes precedence over DKIM Private key file.';

$_lang['setting_mail_dkim_passphrase'] = 'DKIM Passphrase';
$_lang['setting_mail_dkim_passphrase_desc'] = 'Used only if your key is encrypted.';

$_lang['setting_main_nav_parent'] = 'Main menu parent';
$_lang['setting_main_nav_parent_desc'] = 'The container used to pull all records for the main menu.';

Expand Down
6 changes: 6 additions & 0 deletions core/src/Revolution/Mail/modMail.php
Expand Up @@ -259,6 +259,12 @@ public function getDefaultAttributes(array $attributes = [])
$default[modMail::MAIL_SMTP_TIMEOUT] = $this->modx->getOption('mail_smtp_timeout', null, 10);
$default[modMail::MAIL_SMTP_USER] = $this->modx->getOption('mail_smtp_user', null, '');
}
$default[modMail::MAIL_DKIM_SELECTOR] = $this->modx->getOption('mail_dkim_selector', null, '');
$default[modMail::MAIL_DKIM_IDENTITY] = $this->modx->getOption('mail_dkim_identity', null, '');
$default[modMail::MAIL_DKIM_DOMAIN] = $this->modx->getOption('mail_dkim_domain', null, '');
$default[modMail::MAIL_DKIM_PRIVATEKEYFILE] = $this->modx->getOption('mail_dkim_privatekeyfile', null, '');
$default[modMail::MAIL_DKIM_PRIVATEKEYSTRING] = $this->modx->getOption('mail_dkim_privatekeystring', null, '');
$default[modMail::MAIL_DKIM_PASSPHRASE] = $this->modx->getOption('mail_dkim_passphrase', null, '');
$default[modMail::MAIL_CHARSET] = $this->modx->getOption('mail_charset', null, 'UTF-8');
$default[modMail::MAIL_ENCODING] = $this->modx->getOption('mail_encoding', null, '8bit');

Expand Down