6.0.0-git
2019-03-20

[#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 2005-10-17 (4902 days ago)
Due
Updated 2007-05-12 (4330 days ago)
Assigned 2005-10-17 (4902 days ago)
Resolved 2007-05-12 (4330 days ago)
Milestone
Patch No

History
2007-05-12 16:29:52 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...
2005-10-25 21:30:06 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.
2005-10-17 20:47:49 Jan Schneider Assigned to Horde DevelopersHorde Developers
State ⇒ Assigned
 
2005-10-17 16:10:03 jwm (at) horde (dot) net Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 1. Low
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