Here's a quick guide on how to SAFELY modify a user's .qmail files on
an SMEServer.

You should be familiar with the following man pages (at least)

    man -M /var/qmail/man dot-qmail
    man -M /var/qmail/man qmail-command
    man -M /var/qmail/man preline

Let's assume the user name is bob. You can change instances of "bob"
below to suit your needs.

    - create a new .qmail-filter file for bob that contains the programs you
    want and possibly default delivery instructions if you want mail
    to be delivered to bob's Maildir/ if the script fails.

        cat > ~bob/.qmail-filter << EOF
| /path/to/your/script with optional arguments
./Maildir/
EOF

    - ensure the ownerships and permissions are correct

        chown bob.bob ~bob/.qmail-filter
        chmod 644 ~bob/.qmail-filter

    - use the SMEServer manager to forward bob's mail to

        bob-filter

This approach will ensure that your changes will survive any future
modifications to bob's account (such as adding him to a new group for
example). If you don't use this approach, bob's .qmail file will be
overwritten with the default delivery details, which is not what you
want.

If your command requires the existence of a UUCP style "From " header
(not to be confused with an RFC822 style "From: " header) then you may
want to prepend the command with preline

    | preline /path/to/your/script with optional arguments

Be aware that preline demands that the program it calls accept the
ENTIRE message, so if your script closes STDIN before reading it all,
preline will complain and you'll see the following messages in
/var/log/qmail/*

    deferral: preline:_fatal:_unable_to_copy_input:_broken_pipe/

-- 
Regards
Peter
----------
Peter Samuel, Senior Systems Administrator  [EMAIL PROTECTED]
http://www.e-smith.org (development)        http://www.mitel.com (corporate)
Phone: +1 613 592 2122                      Fax: +1 613 592 1175
Mitel Networks, 350 Leggett Dr, Ottawa, ON K2K 2W7 Canada

"If you kill all your unhappy customers, you'll only have happy ones left"


--
Please report bugs to [EMAIL PROTECTED]
Please mail [EMAIL PROTECTED] (only) to discuss security issues
Support for registered customers and partners to [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Archives by mail and http://www.mail-archive.com/devinfo%40lists.e-smith.org

Reply via email to