6.0.0-alpha12
6/8/25

[#2799] IMP_Fetchmail_imap defaults never apply
Summary IMP_Fetchmail_imap defaults never apply
Queue IMP
Queue Version HEAD
Type Bug
State Resolved
Priority 1. Low
Owners Horde Developers (at)
Requester jwm (at) horde (dot) net
Created 10/17/2005 (7174 days ago)
Due
Updated 05/12/2007 (6602 days ago)
Assigned 10/17/2005 (7174 days ago)
Resolved 05/12/2007 (6602 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
05/12/2007 04:29:52 PM Chuck Hagenbuch Comment #3
State ⇒ Resolved
Reply to this comment
I've gone ahead and removed the defaults; '' (empty string) is valid 
for remote mailboxes, and since they were never used...
10/25/2005 09:30:06 PM Chuck Hagenbuch Comment #2 Reply to this comment

[Show Quoted Text - 9 lines]
Well, if we're going to keep the defaults, we should make them show up 
in the UI somehow. Possibly by having $fm_account->getValue() return 
the default if the $account key is null; then it's just a matter of 
finding a nice way for $fm_account to get its default values - I 
looked at the code some and it wasn't falling in to pace for me.
Should IMP_Fetchmail_imap() override empty strings with the defaults?
Does having an empty value for {l,r}mailbox make any sense (IOW, do
any remote servers interpret this as a sane default)?
Probably not, but I'd be wary of running into a case (maybe with a 
parameter that hasn't been added yet, even) where there's a non-empty 
default for a parameter that can validly be empty. We don't want to 
make it impossible for users to zero out parameters that can be empty.



Moving the whole fetchmail form to use Horde_Form would actually take 
care of all of this.
10/17/2005 08:47:49 PM Jan Schneider Assigned to Horde DevelopersHorde Developers
State ⇒ Assigned
 
10/17/2005 04:10:03 PM jwm (at) horde (dot) net Comment #1
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ IMP_Fetchmail_imap defaults never apply
Queue ⇒ IMP
Reply to this comment
IMP_Fetchmail_imap supplies defaults for {l,r}mailbox in its constructor:



     function IMP_Fetchmail_imap($params)

     {

         /* Default values for a couple of parameters. */

         $defaults = array(

             'rmailbox' => 'INBOX',

             'lmailbox' => 'INBOX'

         );

         $params = array_merge($defaults, $params);



but these values never apply because imp/fetchmailprefs.php 
unconditionally sets all parameters:



     foreach ($fetchmail->getParameterList() as $val) {

         $fm_account->setValue($val, Util::getFormData('fm_' . $val), 
$to_edit);

     }



so they wind up being empty strings ("").



Should IMP_Fetchmail_imap() override empty strings with the defaults? 
Does having an empty value for {l,r}mailbox make any sense (IOW, do 
any remote servers interpret this as a sane default)?


Saved Queries