[imp] expand names on send?

Liam Hoekenga liamr@umich.edu
Tue, 11 Jun 2002 13:55:17 -0400


We're going to need to impliment this ('expand_on_send') before we can deploy
3.1 on our campus (the helpdesk finds the "expand names" button too confusing
now that we're going to be making sql based addresses books available).

I'm doing the work against head, but hope to back port it if I get it working.

I'm running into problems..  I'm using compose.php (2.470), and I've tried to
insert this into the SEND case, around line 850:

         if (!empty($replyto) && $replyto != $barefrom) {
             $headers['Reply-to'] = $replyto;
         }
         if ($prefs->getValue('expand_on_send')) {
             Horde::logMessage(_("I think you want me to expand the addresses be
fore I send this."), __FILE__, __LINE__, LOG_DEBUG);
             expandAllAddresses();
         }

         if (!empty($f_to)) {
             $f_to = format_addresses($f_to);
             $headers['To'] = $f_to;
             $recipients = $f_to;
         }

I figure it needs to happen before format_addresses is invoked, because expand
names won't want to expand a name that's already had the default domain tacked
on to it.

Well, the above doesn't work.  I tried adding a break after the call to
expandAllAddresses, and that /did/ work, and will expand names when you hit
send, but won't allow you to get past that condition.  It will /always/ invoke
expandAllAddresses and never get on to sending the message.  

I realize that the logic is imcomplete / flawed , but I was wondering if anyone
had done any work or thought about a feature like this since it was discussed on
the list a few months ago?

Liam