Current time: 12-22-2024, 05:25 PM 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
FeG Offline
Banned

Posts: 222
Joined: Aug 2007
Post: #2
RE: see mail-forward in overview
Hi joximu,

thanks for this idea, I think that's a very nice feature and so I've created a ticket for this and uploaded the appropriate patch.

I've therefor modified your code in 2 aspects:

1) I've hardcoded the string length of 50, after which the string is cut, since I didn't want to redefine this variable in each function.

2) I've added a str_replace so that multiple recipients are separated with ', '.

Greetings
FeG
10-18-2008 10:39 PM
Find all posts by this user Quote this message in a reply
sci2tech Away
Senior Member
****

Posts: 1,285
Joined: Jan 2007
Reputation: 23
Post: #3
RE: see mail-forward in overview
Since I`m working on mail this part how about autorespond for alias? Shall this be implemented? Anyway still to come is mail for alias subdomains Wink
10-19-2008 12:28 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


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