Current time: 11-17-2024, 12:42 AM Hello There, Guest! (LoginRegister)


Post Reply 
see mail-forward in overview
Author Message
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #1
see mail-forward in overview
I want to see in the mail overview where mails are forwarded...

This will do it:

in mail_accounts.php, I did it for the normal-mails...:

Code:
function gen_page_dmn_mail_list(&$tpl, &$sql, $dmn_id, $dmn_name) {
# old line after SELECT:
#            `mail_id`, `mail_acc`, `mail_type`, `status`, `mail_auto_respond`
# how many chars of the forward-list?
$forwLen = 50;
        $dmn_query ="
                SELECT
            `mail_id`, `mail_acc`, `mail_type`, `status`, `mail_auto_respond`, CONCAT( LEFT(`mail_forward`, $forwLen), IF( LENGTH(`mail_forward`) > $forwLen, '...', '') ) as 'mail_forward'
                FROM
            `mail_users`
                WHERE
            `domain_id` = ?
                AND
            `sub_id` = 0
                AND
            (`mail_type` LIKE '%normal_mail%' OR `mail_type` LIKE '%normal_forward%')
                ORDER BY
            `mail_acc` ASC,
            `mail_type` DESC
        ";

        $rs = exec_query($sql, $dmn_query, array($dmn_id));
        if ($rs->RecordCount() == 0) {
                return 0;
        } else {
                global $counter;
                while (!$rs->EOF) {
                        if ($counter % 2 == 0) {
                                $tpl->assign('ITEM_CLASS', 'content');
                        } else {
                                $tpl->assign('ITEM_CLASS', 'content2');
                        }

                        list($mail_action, $mail_action_script, $mail_edit_script) = gen_user_mail_action($rs->fields['mail_id'], $rs->fields['status']);

                        $mail_acc = decode_idna($rs->fields['mail_acc']);
                        $show_dmn_name = decode_idna($dmn_name);

                        $mail_types = explode(',', $rs->fields['mail_type']);
                        $mail_type = '';

                        foreach ($mail_types as $type) {
# old line, replaced with 3 lines
#                              $mail_type .= user_trans_mail_type($type) . "<br />";
                                $mail_type .= user_trans_mail_type($type);
                                if (strpos($type, '_forward') !== false) $mail_type .= ': '.$rs->fields['mail_forward'];
                                $mail_type .= '<br />';
                        }

if forwLen is not to big then "..." will be added if the list of forwarding addresses is longer...

What do you think?

maybe integrate into the trunk - in all 3 parts (also sub and alias)

/Joximu
(This post was last modified: 10-17-2008 11:48 PM by joximu.)
10-17-2008 11:47 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
see mail-forward in overview - joximu - 10-17-2008 11:47 PM
RE: see mail-forward in overview - FeG - 10-18-2008, 10:39 PM

Forum Jump:


User(s) browsing this thread: 2 Guest(s)