| 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 |
changes on my test account on the system, but looking in my personal
procmailrc file for the changes. Sorry for the false alarm.
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?
'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'
)
)
);
State ⇒ Feedback
shows up in my script as expected. Can you post your backends.php file?
State ⇒ Assigned
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ 'scriptparams[variables]' Setting in config/backends.php Not Being Used
Queue ⇒ Ingo
'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.