6.0.0-beta1
11/25/25

[#2016] 'scriptparams[variables]' Setting in config/backends.php Not Being Used
Summary 'scriptparams[variables]' Setting in config/backends.php Not Being Used
Queue Ingo
Queue Version 1.0.1
Type Bug
State Not A Bug
Priority 2. Medium
Owners ben (at)
Requester derek (at) battams (dot) ca
Created 05/22/2005 (7492 days ago)
Due
Updated 05/24/2005 (7490 days ago)
Assigned 05/23/2005 (7491 days ago)
Resolved 05/24/2005 (7490 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
05/24/2005 01:08:52 AM Chuck Hagenbuch State ⇒ Not A Bug
 
05/24/2005 01:06:00 AM derek (at) battams (dot) ca Comment #5 Reply to this comment
Close the bug... I feel kind of stupid. :-)  I was testing these 
changes on my test account on the system, but looking in my personal 
procmailrc file for the changes.  Sorry for the false alarm.
05/24/2005 12:47:55 AM ben Comment #4 Reply to this comment
I copy & pasted that into my backends.php file, and it works just fine:



   1: # procmail script generated by Ingo (May 23, 2005, 7:43 pm)

   2: LOGFILE=$HOME/.procmail.log

   3:

   [snip]



Can anybody else reproduce this problem?
05/23/2005 06:29:12 PM derek (at) battams (dot) ca Comment #3 Reply to this comment
$backends['procmail'] = array(

     'driver' => 'vfs',

     'preferred' => 'battams.ca',

     'hordeauth' => true,

     'params' => array(

         // Hostname of the VFS server

         'hostspec' => 'localhost',

         // Name of the procmail config file to write

         'procmailrc' => '.procmailrc',

         // Port of the VFS server

         'port' => 21,

         // The VFS driver to use

         'vfstype' => 'ftp'

     ),

     'script' => 'procmail',

     'scriptparams' => array(

         // What path style does the IMAP server use ['mbox'|'maildir']?

         'path_style' => 'maildir',

         // An array of variables to append to every generated script.

         // Use if you need to set up specific environment variables.

         'variables' => array(

             // Example for the $PATH variable

             // 'PATH' => '/usr/bin'

             'LOGFILE' => '$HOME/.procmail.log'

         )

     )

);
05/23/2005 04:14:59 AM ben Comment #2
State ⇒ Feedback
Reply to this comment
I can't reproduce this.  Anything I put in scriptparams['variables'] 
shows up in my script as expected.  Can you post your backends.php file?
05/22/2005 11:28:43 AM Jan Schneider Assigned to ben
State ⇒ Assigned
 
05/22/2005 04:00:50 AM derek (at) battams (dot) ca Comment #1
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ 'scriptparams[variables]' Setting in config/backends.php Not Being Used
Queue ⇒ Ingo
Reply to this comment
I am using procmail as the backend and when I add an entry to the 
'scriptparams[variables]' array in config/backends.php it is not being 
used in the .procmailrc generation.  Basically I'm trying to add a 
parameter called 'LOGFILE' so that logfiles are created for all users. 
  But when I add the parameter to the array it is not being written to 
the generated .procmailrc file.



From what I can see by tracing the code, my guess is that the problem 
comes from the fact that the Ingo_Script_procmail class is not calling 
its parent constructor, which causes the _params property of the class 
to not be set properly.  However, I'm not able to completely follow 
the code in this area so I can't provide a patch nor am I even certain 
I'm correct, but it seems like I'm at least in the right area?  A 
trace of the code brings me to this block in the generate() method of 
the Ingo_Script_procmail class in lib/Script/procmail.php:



         /* Add variable information, if present. */

         if (!empty($this->_params['variables']) &&

             is_array($this->_params['variables'])) {

             foreach ($this->_params['variables'] as $key => $val) {

                 $this->addItem(new Procmail_Variable(array('name' => 
$key, 'value' => $val)));

             }

         }



Dumping the value of $this->_params['variables'] spits out an array of 
size 0, even when I set a value in the backends.php file.  Again, my 
guess is that this array is not being set properly because this 
Ingo_Script_procmail class doesn't initialize it via a call to its 
parent constructor on object instantiation.

Saved Queries