[#6433] add procmail support for external delivery
Summary add procmail support for external delivery
Queue Ingo
Queue Version HEAD
Type Enhancement
State Resolved
Priority 1. Low
Owners Chuck Hagenbuch <chuck (at) horde (dot) org>
Requester Michael (dot) Redinger (at) uibk (dot) ac (dot) at
Created 03/12/2008 (60 days ago)
Due
Updated 04/08/2008 (33 days ago)
Assigned
Resolved 04/08/2008 (33 days ago)
Attachments ingo-procmail-externaldeliver.tar.gz Download
Milestone 1.2
Patch 1

History
04/08/2008 Chuck Hagenbuch Comment #2
State ⇒ Resolved
Assigned to Chuck Hagenbuch
Reply to this comment
Committed. Please have a look at horde/docs/CODING_STANDARDS and the changes I made to your patch for next time. Thanks!
03/12/2008 Chuck Hagenbuch Patch ⇒ 1
Milestone ⇒ 1.2
State ⇒ Accepted
Summary ⇒ add procmail support for external delivery
 
03/12/2008 Michael (dot) Redinger (at) uibk (dot) ac (dot) at Comment #1
New Attachment: ingo-procmail-externaldeliver.tar.gz Download
Patch ⇒
Milestone ⇒
Queue ⇒ Ingo
Summary ⇒ add procmail support for external delivery [patch]
Type ⇒ Enhancement
Priority ⇒ 1. Low
State ⇒ New
Reply to this comment
Currenty the Ingo procmail script does not work if procmail on your server can deliver the mails directly and does not need an external delivery program.

However, on some mail servers an external program is required, eg. if you use a mailbox format that procmail does not support directly (like mbx for uwash imapd). In that case you hand the delivery off to an external program:

:0 w
* someconditions
| /usr/local/sbin/dmail +$DEFAULT


In most cases, this also means that the usage of procmail has to be set in the .forward file in the user's home directory, eg.:
"|/usr/local/bin/procmail"

The .procmail file always contains one final line the unconditionally delivers to the inbox if no other condition was met:
:0 w
| /usr/local/sbin/dmail +$DEFAULT
(also note the 'w' - procmail should wait for the external program)

This also means that no empty procmail script must be generated - instead, the old configuration should be deleted (vfs.php). An empty file would result in a delivery error (as the external delivery program is not called).

I wrote two patches that implement this behaviour and make it configurable.
You can set the behaviour described above by setting:

$backends['procmail'] = array(
    // generate .forward
    'forwardstring' => '"|/usr/local/bin/procmail"',
    ...
    'scriptparams' => array(
       // use external delivery program
        'deliver' => '/usr/local/sbin/dmail',
       // most external programs need a prefix for the box, eg
       // dmail +mybox
       // I have different prefixes, so it must be configured properly here
        'deliverboxprefix' => '+',
       ...
      )
)


- the first patch changes lib/Script/procmail:
  * add default deliver
  * change delivery lines to |deliver +/-/#MAILBOX
  * add "w" to ":0" for external delivery
- the second patch changes lib/Driver/vfs.php
  * delete the script if it is empty (do not generate empty one)
  * if backend is forward and forwardstring is set, generate .forward