diff --git a/modules/advanced_mailer/advanced_mailer.admin.controller.php b/modules/advanced_mailer/advanced_mailer.admin.controller.php new file mode 100644 index 000000000..fbbf106f4 --- /dev/null +++ b/modules/advanced_mailer/advanced_mailer.admin.controller.php @@ -0,0 +1,304 @@ + + * @license GPLv2 or Later + * @brief Advanced Mailer Admin Controller + */ +class Advanced_MailerAdminController extends Advanced_Mailer +{ + /** + * Save the basic configuration. + */ + public function procAdvanced_MailerAdminInsertConfig() + { + // Get and validate the new configuration. + $vars = Context::getRequestVars(); + if (!$vars->sender_name) + { + return new Object(-1, 'msg_advanced_mailer_sender_name_is_empty'); + } + if (!$vars->sender_email) + { + return new Object(-1, 'msg_advanced_mailer_sender_email_is_empty'); + } + if (!Mail::isVaildMailAddress($vars->sender_email)) + { + return new Object(-1, 'msg_advanced_mailer_sender_email_is_invalid'); + } + if ($vars->reply_to && !Mail::isVaildMailAddress($vars->reply_to)) + { + return new Object(-1, 'msg_advanced_mailer_reply_to_is_invalid'); + } + + // Validate the sending method. + $sending_methods = Rhymix\Framework\Mail::getSupportedDrivers(); + $sending_method = $vars->sending_method; + if (!array_key_exists($sending_method, $sending_methods)) + { + return new Object(-1, 'msg_advanced_mailer_sending_method_is_invalid'); + } + + // Validate the configuration for the selected sending method. + $sending_method_config = array(); + foreach ($sending_methods[$sending_method]['required'] as $conf_name) + { + $conf_value = $vars->{$sending_method . '_' . $conf_name} ?: null; + if (!$conf_value) + { + return new Object(-1, 'msg_advanced_mailer_smtp_host_is_invalid'); + } + $sending_method_config[$conf_name] = $conf_value; + } + + // Update the current module's configuration. + $config = $this->getConfig(); + $config->sender_name = $vars->sender_name; + $config->sender_email = $vars->sender_email; + $config->reply_to = $vars->reply_to; + $config->force_sender = toBool($vars->force_sender); + $config->log_sent_mail = toBool($vars->log_sent_mail); + $config->log_errors = toBool($vars->log_errors); + $output = getController('module')->insertModuleConfig('advanced_mailer', $config); + if ($output->toBool()) + { + $this->setMessage('success_registed'); + } + else + { + return $output; + } + + // Update the webmaster's name and email in the member module. + getController('module')->updateModuleConfig('member', (object)array( + 'webmaster_name' => $config->sender_name, + 'webmaster_email' => $config->sender_email, + )); + + // Update system configuration. + Rhymix\Framework\Config::set("mail.type", $sending_method); + Rhymix\Framework\Config::set("mail.$sending_method", $sending_method_config); + Rhymix\Framework\Config::save(); + + if (Context::get('success_return_url')) + { + $this->setRedirectUrl(Context::get('success_return_url')); + } + else + { + $this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminConfig')); + } + } + + /** + * Save the exception configuration. + */ + public function procAdvanced_MailerAdminInsertExceptions() + { + // Get the current configuration. + $config = $this->getConfig(); + $sending_methods = Rhymix\Framework\Mail::getSupportedDrivers(); + + // Get and validate the list of exceptions. + $exceptions = array(); + for ($i = 1; $i <= 3; $i++) + { + $method = strval(Context::get('exception_' . $i . '_method')); + $domains = trim(Context::get('exception_' . $i . '_domains')); + if ($method !== '' && $domains !== '') + { + if ($method !== 'default' && !isset($sending_methods[$method])) + { + return new Object(-1, 'msg_advanced_mailer_sending_method_is_invalid'); + } + if ($method !== 'default') + { + foreach ($this->sending_methods[$method]['required'] as $conf_name) + { + if (!Rhymix\Framework\Config::get("mail.$method.$conf_name")) + { + return new Object(-1, sprintf( + Context::getLang('msg_advanced_mailer_sending_method_is_not_configured'), + Context::getLang('cmd_advanced_mailer_sending_method_' . $method))); + } + } + } + $exceptions[$i]['method'] = $method; + $exceptions[$i]['domains'] = array(); + + $domains = array_map('trim', preg_split('/[,\n]/', $domains, null, PREG_SPLIT_NO_EMPTY)); + foreach ($domains as $domain) + { + if (strpos($domain, 'xn--') !== false) + { + $domain = Rhymix\Framework\URL::decodeIdna($domain); + } + $exceptions[$i]['domains'][] = $domain; + } + } + } + + // Save the new configuration. + $config->exceptions = $exceptions; + $output = getController('module')->insertModuleConfig('advanced_mailer', $config); + if ($output->toBool()) + { + $this->setMessage('success_registed'); + } + else + { + return $output; + } + + if (Context::get('success_return_url')) + { + $this->setRedirectUrl(Context::get('success_return_url')); + } + else + { + $this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminExceptions')); + } + } + + /** + * Check the DNS record of a domain. + */ + public function procAdvanced_MailerAdminCheckDNSRecord() + { + $check_config = Context::gets('hostname', 'record_type'); + if (!preg_match('/^[a-z0-9_.-]+$/', $check_config->hostname)) + { + $this->add('record_content', false); + return; + } + if (!defined('DNS_' . $check_config->record_type)) + { + $this->add('record_content', false); + return; + } + + $records = @dns_get_record($check_config->hostname, constant('DNS_' . $check_config->record_type)); + if ($records === false) + { + $this->add('record_content', false); + return; + } + + $return_values = array(); + foreach ($records as $record) + { + if (isset($record[strtolower($check_config->record_type)])) + { + $return_values[] = $record[strtolower($check_config->record_type)]; + } + } + $this->add('record_content', implode("\n\n", $return_values)); + return; + } + + /** + * Clear old sending log. + */ + public function procAdvanced_mailerAdminClearSentMail() + { + $status = Context::get('status'); + $clear_before_days = intval(Context::get('clear_before_days')); + if (!in_array($status, array('success', 'error'))) + { + return new Object(-1, 'msg_invalid_request'); + } + if ($clear_before_days < 0) + { + return new Object(-1, 'msg_invalid_request'); + } + + $obj = new stdClass(); + $obj->status = $status; + $obj->regdate = date('YmdHis', time() - ($clear_before_days * 86400) + zgap()); + $output = executeQuery('advanced_mailer.deleteLogs', $obj); + + if ($status === 'success') + { + $this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminSentMail')); + } + else + { + $this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAdvanced_mailerAdminErrors')); + } + } + + /** + * Send a test email using a temporary configuration. + */ + public function procAdvanced_MailerAdminTestSend() + { + $advanced_mailer_config = $this->getConfig(); + $recipient_config = Context::gets('recipient_name', 'recipient_email'); + $recipient_name = $recipient_config->recipient_name; + $recipient_email = $recipient_config->recipient_email; + + if (!$recipient_name) + { + $this->add('test_result', 'Error: ' . Context::getLang('msg_advanced_mailer_recipient_name_is_empty')); + return; + } + if (!$recipient_email) + { + $this->add('test_result', 'Error: ' . Context::getLang('msg_advanced_mailer_recipient_email_is_empty')); + return; + } + if (!Mail::isVaildMailAddress($recipient_email)) + { + $this->add('test_result', 'Error: ' . Context::getLang('msg_advanced_mailer_recipient_email_is_invalid')); + return; + } + + try + { + $oMail = new Rhymix\Framework\Mail(); + $oMail->setTitle('Advanced Mailer Test : ' . strtoupper(config('mail.type'))); + $oMail->setContent('

This is a test email from Advanced Mailer.

Thank you for trying Advanced Mailer.

' . + '

고급 메일 발송 모듈 테스트 메일입니다.

메일이 정상적으로 발송되고 있습니다.

'); + $oMail->setFrom($advanced_mailer_config->sender_email, $advanced_mailer_config->sender_name); + $oMail->addTo($recipient_email, $recipient_name); + $result = $oMail->send(); + + if (!$result) + { + if (count($oMail->errors)) + { + if (config('mail.type') === 'smtp') + { + if (strpos(config('mail.smtp.smtp_host'), 'gmail.com') !== false && strpos(implode("\n", $oMail->errors), 'code "535"') !== false) + { + $this->add('test_result', Context::getLang('msg_advanced_mailer_google_account_security')); + return; + } + if (strpos(config('mail.smtp.smtp_host'), 'naver.com') !== false && strpos(implode("\n", $oMail->errors), 'Failed to authenticate') !== false) + { + $this->add('test_result', Context::getLang('msg_advanced_mailer_naver_smtp_disabled')); + return; + } + } + + $this->add('test_result', nl2br(htmlspecialchars(implode("\n", $oMail->errors)))); + return; + } + else + { + $this->add('test_result', Context::getLang('msg_advanced_mailer_unknown_error')); + return; + } + } + } + catch (Exception $e) + { + $this->add('test_result', nl2br(htmlspecialchars($e->getMessage()))); + return; + } + + $this->add('test_result', Context::getLang('msg_advanced_mailer_test_success')); + return; + } +} diff --git a/modules/advanced_mailer/advanced_mailer.admin.view.php b/modules/advanced_mailer/advanced_mailer.admin.view.php new file mode 100644 index 000000000..b64ec12a3 --- /dev/null +++ b/modules/advanced_mailer/advanced_mailer.admin.view.php @@ -0,0 +1,256 @@ + + * @license GPLv2 or Later + * @brief Advanced Mailer Admin View + */ +class Advanced_MailerAdminView extends Advanced_Mailer +{ + /** + * Display the general configuration form. + */ + public function dispAdvanced_MailerAdminConfig() + { + $advanced_mailer_config = $this->getConfig(); + $member_config = getModel('module')->getModuleConfig('member'); + $sending_methods = Rhymix\Framework\Mail::getSupportedDrivers(); + + Context::set('advanced_mailer_config', $advanced_mailer_config); + Context::set('sending_methods', $sending_methods); + Context::set('sending_method', config('mail.type')); + Context::set('webmaster_name', $member_config->webmaster_name ? $member_config->webmaster_name : 'webmaster'); + Context::set('webmaster_email', $member_config->webmaster_email); + + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('config'); + } + + /** + * Display the exception domains configuration form. + */ + public function dispAdvanced_MailerAdminExceptions() + { + $advanced_mailer_config = $this->getConfig(); + $sending_methods = Rhymix\Framework\Mail::getSupportedDrivers(); + + for ($i = 1; $i <= 3; $i++) + { + if (!isset($advanced_mailer_config->exceptions[$i])) + { + $advanced_mailer_config->exceptions[$i] = array('method' => '', 'domains' => array()); + } + elseif ($advanced_mailer_config->exceptions[$i]['method'] === 'mail') + { + $advanced_mailer_config->exceptions[$i]['method'] = 'mailfunction'; + } + } + + Context::set('advanced_mailer_config', $advanced_mailer_config); + Context::set('sending_methods', $sending_methods); + Context::set('sending_method', config('mail.type')); + + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('exceptions'); + } + + /** + * Display the SPF/DKIM setting guide. + */ + public function dispAdvanced_MailerAdminSpfDkim() + { + $advanced_mailer_config = $this->getConfig(); + $sending_methods = Rhymix\Framework\Mail::getSupportedDrivers(); + + Context::set('advanced_mailer_config', $advanced_mailer_config); + Context::set('sending_methods', $sending_methods); + Context::set('sending_method', config('mail.type')); + if (strpos($advanced_mailer_config->sender_email, '@') !== false) + { + Context::set('sending_domain', substr(strrchr($advanced_mailer_config->sender_email, '@'), 1)); + } + else + { + Context::set('sending_domain', preg_replace('/^www\./', '', $_SERVER['HTTP_HOST'])); + } + + $used_methods = array(config('mail.type')); + $advanced_mailer_config->exceptions = $advanced_mailer_config->exceptions ?: array(); + foreach ($advanced_mailer_config->exceptions as $exception) + { + if ($exception['method'] !== 'default' && $exception['method'] !== $used_methods[0] && count($exception['domains'])) + { + $used_methods[] = $exception['method']; + } + } + Context::set('used_methods', $used_methods); + + $used_methods_with_usable_spf = array(); + $used_methods_with_usable_dkim = array(); + foreach ($used_methods as $method) + { + if ($method === 'woorimail' && config('mail.woorimail.api_type') === 'free') continue; + if ($sending_methods[$method]['spf_hint']) + { + if (strpos($sending_methods[$method]['spf_hint'], '$SERVER_ADDR') !== false) + { + $used_methods_with_usable_spf[$method] = strtr($sending_methods[$method]['spf_hint'], array('$SERVER_ADDR' => $this->getServerIP())); + } + else + { + $used_methods_with_usable_spf[$method] = $sending_methods[$method]['spf_hint']; + } + } + if ($sending_methods[$method]['dkim_hint']) + { + $used_methods_with_usable_dkim[$method] = $sending_methods[$method]['dkim_hint']; + } + } + ksort($used_methods_with_usable_spf); + ksort($used_methods_with_usable_dkim); + Context::set('used_methods_with_usable_spf', $used_methods_with_usable_spf); + Context::set('used_methods_with_usable_dkim', $used_methods_with_usable_dkim); + + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('spf_dkim'); + } + + /** + * Display the test send form. + */ + public function dispAdvanced_MailerAdminTestConfig() + { + $advanced_mailer_config = $this->getConfig(); + $sending_methods = Rhymix\Framework\Mail::getSupportedDrivers(); + + Context::set('advanced_mailer_config', $advanced_mailer_config); + Context::set('sending_methods', $sending_methods); + Context::set('sending_method', config('mail.type')); + + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('test'); + } + + /** + * Display the sent mail log. + */ + public function dispAdvanced_MailerAdminSentMail() + { + $obj = new stdClass(); + $obj->status = 'success'; + $obj->page = $page = Context::get('page') ?: 1; + $maillog = executeQuery('advanced_mailer.getLogByType', $obj); + $maillog = $maillog->toBool() ? $this->procMailLog($maillog->data) : array(); + Context::set('advanced_mailer_log', $maillog); + Context::set('advanced_mailer_status', 'success'); + + $paging = $this->procPaging('success', $page); + Context::set('total_count', $paging->total_count); + Context::set('total_page', $paging->total_page); + Context::set('page', $paging->page); + Context::set('page_navigation', $paging->page_navigation); + + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('view_log'); + } + + /** + * Display the error log. + */ + public function dispAdvanced_MailerAdminErrors() + { + $obj = new stdClass(); + $obj->status = 'error'; + $obj->page = $page = Context::get('page') ?: 1; + $maillog = executeQuery('advanced_mailer.getLogByType', $obj); + $maillog = $maillog->toBool() ? $this->procMailLog($maillog->data) : array(); + Context::set('advanced_mailer_log', $maillog); + Context::set('advanced_mailer_status', 'error'); + + $paging = $this->procPaging('error', $page); + Context::set('total_count', $paging->total_count); + Context::set('total_page', $paging->total_page); + Context::set('page', $paging->page); + Context::set('page_navigation', $paging->page_navigation); + + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('view_log'); + } + + /** + * Process mail log for display. + */ + public function procMailLog($log) + { + foreach($log as $item) + { + $from = explode("\n", $item->mail_from); + foreach($from as &$fromitem) + { + if(preg_match('/^(.+) <([^>]+)>$/', $fromitem, $matches)) + { + $fromitem = array($matches[2], $matches[1]); + } + else + { + $fromitem = array($fromitem, ''); + } + } + $item->mail_from = $from; + + $to = explode("\n", $item->mail_to); + foreach($to as &$toitem) + { + if(preg_match('/^(.+?) <([^>]+)>$/', $toitem, $matches)) + { + $toitem = array($matches[2], $matches[1]); + } + else + { + $toitem = array($toitem, ''); + } + } + $item->mail_to = $to; + } + + return $log; + } + + /** + * Process paging. + */ + public function procPaging($status, $page = 1) + { + $args = new stdClass; + $args->status = $status; + $count = executeQuery('advanced_mailer.countLogByType', $args); + $total_count = $count->data->count; + $total_page = max(1, ceil($total_count / 20)); + + $output = new Object(); + $output->total_count = $total_count; + $output->total_page = $total_page; + $output->page = $page; + $output->page_navigation = new PageHandler($total_count, $total_page, $page, 10); + return $output; + } + + /** + * Get the public IPv4 address of the current server. + */ + public function getServerIP() + { + if (isset($_SESSION['advanced_mailer_ip_cache']) && $_SESSION['advanced_mailer_ip_cache'][1] > time() - 3600) + { + return $_SESSION['advanced_mailer_ip_cache'][0]; + } + else + { + $ip = trim(FileHandler::getRemoteResource('http://icanhazip.com/')); + $ip = preg_match('/^[0-9]+(\.[0-9]+){3}$/', $ip) ? $ip : false; + $_SESSION['advanced_mailer_ip_cache'] = array($ip, time()); + return $ip; + } + } +} diff --git a/modules/advanced_mailer/advanced_mailer.class.php b/modules/advanced_mailer/advanced_mailer.class.php new file mode 100644 index 000000000..ec2afe6d6 --- /dev/null +++ b/modules/advanced_mailer/advanced_mailer.class.php @@ -0,0 +1,244 @@ + + * @license GPLv2 or Later + * @brief Advanced Mailer Main Class + */ +class Advanced_Mailer extends ModuleObject +{ + /** + * Get the configuration of the current module. + */ + public function getConfig() + { + $config = getModel('module')->getModuleConfig('advanced_mailer'); + if (!is_object($config)) + { + $config = new stdClass(); + } + + if (isset($config->is_enabled) || isset($config->sending_method) || isset($config->send_type)) + { + $config = $this->migrateConfig($config); + getController('module')->insertModuleConfig('advanced_mailer', $config); + } + + return $config; + } + + /** + * Migrate from previous configuration format. + */ + public function migrateConfig($config) + { + $systemconfig = array(); + + if (isset($config->sending_method)) + { + $systemconfig['mail.type'] = $config->sending_method; + } + elseif (isset($config->send_type)) + { + $systemconfig['mail.type'] = $config->send_type; + } + if ($systemconfig['mail.type'] === 'mail') + { + $systemconfig['mail.type'] = 'mailfunction'; + } + + if (isset($config->username)) + { + if (in_array('username', $this->sending_methods[$config->sending_method]['conf'])) + { + $config->{$config->sending_method . '_username'} = $config->username; + } + unset($config->username); + } + + if (isset($config->password)) + { + if (in_array('password', $this->sending_methods[$config->sending_method]['conf'])) + { + $config->{$config->sending_method . '_password'} = $config->password; + } + unset($config->password); + } + + if (isset($config->domain)) + { + if (in_array('domain', $this->sending_methods[$config->sending_method]['conf'])) + { + $config->{$config->sending_method . '_domain'} = $config->domain; + } + unset($config->domain); + } + + if (isset($config->api_key)) + { + if (in_array('api_key', $this->sending_methods[$config->sending_method]['conf'])) + { + $config->{$config->sending_method . '_api_key'} = $config->api_key; + } + unset($config->api_key); + } + + if (isset($config->account_type)) + { + if (in_array('account_type', $this->sending_methods[$config->sending_method]['conf'])) + { + $config->{$config->sending_method . '_account_type'} = $config->account_type; + } + unset($config->account_type); + } + + if (isset($config->aws_region)) + { + $config->ses_region = $config->aws_region; + unset($config->aws_region); + } + + if (isset($config->aws_access_key)) + { + $config->ses_access_key = $config->aws_access_key; + unset($config->aws_access_key); + } + + if (isset($config->aws_secret_key)) + { + $config->ses_secret_key = $config->aws_secret_key; + unset($config->aws_secret_key); + } + + $mail_drivers = Rhymix\Framework\Mail::getSupportedDrivers(); + foreach ($mail_drivers as $driver_name => $driver_definition) + { + foreach ($config as $key => $value) + { + if (strncmp($key, $driver_name . '_', strlen($driver_name) + 1) === 0) + { + $subkey = substr($key, strlen($driver_name) + 1); + switch ($subkey) + { + case 'host': + case 'port': + case 'security': + $systemconfig["mail.$driver_name.smtp_" . $subkey] = $value; + break; + case 'username': + case 'password': + $systemconfig["mail.$driver_name." . ($driver_name === 'smtp' ? 'smtp_' : 'api_') . substr($subkey, 0, 4)] = $value; + break; + case 'account_type': + case 'region': + $systemconfig["mail.$driver_name.api_type"] = $value; + break; + case 'access_key': + $systemconfig["mail.$driver_name.api_user"] = $value; + break; + case 'secret_key': + $systemconfig["mail.$driver_name.api_pass"] = $value; + break; + case 'domain': + $systemconfig["mail.$driver_name.api_domain"] = $value; + break; + case 'api_key': + $systemconfig["mail.$driver_name.api_token"] = $value; + break; + default: + break; + } + unset($config->$key); + } + } + } + + if (count($systemconfig)) + { + foreach ($systemconfig as $key => $value) + { + Rhymix\Framework\Config::set($key, $value); + } + Rhymix\Framework\Config::save(); + } + + unset($config->is_enabled); + unset($config->sending_method); + unset($config->send_type); + $config->log_sent_mail = toBool($config->log_sent_mail); + $config->log_errors = toBool($config->log_errors); + $config->force_sender = toBool($config->force_sender); + if (!isset($config->exceptions)) + { + $config->exceptions = array(); + } + + return $config; + } + + /** + * Register triggers. + */ + public function registerTriggers() + { + $oModuleModel = getModel('module'); + $oModuleController = getController('module'); + if ($oModuleModel->getTrigger('moduleHandler.init', 'advanced_mailer', 'model', 'triggerReplaceMailClass', 'before')) + { + $oModuleController->deleteTrigger('moduleHandler.init', 'advanced_mailer', 'model', 'triggerReplaceMailClass', 'before'); + } + if (!$oModuleModel->getTrigger('mail.send', 'advanced_mailer', 'controller', 'triggerBeforeMailSend', 'before')) + { + $oModuleController->insertTrigger('mail.send', 'advanced_mailer', 'controller', 'triggerBeforeMailSend', 'before'); + } + if (!$oModuleModel->getTrigger('mail.send', 'advanced_mailer', 'controller', 'triggerAfterMailSend', 'after')) + { + $oModuleController->insertTrigger('mail.send', 'advanced_mailer', 'controller', 'triggerAfterMailSend', 'after'); + } + } + + /** + * Install. + */ + public function moduleInstall() + { + $this->registerTriggers(); + return new Object(); + } + + /** + * Check update. + */ + public function checkUpdate() + { + $oModuleModel = getModel('module'); + if ($oModuleModel->getTrigger('moduleHandler.init', 'advanced_mailer', 'model', 'triggerReplaceMailClass', 'before')) + { + return true; + } + if (!$oModuleModel->getTrigger('mail.send', 'advanced_mailer', 'controller', 'triggerBeforeMailSend', 'before')) + { + return true; + } + if (!$oModuleModel->getTrigger('mail.send', 'advanced_mailer', 'controller', 'triggerAfterMailSend', 'after')) + { + return true; + } + return false; + } + + /** + * Update. + */ + public function moduleUpdate() + { + $this->registerTriggers(); + return new Object(0, 'success_updated'); + } + + public function recompileCache() + { + // no-op + } +} diff --git a/modules/advanced_mailer/advanced_mailer.controller.php b/modules/advanced_mailer/advanced_mailer.controller.php new file mode 100644 index 000000000..6cb8a27ff --- /dev/null +++ b/modules/advanced_mailer/advanced_mailer.controller.php @@ -0,0 +1,26 @@ + + * @license GPLv2 or Later + * @brief Advanced Mailer Model + */ +class Advanced_MailerController extends Advanced_Mailer +{ + /** + * Before mail send trigger. + */ + public function triggerBeforeMailSend($mail) + { + + } + + /** + * After mail send trigger. + */ + public function triggerAfterMailSend($mail) + { + + } +} diff --git a/modules/advanced_mailer/advanced_mailer.model.php b/modules/advanced_mailer/advanced_mailer.model.php new file mode 100644 index 000000000..7b2d34577 --- /dev/null +++ b/modules/advanced_mailer/advanced_mailer.model.php @@ -0,0 +1,18 @@ + + * @license GPLv2 or Later + * @brief Advanced Mailer Model + */ +class Advanced_MailerModel extends Advanced_Mailer +{ + /** + * @deprecated + */ + public function triggerReplaceMailClass() + { + + } +} diff --git a/modules/advanced_mailer/conf/info.xml b/modules/advanced_mailer/conf/info.xml new file mode 100644 index 000000000..59ae3da9f --- /dev/null +++ b/modules/advanced_mailer/conf/info.xml @@ -0,0 +1,17 @@ + + + 고급 메일 발송 모듈 + Advanced Mailer + + 외부 SMTP 서버 또는 API를 사용하여 메일을 발송합니다. + + + Send mail using an external SMTP server or API service. + + 2.0.0 + 2016-05-22 + + Kijin Sung + Kijin Sung + + diff --git a/modules/advanced_mailer/conf/module.xml b/modules/advanced_mailer/conf/module.xml new file mode 100644 index 000000000..0a16f0ca2 --- /dev/null +++ b/modules/advanced_mailer/conf/module.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + 고급 메일 발송 모듈 + Advanced Mailer + + + diff --git a/modules/advanced_mailer/lang/en.php b/modules/advanced_mailer/lang/en.php new file mode 100644 index 000000000..62088cf75 --- /dev/null +++ b/modules/advanced_mailer/lang/en.php @@ -0,0 +1,114 @@ +cmd_advanced_mailer = 'Advanced Mailer'; +$lang->cmd_advanced_mailer_general_config = 'General settings'; +$lang->cmd_advanced_mailer_is_enabled = 'Enable module'; +$lang->cmd_advanced_mailer_is_enabled_yes = 'Enabled'; +$lang->cmd_advanced_mailer_is_enabled_no = 'Disabled'; +$lang->cmd_advanced_mailer_logging = 'Logging'; +$lang->cmd_advanced_mailer_log_sent_mail = 'Log Sent Mail'; +$lang->cmd_advanced_mailer_log_errors = 'Log Errors'; +$lang->cmd_advanced_mailer_log_yes = 'Yes'; +$lang->cmd_advanced_mailer_log_no = 'No'; +$lang->cmd_advanced_mailer_sending_method_config = 'Default Sending Method'; +$lang->cmd_advanced_mailer_about_sending_method_config = 'Please fill all of the boxes.'; +$lang->cmd_advanced_mailer_sending_method = 'Sending method'; +$lang->cmd_advanced_mailer_about_sending_method = 'This method will be used for all emails where the recipient\'s email address does not belong to an exception domain.'; +$lang->cmd_advanced_mailer_sending_method_default = 'Default sending method'; +$lang->cmd_advanced_mailer_sending_method_exceptions = 'Exceptions'; +$lang->cmd_advanced_mailer_smtp_manual_entry = 'Manual entry'; +$lang->cmd_advanced_mailer_smtp_host = 'SMTP host'; +$lang->cmd_advanced_mailer_smtp_port = 'SMTP port'; +$lang->cmd_advanced_mailer_smtp_security = 'SMTP security'; +$lang->cmd_advanced_mailer_smtp_security_ssl = 'SSL'; +$lang->cmd_advanced_mailer_smtp_security_tls = 'TLS (STARTTLS)'; +$lang->cmd_advanced_mailer_smtp_security_none = 'None'; +$lang->cmd_advanced_mailer_smtp_user = 'Username'; +$lang->cmd_advanced_mailer_smtp_pass = 'Password'; +$lang->cmd_advanced_mailer_api_domain = 'Domain'; +$lang->cmd_advanced_mailer_api_token = 'API token'; +$lang->cmd_advanced_mailer_api_type = 'API type'; +$lang->cmd_advanced_mailer_api_type_free = 'Free account'; +$lang->cmd_advanced_mailer_api_type_paid = 'Paid account'; +$lang->cmd_advanced_mailer_api_user = 'Username'; +$lang->cmd_advanced_mailer_api_pass = 'Password'; +$lang->cmd_advanced_mailer_sender_identity = 'Sender Identity'; +$lang->cmd_advanced_mailer_about_sender_identity = 'Sender identity will be applied to the webmaster\'s name and email address in the member module as well.'; +$lang->cmd_advanced_mailer_sender_name = 'Sender\'s name'; +$lang->cmd_advanced_mailer_sender_email = 'Sender\'s email'; +$lang->cmd_advanced_mailer_reply_to = 'Reply-To email'; +$lang->cmd_advanced_mailer_force_sender = 'Always Use This Email'; +$lang->cmd_advanced_mailer_about_force_sender = 'Automatically change to the email address above if another module tries to send from a different address.'; +$lang->cmd_advanced_mailer_about_force_sender_caution_line_1 = 'Caution: If you use SMTP with a free e-mail service, the sender\'s address must correspond to the SMTP login credentials.'; +$lang->cmd_advanced_mailer_about_force_sender_caution_line_2 = 'The original sender\'s address will be used as Reply-To for your convenience.'; +$lang->cmd_advanced_mailer_spf_dkim_setting = 'SPF/DKIM Setting Guide'; +$lang->cmd_advanced_mailer_about_spf_dkim_setting = 'This is only applicable when sending emails from your own domain. Some APIs are not supported.'; +$lang->cmd_advanced_mailer_not_applicable_because_sender_domain = 'Not applicable to the sender\'s domain.'; +$lang->cmd_advanced_mailer_not_applicable_because_sending_method = 'Not applicable to the selected sending method.'; +$lang->cmd_advanced_mailer_domain_count = '%d domains'; +$lang->cmd_advanced_mailer_dns_hostname = 'DNS hostname'; +$lang->cmd_advanced_mailer_txt_record = 'TXT record'; +$lang->cmd_advanced_mailer_check = 'Check'; +$lang->cmd_advanced_mailer_nothing_to_check = 'There is nothing to check.'; +$lang->cmd_advanced_mailer_check_failure = 'Check failure.'; +$lang->cmd_advanced_mailer_check_no_records = 'has no TXT records.'; +$lang->cmd_advanced_mailer_check_result = 'has the following TXT records.'; +$lang->cmd_advanced_mailer_other_info = 'Note'; +$lang->cmd_advanced_mailer_other_info_mail_spf = 'In order to send mail to Korean recipients from your own server, please register a white domain with KISA.'; +$lang->cmd_advanced_mailer_other_info_ses_dkim = 'Please create three CNAME records according to the directions found in your AWS management console.'; +$lang->cmd_advanced_mailer_other_info_mailgun_dkim = 'The DKIM hostname may be different from what is shown here.'; +$lang->cmd_advanced_mailer_other_info_postmark_dkim = 'Please see the Sender Signatures page of your Postmark account for the exact DKIm hostname to use.'; +$lang->cmd_advanced_mailer_other_info_woorimail_dkim = 'Please log into Woorimail to see your DKIM settings.'; +$lang->cmd_advanced_mailer_ellipsis = '(see API for full value)'; +$lang->cmd_advanced_mailer_test = 'Mail Test'; +$lang->cmd_advanced_mailer_recipient_name = 'Recipient\'s name'; +$lang->cmd_advanced_mailer_recipient_email = 'Recipient\'s email'; +$lang->cmd_advanced_mailer_send = 'Send'; +$lang->cmd_advanced_mailer_test_result = 'Test result'; +$lang->cmd_advanced_mailer_exception_domains = 'Exception domains'; +$lang->cmd_advanced_mailer_exception_disabled = 'Use default'; +$lang->cmd_advanced_mailer_exception_domains_list = 'List of domains'; +$lang->cmd_advanced_mailer_about_exception_domains_list = 'Domains should be separated by commas or line breaks. (Example: gmail.com, yahoo.com)'; +$lang->cmd_advanced_mailer_about_exception_domains = 'When sending to domains listed here, the specified sending method will be used instead of the default.'; +$lang->cmd_advanced_mailer_exception_group = 'Exception Group'; +$lang->cmd_advanced_mailer_use_exceptions = 'Exception domains'; +$lang->cmd_advanced_mailer_use_exceptions_yes = 'Test with exceptions as configured'; +$lang->cmd_advanced_mailer_use_exceptions_no = 'Ignore exceptions and only test the default sending method'; +$lang->msg_advanced_mailer_about_dummy = 'Dummy does not actually send any email. It only records them. Use this option for testing.'; +$lang->msg_advanced_mailer_about_dummy_exceptions = 'Caution: if you have set up exception domains, email will be sent to those domains.'; +$lang->msg_advanced_mailer_sending_method_is_invalid = 'Please select a valid sending method.'; +$lang->msg_advanced_mailer_sending_method_is_not_configured = 'The selected sending method (%s) has not been fully configured. Please return to General Settings and finish configuring it.'; +$lang->msg_advanced_mailer_smtp_host_is_invalid = 'Please enter a valid SMTP server name.'; +$lang->msg_advanced_mailer_smtp_port_is_invalid = 'Please enter a valid SMTP port number.'; +$lang->msg_advanced_mailer_smtp_security_is_invalid = 'Please select a valid SMTP security scheme.'; +$lang->msg_advanced_mailer_username_is_empty = 'Please enter a username for the sending method you selected.'; +$lang->msg_advanced_mailer_password_is_empty = 'Please enter a password for the sending method you selected.'; +$lang->msg_advanced_mailer_aws_region_is_invalid = 'Please select a valid AWS Region.'; +$lang->msg_advanced_mailer_aws_access_key_is_empty = 'Please enter a valid AWS Access Key.'; +$lang->msg_advanced_mailer_aws_secret_key_is_empty = 'Please enter a valid AWS Secret Key.'; +$lang->msg_advanced_mailer_domain_is_empty = 'Please enter a valid domain.'; +$lang->msg_advanced_mailer_api_key_is_empty = 'Please enter a valid API Key.'; +$lang->msg_advanced_mailer_sender_name_is_empty = 'Please enter the sender\'s name.'; +$lang->msg_advanced_mailer_sender_email_is_empty = 'Please enter the sender\'s email address.'; +$lang->msg_advanced_mailer_sender_email_is_invalid = 'The sender\'s email address is invalid.'; +$lang->msg_advanced_mailer_reply_to_is_invalid = 'The Reply-To email address is invalid.'; +$lang->msg_advanced_mailer_recipient_name_is_empty = 'Please enter the recipient\'s name.'; +$lang->msg_advanced_mailer_recipient_email_is_empty = 'Please enter the recipient\'s email address.'; +$lang->msg_advanced_mailer_recipient_email_is_invalid = 'The recipient\'s email address is invalid.'; +$lang->msg_advanced_mailer_test_success = 'The test was successful. Please check your email.'; +$lang->msg_advanced_mailer_google_account_security = 'Either your login credentials are incorrect, or the SMTP connection was blocked by Google account security settings.
Please see here for more information.'; +$lang->msg_advanced_mailer_naver_smtp_disabled = 'Either your login credentials are incorrect, or POP3/SMTP is not enabled on your Naver account.'; +$lang->msg_advanced_mailer_unknown_error = 'An unknown error occurred.'; +$lang->msg_advanced_mailer_log_is_empty = 'There are no entries to display.'; +$lang->cmd_advanced_mailer_status_sender = 'Sender'; +$lang->cmd_advanced_mailer_status_recipient = 'Recipient'; +$lang->cmd_advanced_mailer_status_subject = 'Subject'; +$lang->cmd_advanced_mailer_status_sending_method = 'Method'; +$lang->cmd_advanced_mailer_status_time = 'Time'; +$lang->cmd_advanced_mailer_status = 'Status'; +$lang->cmd_advanced_mailer_status_success = 'Success'; +$lang->cmd_advanced_mailer_status_error = 'Error'; +$lang->cmd_advanced_mailer_status_error_msg = 'Error message'; +$lang->cmd_advanced_mailer_status_calling_script = 'Called from'; +$lang->cmd_advanced_mailer_clear_log_condition_all = 'Everything'; +$lang->cmd_advanced_mailer_clear_log_condition = 'Over %d days'; +$lang->cmd_advanced_mailer_clear_log_button = 'Clear old logs'; diff --git a/modules/advanced_mailer/lang/ko.php b/modules/advanced_mailer/lang/ko.php new file mode 100644 index 000000000..7da8ce9e2 --- /dev/null +++ b/modules/advanced_mailer/lang/ko.php @@ -0,0 +1,114 @@ +cmd_advanced_mailer = '고급 메일 발송 모듈'; +$lang->cmd_advanced_mailer_general_config = '기본 설정'; +$lang->cmd_advanced_mailer_is_enabled = '모듈 사용'; +$lang->cmd_advanced_mailer_is_enabled_yes = '사용'; +$lang->cmd_advanced_mailer_is_enabled_no = '사용하지 않음'; +$lang->cmd_advanced_mailer_logging = '발송 내역 기록'; +$lang->cmd_advanced_mailer_log_sent_mail = '발송 내역'; +$lang->cmd_advanced_mailer_log_errors = '에러 내역'; +$lang->cmd_advanced_mailer_log_yes = '기록'; +$lang->cmd_advanced_mailer_log_no = '기록하지 않음'; +$lang->cmd_advanced_mailer_sending_method_config = '기본 발송 방법 설정'; +$lang->cmd_advanced_mailer_about_sending_method_config = '반드시 모든 항목을 입력하시기 바랍니다.'; +$lang->cmd_advanced_mailer_sending_method = '발송 방법'; +$lang->cmd_advanced_mailer_about_sending_method = '받는이의 주소가 예외 도메인에 해당하지 않을 경우 모두 이 방법으로 발송됩니다.'; +$lang->cmd_advanced_mailer_sending_method_default = '기본 발송 방법'; +$lang->cmd_advanced_mailer_sending_method_exceptions = '예외 발송 방법'; +$lang->cmd_advanced_mailer_smtp_manual_entry = '직접 입력'; +$lang->cmd_advanced_mailer_smtp_host = 'SMTP 서버'; +$lang->cmd_advanced_mailer_smtp_port = 'SMTP 포트'; +$lang->cmd_advanced_mailer_smtp_security = 'SMTP 보안'; +$lang->cmd_advanced_mailer_smtp_security_ssl = 'SSL'; +$lang->cmd_advanced_mailer_smtp_security_tls = 'TLS (STARTTLS)'; +$lang->cmd_advanced_mailer_smtp_security_none = '사용하지 않음'; +$lang->cmd_advanced_mailer_smtp_user = '아이디'; +$lang->cmd_advanced_mailer_smtp_pass = '비밀번호'; +$lang->cmd_advanced_mailer_api_domain = '도메인'; +$lang->cmd_advanced_mailer_api_token = 'API 토큰'; +$lang->cmd_advanced_mailer_api_type = 'API 구분'; +$lang->cmd_advanced_mailer_api_type_free = '무료'; +$lang->cmd_advanced_mailer_api_type_paid = '유료'; +$lang->cmd_advanced_mailer_api_user = '아이디'; +$lang->cmd_advanced_mailer_api_pass = '비밀번호'; +$lang->cmd_advanced_mailer_sender_identity = '보낸이 설정'; +$lang->cmd_advanced_mailer_about_sender_identity = '보낸이 설정은 회원 모듈의 웹마스터 이름 및 메일 주소에도 동일하게 적용됩니다.'; +$lang->cmd_advanced_mailer_sender_name = '보낸이 이름'; +$lang->cmd_advanced_mailer_sender_email = '보낸이 메일 주소'; +$lang->cmd_advanced_mailer_reply_to = 'Reply-To 주소'; +$lang->cmd_advanced_mailer_force_sender = '이 주소 외 사용 금지'; +$lang->cmd_advanced_mailer_about_force_sender = '위에서 설정한 주소 외의 보낸이 주소를 사용할 경우 위에서 설정한 주소로 강제 변경합니다.'; +$lang->cmd_advanced_mailer_about_force_sender_caution_line_1 = '포털 서비스의 SMTP를 사용할 경우 보낸이 메일 주소가 SMTP 로그인 정보와 반드시 일치해야 합니다.'; +$lang->cmd_advanced_mailer_about_force_sender_caution_line_2 = '보낸이 주소를 강제 변경하더라도 원래 주소를 Reply-To로 지정하여 답장을 보내는 데는 지장이 없도록 합니다.'; +$lang->cmd_advanced_mailer_spf_dkim_setting = 'SPF/DKIM 설정 안내'; +$lang->cmd_advanced_mailer_about_spf_dkim_setting = '자신의 도메인에서 메일을 보내는 경우에만 해당됩니다. 일부 API는 지원하지 않거나 별도의 매뉴얼을 참고하셔야 합니다.'; +$lang->cmd_advanced_mailer_not_applicable_because_sender_domain = '보내는 주소가 자신의 도메인이 아니므로 해당되지 않습니다.'; +$lang->cmd_advanced_mailer_not_applicable_because_sending_method = '선택하신 발송 방법에는 해당되지 않습니다.'; +$lang->cmd_advanced_mailer_domain_count = '도메인 %d개'; +$lang->cmd_advanced_mailer_dns_hostname = 'DNS 호스트명'; +$lang->cmd_advanced_mailer_txt_record = 'TXT 레코드 값'; +$lang->cmd_advanced_mailer_check = '체크'; +$lang->cmd_advanced_mailer_nothing_to_check = '체크할 것이 없습니다.'; +$lang->cmd_advanced_mailer_check_failure = '체크에 실패했습니다.'; +$lang->cmd_advanced_mailer_check_no_records = '호스트에는 TXT 레코드가 없습니다.'; +$lang->cmd_advanced_mailer_check_result = '호스트의 TXT 레코드는 다음과 같습니다.'; +$lang->cmd_advanced_mailer_other_info = '참고'; +$lang->cmd_advanced_mailer_other_info_mail_spf = 'mail() 함수를 사용하려면 반드시 인터넷진흥원에 화이트 도메인 등록을 하시기 바랍니다.'; +$lang->cmd_advanced_mailer_other_info_ses_dkim = 'Amazon SES에서 DKIM을 사용하려면 관리 콘솔의 안내에 따라 3개의 CNAME 레코드를 생성해야 합니다.'; +$lang->cmd_advanced_mailer_other_info_mailgun_dkim = 'DKIM 호스트명은 달라질 수 있습니다.'; +$lang->cmd_advanced_mailer_other_info_postmark_dkim = '정확한 DKIM 호스트명은 Postmark 계정의 Sender Signatures 페이지를 참고하시기 바랍니다.'; +$lang->cmd_advanced_mailer_other_info_woorimail_dkim = 'DKIM 설정은 우리메일에 로그인하여 확인하십시오.'; +$lang->cmd_advanced_mailer_ellipsis = '(중략)'; +$lang->cmd_advanced_mailer_test = '발송 테스트'; +$lang->cmd_advanced_mailer_recipient_name = '받는이 이름'; +$lang->cmd_advanced_mailer_recipient_email = '받는이 메일 주소'; +$lang->cmd_advanced_mailer_send = '발송'; +$lang->cmd_advanced_mailer_test_result = '테스트 결과'; +$lang->cmd_advanced_mailer_exception_domains = '예외 도메인'; +$lang->cmd_advanced_mailer_exception_disabled = '기본 발송 방법 사용'; +$lang->cmd_advanced_mailer_exception_domains_list = '해당 도메인 목록'; +$lang->cmd_advanced_mailer_about_exception_domains_list = '쉼표 또는 줄바꿈으로 구분하여 주십시오. (예: daum.net, hanmail.net)'; +$lang->cmd_advanced_mailer_about_exception_domains = '목록에 나열된 도메인으로 메일을 보낼 때는 기본 발송 방법 대신 별도로 지정된 발송 방법을 사용합니다.'; +$lang->cmd_advanced_mailer_exception_group = '예외 그룹'; +$lang->cmd_advanced_mailer_use_exceptions = '예외 도메인 설정'; +$lang->cmd_advanced_mailer_use_exceptions_yes = '예외 설정을 적용하여 테스트'; +$lang->cmd_advanced_mailer_use_exceptions_no = '무시하고 기본 발송 방법만 테스트'; +$lang->msg_advanced_mailer_about_dummy = '더미는 실제로 메일을 발송하지 않고 기록만 하는 옵션입니다. 테스트에 사용하십시오.'; +$lang->msg_advanced_mailer_about_dummy_exceptions = '더미를 선택하더라도 예외 도메인을 지정한 경우 메일이 발송될 수 있으니 주의하십시오.'; +$lang->msg_advanced_mailer_sending_method_is_invalid = '올바른 발송 방법을 선택해 주십시오.'; +$lang->msg_advanced_mailer_sending_method_is_not_configured = '선택한 발송 방법(%s)이 완전히 설정되지 않았습니다. 기본 설정 페이지로 돌아가서 설정을 마쳐 주십시오.'; +$lang->msg_advanced_mailer_smtp_host_is_invalid = '올바른 SMTP 서버 이름을 입력해 주십시오.'; +$lang->msg_advanced_mailer_smtp_port_is_invalid = '올바른 SMTP 포트 번호를 입력해 주십시오.'; +$lang->msg_advanced_mailer_smtp_security_is_invalid = '올바른 SMTP 보안 방식을 선택해 주십시오.'; +$lang->msg_advanced_mailer_username_is_empty = '선택한 발송 방법에 필요한 아이디를 입력해 주십시오.'; +$lang->msg_advanced_mailer_password_is_empty = '선택한 발송 방법에 필요한 비밀번호를 입력해 주십시오.'; +$lang->msg_advanced_mailer_aws_region_is_invalid = '올바른 AWS Region을 선택해 주십시오.'; +$lang->msg_advanced_mailer_aws_access_key_is_empty = 'AWS Access Key를 입력해 주십시오.'; +$lang->msg_advanced_mailer_aws_secret_key_is_empty = 'AWS Secret Key를 입력해 주십시오.'; +$lang->msg_advanced_mailer_domain_is_empty = '올바른 도메인을 입력해 주십시오.'; +$lang->msg_advanced_mailer_api_key_is_empty = '올바른 API Key를 입력해 주십시오.'; +$lang->msg_advanced_mailer_sender_name_is_empty = '보낸이 이름을 입력해 주십시오.'; +$lang->msg_advanced_mailer_sender_email_is_empty = '보낸이 메일 주소를 입력해 주십시오.'; +$lang->msg_advanced_mailer_sender_email_is_invalid = '보낸이 메일 주소가 올바른 메일 주소가 아닙니다.'; +$lang->msg_advanced_mailer_reply_to_is_invalid = 'Reply-To 메일 주소가 올바른 메일 주소가 아닙니다.'; +$lang->msg_advanced_mailer_recipient_name_is_empty = '받는이 이름을 입력해 주십시오.'; +$lang->msg_advanced_mailer_recipient_email_is_empty = '받는이 메일 주소를 입력해 주십시오.'; +$lang->msg_advanced_mailer_recipient_email_is_invalid = '받는이 메일 주소가 올바른 메일 주소가 아닙니다.'; +$lang->msg_advanced_mailer_test_success = '테스트에 성공하였습니다. 메일을 확인해 보시기 바랍니다.'; +$lang->msg_advanced_mailer_google_account_security = '아이디 또는 비밀번호가 틀렸거나, 구글 보안 설정 때문에 SMTP 접속이 차단되었습니다.
자세한 정보는 여기를 참고하시기 바랍니다.'; +$lang->msg_advanced_mailer_naver_smtp_disabled = '아이디 또는 비밀번호가 틀렸거나, 네이버 계정 환경설정에서 POP3/SMTP를 사용하지 않도록 설정되어 있습니다.'; +$lang->msg_advanced_mailer_unknown_error = '알 수 없는 오류가 발생하였습니다.'; +$lang->msg_advanced_mailer_log_is_empty = '표시할 항목이 없습니다.'; +$lang->cmd_advanced_mailer_status_sender = '보낸이'; +$lang->cmd_advanced_mailer_status_recipient = '받는이'; +$lang->cmd_advanced_mailer_status_subject = '제목'; +$lang->cmd_advanced_mailer_status_sending_method = '발송 방법'; +$lang->cmd_advanced_mailer_status_time = '발송 시간'; +$lang->cmd_advanced_mailer_status = '상태'; +$lang->cmd_advanced_mailer_status_success = '성공'; +$lang->cmd_advanced_mailer_status_error = '에러'; +$lang->cmd_advanced_mailer_status_error_msg = '에러 메시지'; +$lang->cmd_advanced_mailer_status_calling_script = '호출 위치'; +$lang->cmd_advanced_mailer_clear_log_condition_all = '모두'; +$lang->cmd_advanced_mailer_clear_log_condition = '%d일 이상'; +$lang->cmd_advanced_mailer_clear_log_button = '오래된 기록 삭제'; diff --git a/modules/advanced_mailer/queries/countLogByType.xml b/modules/advanced_mailer/queries/countLogByType.xml new file mode 100644 index 000000000..652275ffc --- /dev/null +++ b/modules/advanced_mailer/queries/countLogByType.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/modules/advanced_mailer/queries/deleteLogs.xml b/modules/advanced_mailer/queries/deleteLogs.xml new file mode 100644 index 000000000..690e64ed8 --- /dev/null +++ b/modules/advanced_mailer/queries/deleteLogs.xml @@ -0,0 +1,9 @@ + + +
+ + + + + + diff --git a/modules/advanced_mailer/queries/getLogByType.xml b/modules/advanced_mailer/queries/getLogByType.xml new file mode 100644 index 000000000..655b85e30 --- /dev/null +++ b/modules/advanced_mailer/queries/getLogByType.xml @@ -0,0 +1,17 @@ + + +
+ + + + + + + + + + + + + + diff --git a/modules/advanced_mailer/queries/insertLog.xml b/modules/advanced_mailer/queries/insertLog.xml new file mode 100644 index 000000000..2f2580c34 --- /dev/null +++ b/modules/advanced_mailer/queries/insertLog.xml @@ -0,0 +1,15 @@ + + +
+ + + + + + + + + + + + diff --git a/modules/advanced_mailer/schemas/advanced_mailer_log.xml b/modules/advanced_mailer/schemas/advanced_mailer_log.xml new file mode 100644 index 000000000..fa3cb7c21 --- /dev/null +++ b/modules/advanced_mailer/schemas/advanced_mailer_log.xml @@ -0,0 +1,11 @@ +
+ + + + + + + + + +
diff --git a/modules/advanced_mailer/tpl/common.html b/modules/advanced_mailer/tpl/common.html new file mode 100644 index 000000000..e254222ec --- /dev/null +++ b/modules/advanced_mailer/tpl/common.html @@ -0,0 +1,13 @@ + +
+

{$lang->cmd_advanced_mailer}

+
+ + diff --git a/modules/advanced_mailer/tpl/config.html b/modules/advanced_mailer/tpl/config.html new file mode 100644 index 000000000..2d977e511 --- /dev/null +++ b/modules/advanced_mailer/tpl/config.html @@ -0,0 +1,230 @@ + + + + +
+ + + + +
+

{$XE_VALIDATOR_MESSAGE}

+
+ +
+ +

{$lang->cmd_advanced_mailer_sending_method_config}

+ +
+ ※ {$lang->cmd_advanced_mailer_about_sending_method} +
+ +
+ +
+ +
+
+ + + +
+ +
+

{$lang->msg_advanced_mailer_about_dummy}
{$lang->msg_advanced_mailer_about_dummy_exceptions}

+
+
+ + + + {@ $conf_value = escape(config("mail.$driver_name.$conf_name"))} + + +
+ +
+ + +
+
+ + + +
+ +
+ +
+
+ + + +
+ +
+ + + +
+
+ + + +
+ +
+ +
+
+ + + +
+ +
+ +
+
+ + + +
+ +
+ +
+
+ + + +
+ +
+ +
+
+ + + +
+ +
+ +
+
+ + + +
+ +
+ +
+
+ + + +
+ +
+ +
+
+ + + + + +
+ +
+ +

{$lang->cmd_advanced_mailer_sender_identity}

+ +
+ ※ {$lang->cmd_advanced_mailer_about_sender_identity} +
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +

※ {$lang->cmd_advanced_mailer_about_force_sender_caution_line_1}
※ {$lang->cmd_advanced_mailer_about_force_sender_caution_line_2}

+
+
+ +
+ +
+ +

{$lang->cmd_advanced_mailer_logging}

+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+ +
diff --git a/modules/advanced_mailer/tpl/css/config.css b/modules/advanced_mailer/tpl/css/config.css new file mode 100644 index 000000000..2283e7cc5 --- /dev/null +++ b/modules/advanced_mailer/tpl/css/config.css @@ -0,0 +1,52 @@ + +#advanced_mailer_test_send { + padding: 3px 10px; +} + +#advanced_mailer_test_result { + font-family: Consolas, monospace; + padding: 5px 0; +} + +section { + margin-bottom: 10px !important; +} + +input[type=password] { + font-family: "Segoe UI", Arial, sans-serif !important; +} + +h2 { + padding-left: 10px; + padding-bottom: 2px; + font-size: 16px !important; +} + +div.advanced_mailer_description { + margin-bottom: 10px; + margin-left: 10px; +} + +div.hidden-by-default { + display: none; +} + +div.full-width input { + width: 90% !important; +} + +div.margin-top { + margin-top: 5px; +} + +span.sender_info { + display: inline-block; + margin-top: 12px; + margin-left: 24px; + font-family: Consolas, monospace; +} + +textarea.exception-domains { + width: 90% !important; + height: 80px !important; +} diff --git a/modules/advanced_mailer/tpl/css/spf_dkim.css b/modules/advanced_mailer/tpl/css/spf_dkim.css new file mode 100644 index 000000000..b11911782 --- /dev/null +++ b/modules/advanced_mailer/tpl/css/spf_dkim.css @@ -0,0 +1,31 @@ + +div.advanced_mailer_description { + margin-bottom: 10px; + margin-left: 10px; +} + +div.margin-top { + margin-top: 5px; +} + +div.x_modal-body .monospace { + font-family: Consolas, monospace; + word-wrap: break-word; + word-break: break-word; +} + +#spf_dkim_setting div.spf_dkim_item { + padding: 5px 0; +} +#spf_dkim_setting div.spf_dkim_separator { + border-top: 1px dotted #ddd; + margin: 8px 0; +} +#spf_dkim_setting span.label { + display: inline-block; + min-width: 94px; +} +#spf_dkim_setting span.monospace { + font-family: Consolas, monospace; + display: inline-block; +} diff --git a/modules/advanced_mailer/tpl/css/view_log.css b/modules/advanced_mailer/tpl/css/view_log.css new file mode 100644 index 000000000..b1d486492 --- /dev/null +++ b/modules/advanced_mailer/tpl/css/view_log.css @@ -0,0 +1,4 @@ + +div.mail-log-errors { + display: none; +} diff --git a/modules/advanced_mailer/tpl/exceptions.html b/modules/advanced_mailer/tpl/exceptions.html new file mode 100644 index 000000000..312c19229 --- /dev/null +++ b/modules/advanced_mailer/tpl/exceptions.html @@ -0,0 +1,67 @@ + + + +
+ + + + +
+

{$XE_VALIDATOR_MESSAGE}

+
+ +
+ +
+ +
+ {$sending_methods[$sending_method]['name']} + + + ({$lang->cmd_advanced_mailer_api_type_free}) + + ({$lang->cmd_advanced_mailer_api_type_paid}) + + +
+
+ +
+ + +
+ +

{$lang->cmd_advanced_mailer_exception_group} {$i}

+ +
+ +
+ +
+
+ +
+ +
+ +

{$lang->cmd_advanced_mailer_about_exception_domains_list}

+
+
+ +
+ + +
+ ※ {$lang->cmd_advanced_mailer_about_exception_domains} +
+ +
+ +
+ +
diff --git a/modules/advanced_mailer/tpl/js/config.js b/modules/advanced_mailer/tpl/js/config.js new file mode 100644 index 000000000..9eb24fb4c --- /dev/null +++ b/modules/advanced_mailer/tpl/js/config.js @@ -0,0 +1,106 @@ + +(function($) { + + $(function() { + + $("#advanced_mailer_sending_method").on("change", function() { + var sending_method = $(this).val(); + $("div.x_control-group.hidden-by-default").not(".show-always").each(function() { + if ($(this).hasClass("show-for-" + sending_method)) { + $(this).show(); + } else { + $(this).hide(); + } + }); + var reply_to = $("#advanced_mailer_reply_to").parents("div.x_control-group"); + if (sending_method === "woorimail") { + reply_to.hide(); + } else { + reply_to.show(); + } + }).triggerHandler("change"); + + $("#advanced_mailer_smtp_manual_entry").on("change", function() { + var auto_fill = $(this).val(); + if (auto_fill === 'gmail') { + $("#advanced_mailer_smtp_host").val('smtp.gmail.com'); + $("#advanced_mailer_smtp_port").val('465'); + $("#advanced_mailer_smtp_security_ssl").prop("checked", true).parent().addClass("checked"); + $("#advanced_mailer_smtp_security_tls").parent().removeClass("checked"); + $("#advanced_mailer_smtp_security_none").parent().removeClass("checked"); + $("#advanced_mailer_force_sender").prop("checked", true).parent().addClass("checked"); + } + if (auto_fill === 'hanmail') { + $("#advanced_mailer_smtp_host").val('smtp.daum.net'); + $("#advanced_mailer_smtp_port").val('465'); + $("#advanced_mailer_smtp_security_ssl").prop("checked", true).parent().addClass("checked"); + $("#advanced_mailer_smtp_security_tls").parent().removeClass("checked"); + $("#advanced_mailer_smtp_security_none").parent().removeClass("checked"); + $("#advanced_mailer_force_sender").prop("checked", true).parent().addClass("checked"); + } + if (auto_fill === 'naver') { + $("#advanced_mailer_smtp_host").val('smtp.naver.com'); + $("#advanced_mailer_smtp_port").val('587'); + $("#advanced_mailer_smtp_security_tls").prop("checked", true).parent().addClass("checked"); + $("#advanced_mailer_smtp_security_ssl").parent().removeClass("checked"); + $("#advanced_mailer_smtp_security_none").parent().removeClass("checked"); + $("#advanced_mailer_force_sender").prop("checked", true).parent().addClass("checked"); + } + if (auto_fill === 'worksmobile') { + $("#advanced_mailer_smtp_host").val('smtp.worksmobile.com'); + $("#advanced_mailer_smtp_port").val('587'); + $("#advanced_mailer_smtp_security_tls").prop("checked", true).parent().addClass("checked"); + $("#advanced_mailer_smtp_security_ssl").parent().removeClass("checked"); + $("#advanced_mailer_smtp_security_none").parent().removeClass("checked"); + $("#advanced_mailer_force_sender").prop("checked", true).parent().addClass("checked"); + } + if (auto_fill === 'outlook') { + $("#advanced_mailer_smtp_host").val('smtp-mail.outlook.com'); + $("#advanced_mailer_smtp_port").val('587'); + $("#advanced_mailer_smtp_security_tls").prop("checked", true).parent().addClass("checked"); + $("#advanced_mailer_smtp_security_ssl").parent().removeClass("checked"); + $("#advanced_mailer_smtp_security_none").parent().removeClass("checked"); + $("#advanced_mailer_force_sender").prop("checked", true).parent().addClass("checked"); + } + if (auto_fill === 'yahoo') { + $("#advanced_mailer_smtp_host").val('smtp.mail.yahoo.com'); + $("#advanced_mailer_smtp_port").val('465'); + $("#advanced_mailer_smtp_security_ssl").prop("checked", true).parent().addClass("checked"); + $("#advanced_mailer_smtp_security_tls").parent().removeClass("checked"); + $("#advanced_mailer_smtp_security_none").parent().removeClass("checked"); + $("#advanced_mailer_force_sender").prop("checked", true).parent().addClass("checked"); + } + }); + + $("#advanced_mailer_woorimail_account_type_free,#advanced_mailer_woorimail_account_type_paid").on("change", function() { + if ($("#advanced_mailer_woorimail_account_type_paid").is(":checked")) { + $("#advanced_mailer_reply_to").attr("disabled", "disabled"); + } else { + $("#advanced_mailer_reply_to").removeAttr("disabled"); + } + }).triggerHandler("change"); + + $("#advanced_mailer_test_send").click(function(event) { + event.preventDefault(); + $("#advanced_mailer_test_result").text(""); + $(this).attr("disabled", "disabled"); + var ajax_data = { + recipient_name: $("#advanced_mailer_recipient_name").val(), + recipient_email: $("#advanced_mailer_recipient_email").val(), + }; + $.exec_json( + "advanced_mailer.procAdvanced_mailerAdminTestSend", ajax_data, + function(response) { + $("#advanced_mailer_test_result").html(response.test_result); + $("#advanced_mailer_test_send").removeAttr("disabled"); + }, + function(response) { + $("#advanced_mailer_test_result").text("AJAX Error"); + $("#advanced_mailer_test_send").removeAttr("disabled"); + } + ); + }); + + }); + +} (jQuery)); diff --git a/modules/advanced_mailer/tpl/js/spf_dkim.js b/modules/advanced_mailer/tpl/js/spf_dkim.js new file mode 100644 index 000000000..a6b4597b1 --- /dev/null +++ b/modules/advanced_mailer/tpl/js/spf_dkim.js @@ -0,0 +1,43 @@ + +(function($) { + + $(function() { + + $("#advanced_mailer_check_spf,#advanced_mailer_check_dkim").click(function(event) { + event.preventDefault(); + var check_type = $(this).attr("id").match(/_spf$/) ? "spf" : "dkim"; + var check_hostname = $(this).siblings("span.monospace").text(); + if (!check_hostname) { + alert($("#spf_dkim_setting").data("nothing-to-check")); + } + $(this).attr("disabled", "disabled"); + $.exec_json( + "advanced_mailer.procAdvanced_mailerAdminCheckDNSRecord", + { hostname: check_hostname, record_type: "TXT" }, + function(response) { + if (response.record_content === false) { + alert($("#spf_dkim_setting").data("check-failure")); + } + else if (response.record_content === "") { + alert('' + check_hostname + " " + + $("#spf_dkim_setting").data("check-no-records")); + $(".x_modal._common._small").removeClass("_small"); + } + else { + alert('' + check_hostname + " " + + $("#spf_dkim_setting").data("check-result") + "

" + + '
' + response.record_content.replace("\n", "
") + "
"); + $(".x_modal._common._small").removeClass("_small"); + } + $("#advanced_mailer_check_" + check_type).removeAttr("disabled"); + }, + function(response) { + alert($("#spf_dkim_setting").data("check-failure")); + $("#advanced_mailer_check_" + check_type).removeAttr("disabled"); + } + ); + }); + + }); + +} (jQuery)); diff --git a/modules/advanced_mailer/tpl/js/view_log.js b/modules/advanced_mailer/tpl/js/view_log.js new file mode 100644 index 000000000..db0bc021c --- /dev/null +++ b/modules/advanced_mailer/tpl/js/view_log.js @@ -0,0 +1,15 @@ + +(function($) { + + $(function() { + + $("a.show-errors").click(function(event) { + event.preventDefault(); + var error_msg = $(this).siblings("div.mail-log-errors").html(); + alert(error_msg); + $(".x_modal._common._small").removeClass("_small"); + }); + + }); + +} (jQuery)); diff --git a/modules/advanced_mailer/tpl/spf_dkim.html b/modules/advanced_mailer/tpl/spf_dkim.html new file mode 100644 index 000000000..d95c50b4e --- /dev/null +++ b/modules/advanced_mailer/tpl/spf_dkim.html @@ -0,0 +1,127 @@ + + + + +
+ +
+ ※ {$lang->cmd_advanced_mailer_about_spf_dkim_setting} +
+ +
+ +
+ {$sending_methods[$sending_method]['name']} + + + ({$lang->cmd_advanced_mailer_api_type_free}) + + ({$lang->cmd_advanced_mailer_api_type_paid}) + + +
+
+ +
+ +
+ + +
+ {$sending_methods[$exception['method']]['name']} + + + ({$lang->cmd_advanced_mailer_api_type_free}) + + ({$lang->cmd_advanced_mailer_api_type_paid}) + + + — {sprintf($lang->cmd_advanced_mailer_domain_count, count($exception['domains']))} +
+ + +
+
+ +
+ +
{$advanced_mailer_config->sender_email}
+
+ + {@ $ignore_domains = '/^(g(oogle)?mail\.com|(daum|hanmail2?)\.net|(naver|outlook|hotmail|yahoo)\.com|(hotmail|yahoo)\.co\.kr)$/i'} + +
+ +
+ +
+ {$lang->cmd_advanced_mailer_not_applicable_because_sender_domain} +
+ +
+ {$lang->cmd_advanced_mailer_not_applicable_because_sending_method} +
+ +
+ {$lang->cmd_advanced_mailer_dns_hostname} + {$sending_domain}   + {$lang->cmd_advanced_mailer_check} +
+
+ {$lang->cmd_advanced_mailer_txt_record} + v=spf1 a mx {implode(' ', $used_methods_with_usable_spf)} ~all +
+ {@ $other_infos = array()} + + {@ $other_info = Context::getLang('cmd_advanced_mailer_other_info_' . $method . '_spf')} + {@ if(strncmp('cmd_', $other_info, 4)) $other_infos[] = $other_info} + +
+ + {$lang->cmd_advanced_mailer_other_info} + {$other_info}
+ +
+ +
+
+ +
+ +
+ +
+ {$lang->cmd_advanced_mailer_not_applicable_because_sender_domain} +
+ +
+ {$lang->cmd_advanced_mailer_not_applicable_because_sending_method} +
+ + +
+ {$lang->cmd_advanced_mailer_dns_hostname} + {$dkim}.{$sending_domain}   + {$lang->cmd_advanced_mailer_check} +
+
+ {$lang->cmd_advanced_mailer_txt_record} + v=DKIM1; k=rsa; p=MIGfMA...{$lang->cmd_advanced_mailer_ellipsis}...QAB; +
+ {@ $other_info = Context::getLang('cmd_advanced_mailer_other_info_' . $method . '_dkim')} + {@ if(!strncmp('cmd_', $other_info, 4)) $other_info = false} +
+ {$lang->cmd_advanced_mailer_other_info} + {$other_info}
+
+
+ + +
+
+ +
diff --git a/modules/advanced_mailer/tpl/test.html b/modules/advanced_mailer/tpl/test.html new file mode 100644 index 000000000..07c3517ec --- /dev/null +++ b/modules/advanced_mailer/tpl/test.html @@ -0,0 +1,45 @@ + + + + +
+ + + + +
+

{$XE_VALIDATOR_MESSAGE}

+
+ +
+ +

{$lang->cmd_advanced_mailer_test}

+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+
+
+
+ +
+ +
+ +
+ +
diff --git a/modules/advanced_mailer/tpl/view_log.html b/modules/advanced_mailer/tpl/view_log.html new file mode 100644 index 000000000..273d0180b --- /dev/null +++ b/modules/advanced_mailer/tpl/view_log.html @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Total: {number_format($total_count)}, Page: {number_format($page)}/{number_format($total_page)} +
{$lang->cmd_advanced_mailer_status_sender}{$lang->cmd_advanced_mailer_status_recipient}{$lang->cmd_advanced_mailer_status_subject}{$lang->cmd_advanced_mailer_status_sending_method}{$lang->cmd_advanced_mailer_status_time}{$lang->cmd_advanced_mailer_status}
+ + {htmlspecialchars($mail_from[0])}
+ +
+ + + +{count($val->mail_to) - 1} +
+ +
{htmlspecialchars($val->subject)} + {Context::getLang('cmd_advanced_mailer_sending_method_' . $val->sending_method)} + {(zdate($val->regdate, "Y-m-d\nH:i:s"))} + + {$lang->cmd_advanced_mailer_status_success} + + {$lang->cmd_advanced_mailer_status_error} +
+ {$lang->cmd_advanced_mailer_status_error_msg}:
+ {nl2br(htmlspecialchars(trim($val->errors)))}

+ {$lang->cmd_advanced_mailer_status_calling_script}:
+ {htmlspecialchars($val->calling_script)} +
+ +
{$lang->msg_advanced_mailer_log_is_empty}
+ +
+
+ + +
+
+ + + + + +
+