#446 Display 'To:' Address in Sent SubFolders


I use Sent Subfolders in the form Sent/YYYY/MM due to
the amount of emails sent. This also keeps mailbox size
to a reasonable size. The most frustrating thing is
when browsing any other Sent Subfolder than that
currently in use, the 'From' address is displayed
instead of the To address.
This makes it somewhat difficult to locate an message
by recipient without searching, especially if you know
it's one of those 15 messages in the current display
list of emails

This small patch alloys any Subfolder of 'Sent' to be
as per normal Sent folder. Though addmittledly I have
not checked for format of SentYYYY, it though should work
due to the way it's tested.

I'll appoligise in advance if it's a bad hack, though
so far
I haven't noticed any problems.


shane 'at' xtremetech 'dot' com 'dot' au


  • Thijs Kinkhorst

    Thijs Kinkhorst - 2005-04-19
    • assigned_to: nobody --> kink
  • Thijs Kinkhorst

    Thijs Kinkhorst - 2005-04-22

    Logged In: YES

    I don't really understand why this patch is needed. If I
    look at that function, it calls isSentMailbox, which does
    the test:

    $move_to_sent && $sent_folder &&
    ( $box == $sent_folder || isBoxBelow($box,
    $sent_folder) );

    Your sent_subfolders are below the sent_folder right? Then
    why does this test fail, can you try to trace that down? Thanks.

  • Thijs Kinkhorst

    Thijs Kinkhorst - 2005-04-27
    • labels: 310313 -->
  • Thijs Kinkhorst

    Thijs Kinkhorst - 2005-04-27

    Logged In: YES

    This is essentially a bug in isSentMailbox, moving to bugs.

  • Justin Yackoski

    Justin Yackoski - 2005-12-13

    Logged In: YES

    I would say detecting based on whether a folder the message
    is in is marked sent is not the best approach.

    For example, I like to use a threaded display, so I use a
    hacked variable sent folder plugin to put my sent email in
    my INBOX without squirrelmail knowing I am (otherwise the
    "To" column and not the "From" column would be shown in my
    Inbox which is not good)

    What should be done I think is that the user's
    email address information (and any multiple identities)
    should be checked, and if the email was From the user, then
    the recipient should be shown instead. I.e., I receive one
    email from John, and send him a reply, so I should see
    something like this in my message list:

    From: Date: Subject:
    John 8:30am meeting
    ->John 8:40am re: meeting

    As it stands now, I get to choose between this:

    To: Date: Subject:
    John 8:30am meeting
    Justin 8:40am re: meeting

    or this:

    From: Date: Subject:
    Justin 8:30am meeting
    John 8:40am re: meeting

    neither of which is very good, I should not see my own name
    in the list, ever, unless I sent something from myself to
    myself. Below is a patch that does what I'm talking about,
    I can't figure out how to add it as a file attachment or I

    --- functions/mailbox_display.php.orig 2005-12-13
    14:12:13.628309500 -0500
    +++ functions/mailbox_display.php 2005-12-13
    17:48:35.595631750 -0500
    @@ -80,7 +80,41 @@
    $msg['FROM'] = $msg['TO'];
    $msg['FROM'] = parseAddress($msg['FROM'],1);
    + //if the user sent the email, then swap the From & To
    + $myAddress = strtolower(trim(getPref($data_dir,
    $username, 'email_address')));
    + $fromAddress = strtolower($msg['FROM'][0][0]);
    + if ($fromAddress == $myAddress) {
    + $msg['FROM'] = parseAddress($msg['TO'],1);
    + if ($msg['FROM'][0][1]) {
    + $msg['FROM'][0][1] = '->' . $msg['FROM'][0][1];
    + }
    + else
    + {
    + $msg['FROM'][0][0] = '->' . $msg['FROM'][0][0];
    + }
    + }
    + else
    + {
    + $idents = getPref($data_dir, $username, 'identities');
    + if ($idents != '' && $idents > 1) {
    + for ($i = 1; $i < $idents; $i ++) {
    + $cur_email_address = getPref($data_dir,
    + 'email_address' . $i);
    + $cur_email_address =
    + if ($cur_email_address == $fromAddress) {
    + $msg['FROM'] = parseAddress($msg['TO'],1);
    + if ($msg['FROM'][0][1]) {
    + $msg['FROM'][0][1] = '->' .
    + }
    + else
    + {
    + $msg['FROM'][0][0] = '->' .
    + }
    + break;
    + }
    + }
    + }
    + }
    * This is done in case you're looking into Sent
    * because you can have multiple receivers.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks