From 6d0215213732235c128b2efc472fc1818d494467 Mon Sep 17 00:00:00 2001 From: kink Date: Mon, 7 Jul 2003 19:10:12 +0000 Subject: [PATCH] Use get_identities() git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5242 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/options_identities.php | 1 + src/read_body.php | 22 ++++++++-------------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/options_identities.php b/src/options_identities.php index 809210f9..6927c0ae 100644 --- a/src/options_identities.php +++ b/src/options_identities.php @@ -23,6 +23,7 @@ require_once(SM_PATH . 'functions/html.php'); /* POST data var names are dynamic because of the possible multiple idents so lets get them all + FIXME! This circumvents the benefits of rg=0 */ if (!empty($_POST)) { extract($_POST); diff --git a/src/read_body.php b/src/read_body.php index 47bd027b..74d393d9 100644 --- a/src/read_body.php +++ b/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/html.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 @@ -169,20 +170,13 @@ function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) { $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) { $from_addr = "$popuser@$domain"; $from_mail = $from_addr; -- 2.25.1