[#2834] patch for qmail-ldap
Summary patch for qmail-ldap
Queue Vacation
Queue Version HEAD
Type Enhancement
State Resolved
Priority 2. Medium
Owners
Requester m (dot) zdila (at) episoftware (dot) com
Created 10/24/2005 (930 days ago)
Due
Updated 11/28/2005 (895 days ago)
Assigned 10/24/2005 (930 days ago)
Resolved 11/28/2005 (895 days ago)
Attachments vacation.diff Download
Milestone
Patch

History
11/28/2005 Jan Schneider Comment #6
State ⇒ Resolved
Reply to this comment
No feedback.
10/25/2005 Jan Schneider Comment #5
State ⇒ Feedback
Reply to this comment
>>> * LDAP attribute for marking active vacation message can be array -
>>> more entries - eg: 'reply', 'nolocal'. The value of the 'active'
>>> attribute is then specified as: reply|nolocal
>>
>> What is the unset() call for?
> it's because ldap_get_attributes adds to returned array the number of
> attributes in the entry (see:
> http://www.php.net/manual/en/function.ldap-get-attributes.php). We
> don't want to have the value of "count" in the result (eg.:
> 2|reply|nolocal)

Committed.

>>> * the vacation message format is modified for qmail-ldap (for now
>>> hardcoded in 2 places)
>>> Example:
>>> "%HEADER%\nSubject: " . _("On vacation message (Autoreply to:
>>> %SUBJECT%)") . "\n\n" . _("I'm on vacation and will not be reading my
>>> mail for a while.") . "\n" . _("Your mail will be dealt with when I
>>> return.") . "\n";
>>
>> This breaks any other driver, or am I missing something? Where is
>> %HEADER% being replaced?
>
> 1. see http://www.qmail-ldap.org/wiki/LDAP_REPLYTEXT
> 2. this patch will break only other LDAP using mailsystems
> (hardcoding is done only in Driver/ldap.php). Solution TODO:

No, it breaks *all* drivers because it changes $vacationtxt which is passed to all drivers, but only qmail LDAP understands it.

> a) specify mailsystem type in the configuration (exim, qmail-ldap)
> b) use callback for encoding/decoding vacation message

b) as long as it still works as it did before, for standard setups.
10/24/2005 m (dot) zdila (at) episoftware (dot) com Comment #4 Reply to this comment
to be clear: callback = hook
10/24/2005 m (dot) zdila (at) episoftware (dot) com Comment #3 Reply to this comment
hi

thanks for prompt reply :-)

>> * LDAP attribute for marking active vacation message can be array -
>> more entries - eg: 'reply', 'nolocal'. The value of the 'active'
>> attribute is then specified as: reply|nolocal
>
> What is the unset() call for?

it's because ldap_get_attributes adds to returned array the number of attributes in the entry (see: http://www.php.net/manual/en/function.ldap-get-attributes.php). We don't want to have the value of "count" in the result (eg.: 2|reply|nolocal)

>
>> * the vacation message format is modified for qmail-ldap (for now
>> hardcoded in 2 places)
>> Example:
>> "%HEADER%\nSubject: " . _("On vacation message (Autoreply to:
>> %SUBJECT%)") . "\n\n" . _("I'm on vacation and will not be reading my
>> mail for a while.") . "\n" . _("Your mail will be dealt with when I
>> return.") . "\n";
>
> This breaks any other driver, or am I missing something? Where is
> %HEADER% being replaced?

1. see http://www.qmail-ldap.org/wiki/LDAP_REPLYTEXT
2. this patch will break only other LDAP using mailsystems (hardcoding is done only in Driver/ldap.php). Solution TODO:
a) specify mailsystem type in the configuration (exim, qmail-ldap)
b) use callback for encoding/decoding vacation message

if you would like me to do it, just say a or b :-)
10/24/2005 Jan Schneider Comment #2
State ⇒ Assigned
Reply to this comment
> * LDAP attribute for marking active vacation message can be array -
> more entries - eg: 'reply', 'nolocal'. The value of the 'active'
> attribute is then specified as: reply|nolocal

What is the unset() call for?

> * the vacation message format is modified for qmail-ldap (for now
> hardcoded in 2 places)
> Example:
> "%HEADER%\nSubject: " . _("On vacation message (Autoreply to:
> %SUBJECT%)") . "\n\n" . _("I'm on vacation and will not be reading my
> mail for a while.") . "\n" . _("Your mail will be dealt with when I
> return.") . "\n";

This breaks any other driver, or am I missing something? Where is %HEADER% being replaced?
10/24/2005 m (dot) zdila (at) episoftware (dot) com Comment #1
Summary ⇒ patch for qmail-ldap
New Attachment: vacation.diff Download
Queue ⇒ Vacation
Priority ⇒ 2. Medium
State ⇒ New
Type ⇒ Enhancement
Reply to this comment
Hi

I am sending a patch for vacation module.
Highlights:
* specify LDAP Protocol Version
* LDAP attribute for marking active vacation message can be array - more entries - eg: 'reply', 'nolocal'. The value of the 'active' attribute is then specified as: reply|nolocal
* the vacation message format is modified for qmail-ldap (for now hardcoded in 2 places)
Example:
"%HEADER%\nSubject: " . _("On vacation message (Autoreply to: %SUBJECT%)") . "\n\n" . _("I'm on vacation and will not be reading my mail for a while.") . "\n" . _("Your mail will be dealt with when I return.") . "\n";

* if vacation message is empty, then the default one is pre-filled