tbrehm
2012-01-25 175eab39839bb0a72f0fb7378539a708d1e4253a
Fixed: FS#1980 - Check if the mail text files contain any wrong chars in front of the From line.
- Added a missing string in dns soa edit langauge file.
2 files modified
33 ■■■■■ changed files
interface/web/dns/lib/lang/en_dns_soa.lng 1 ●●●● patch | view | raw | blame | history
server/plugins-available/mail_plugin.inc.php 32 ●●●●● patch | view | raw | blame | history
interface/web/dns/lib/lang/en_dns_soa.lng
@@ -28,4 +28,5 @@
$wb['eg_domain_tld'] = 'e.g. domain.tld';
$wb['eg_ns1_domain_tld'] = 'e.g. ns1.domain.tld';
$wb['eg_webmaster_domain_tld'] = 'e.g. webmaster@domain.tld';
$wb['The Domain can not be changed. Please ask your Administrator if you want to change the domain name.'] = 'The Domain can not be changed. Please ask your Administrator if you want to change the domain name.';
?>
server/plugins-available/mail_plugin.inc.php
@@ -160,24 +160,30 @@
        
        //* Send the welcome email message
        if(file_exists($conf['rootpath'].'/conf-custom/mail/welcome_email_'.$conf['language'].'.txt')) {
            $tmp = file($conf['rootpath'].'/conf-custom/mail/welcome_email_'.$conf['language'].'.txt');
            $lines = file($conf['rootpath'].'/conf-custom/mail/welcome_email_'.$conf['language'].'.txt');
        } elseif(file_exists($conf['rootpath'].'/conf-custom/mail/welcome_email_en.txt')) {
            $tmp = file($conf['rootpath'].'/conf-custom/mail/welcome_email_en.txt');
            $lines = file($conf['rootpath'].'/conf-custom/mail/welcome_email_en.txt');
        } elseif(file_exists($conf['rootpath'].'/conf/mail/welcome_email_'.$conf['language'].'.txt')) {
            $tmp = file($conf['rootpath'].'/conf/mail/welcome_email_'.$conf['language'].'.txt');
            $lines = file($conf['rootpath'].'/conf/mail/welcome_email_'.$conf['language'].'.txt');
        } else {
            $tmp = file($conf['rootpath'].'/conf/mail/welcome_email_en.txt');
            $lines = file($conf['rootpath'].'/conf/mail/welcome_email_en.txt');
        }
        
        $welcome_mail_from  = trim(substr($tmp[0],5));
        $welcome_mail_subject  = trim(substr($tmp[1],8));
        unset($tmp[0]);
        unset($tmp[1]);
        $welcome_mail_message = trim(implode($tmp));
        unset($tmp);
        //* Get from address
        $parts = explode(':',trim($lines[0]));
        unset($parts[0]);
        $welcome_mail_from  = implode(':',$parts);
        unset($lines[0]);
        
        $welcomeFromEmail = $mail_config['admin_mail'];
        $welcomeFromName = $mail_config['admin_name'];
        //* Get subject
        $parts = explode(':',trim($lines[1]));
        unset($parts[0]);
        $welcome_mail_subject  = implode(':',$parts);
        unset($lines[1]);
        //* Get message
        $welcome_mail_message = trim(implode($lines));
        unset($tmp);
        
        $mailHeaders      = "MIME-Version: 1.0" . "\n";
        $mailHeaders     .= "Content-type: text/plain; charset=utf-8" . "\n";
@@ -185,11 +191,9 @@
        $mailHeaders     .= "From: $welcome_mail_from" . "\n";
        $mailHeaders     .= "Reply-To: $welcome_mail_from" . "\n";
        $mailTarget       = $data["new"]["email"];
        // $mailSubject = "=?utf-8?Q?" . imap_8bit($welcome_mail_subject) . "?=";
        $mailSubject      = "=?utf-8?B?".base64_encode($welcome_mail_subject)."?=";
        mail($mailTarget, $mailSubject, $welcome_mail_message, $mailHeaders);
        
    }