qmail_deliver_wrapper

Bill Earle bill at buffalo.edu
Thu May 22 09:17:47 EDT 2003


Jacob,

To have qmail deliver into users's spools we use something similar:

~<user>/.qmail contains either"
  |/usr/local/bin/procmail -pm /<path>/<to>/<homedir>/<user>/.procmailrc

 or

  |/usr/local/bin/precyrus <user>

The .procmailrc file can contain any no. of rules, but ultimately
would call precyrus with a mailbox name to deliver the message:

  | /usr/local/bin/precyrus <user> "<Mailbox>"

precyrus does:
1. test for an on/off file
   - allows us to disable delivery by touching a file
2. writes the message to a temporary location
3. calls deliver 2 different ways, based on the presence of
   a "Mailbox" commandline parameter:


    # No mailbox specified
    /bin/cat $temp/$now.$who.$$ | $PRELINE -fr \
    $DELIVER -r "$sender" -a $"$who" "$who" || EXITCODE="$?"

  or:

    # Mailbox specified
    folder=`echo $2 | /usr/bin/sed -e 's/ /\\\ /g'`
    /bin/cat $temp/$now.$who.$$ | $PRELINE -fr \
    $DELIVER -r "$sender" -m "$folder" -a "$who" "$who" || EXITCODE="$?"

4. If succesfull delivery, we send a copy of the message to
   another "mailhold" for DR purposes.
5. cleans up temporary message
6. exits with the EXITCODE

# The exit codes:
#define EX_USAGE        64      /* command line usage error */
#define EX_DATAERR      65      /* data format error */
#define EX_NOINPUT      66      /* cannot open input */
#define EX_NOUSER       67      /* addressee unknown */
#define EX_NOHOST       68      /* host name unknown */
#define EX_UNAVAILABLE  69      /* service unavailable */
#define EX_SOFTWARE     70      /* internal software error */
#define EX_OSERR        71      /* system error (e.g., can't fork) */
#define EX_OSFILE       72      /* critical OS file missing */
#define EX_CANTCREAT    73      /* can't create (user) output file */
#define EX_IOERR        74      /* input/output error */
#define EX_TEMPFAIL     75      /* temp failure; user is invited to retry
*/
#define EX_PROTOCOL     76      /* remote error in protocol */
#define EX_NOPERM       77      /* permission denied */
#define EX_CONFIG       78      /* configuration error */


- Bill

   William B. Earle	Computing & Information Technology
			University at Buffalo
Voice: 716.645.6580	301 Computing Center
Fax:   716.645.5972	Buffalo, NY 14260


On Wed, 21 May 2003, Jacob wrote:

> I'm looking for the qmail_deliver_wrapper script mentioned in this
> qmail-cyrus howto:
>
> http://web500gw.sourceforge.net/qmail-cyrus.html
>
> It is a wrapper around cyrus' deliver binary which translates
> deliver's exit codes to match what qmail expects and does some parsing
> of $LOCAL.
>
> Does anyone have a copy of this (or something similar) lying around or
> know where to find it?
>
> Thanks,
> Jacob
>





More information about the Info-cyrus mailing list