浏览代码

Use get_identities()

Thijs Kinkhorst 22 年之前
父节点
当前提交
6fe67f29db
共有 2 个文件被更改,包括 9 次插入14 次删除
  1. 1 0
      src/options_identities.php
  2. 8 14
      src/read_body.php

+ 1 - 0
src/options_identities.php

@@ -23,6 +23,7 @@ require_once(SM_PATH . 'functions/html.php');
 /* POST data var names are dynamic because 
 /* POST data var names are dynamic because 
    of the possible multiple idents so lets get
    of the possible multiple idents so lets get
    them all
    them all
+   FIXME! This circumvents the benefits of rg=0
 */
 */
 if (!empty($_POST)) {
 if (!empty($_POST)) {
     extract($_POST);
     extract($_POST);

+ 8 - 14
src/read_body.php

@@ -24,6 +24,7 @@ require_once(SM_PATH . 'functions/date.php');
 require_once(SM_PATH . 'functions/url_parser.php');
 require_once(SM_PATH . 'functions/url_parser.php');
 require_once(SM_PATH . 'functions/html.php');
 require_once(SM_PATH . 'functions/html.php');
 require_once(SM_PATH . 'functions/global.php');
 require_once(SM_PATH . 'functions/global.php');
+require_once(SM_PATH . 'functions/identity.php');
 
 
 /**
 /**
  * Given an IMAP message id number, this will look it up in the cached
  * Given an IMAP message id number, this will look it up in the cached
@@ -169,20 +170,13 @@ function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) {
 
 
 
 
     $reply_to = '';
     $reply_to = '';
-    if (isset($identity) && $identity != 'default') {
-        $from_mail = getPref($data_dir, $username, 
-                             'email_address' . $identity);
-        $full_name = getPref($data_dir, $username, 
-                             'full_name' . $identity);
-        $from_addr = '"'.$full_name.'" <'.$from_mail.'>';
-        $reply_to  = getPref($data_dir, $username, 
-                             'reply_to' . $identity);
-    } else {
-        $from_mail = getPref($data_dir, $username, 'email_address');
-        $full_name = getPref($data_dir, $username, 'full_name');
-        $from_addr = '"'.$full_name.'" <'.$from_mail.'>';
-        $reply_to  = getPref($data_dir, $username,'reply_to');
-    }
+    $ident = get_identities();
+    if(!isset($identity)) $identity = 0;
+    $full_name = $ident[$identity]['full_name'];
+    $from_mail = $ident[$identity]['email_address'];
+    $from_addr = '"'.$full_name.'" <'.$from_mail.'>';
+    $reply_to  = $ident[$identity]['reply_to'];
+
     if (!$from_addr) {
     if (!$from_addr) {
        $from_addr = "$popuser@$domain";
        $from_addr = "$popuser@$domain";
        $from_mail = $from_addr;
        $from_mail = $from_addr;