1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice

custom lines in /var/qmail/users/assign

Discussion in 'Plesk for Linux - 8.x and Older' started by tyler, Jun 13, 2005.

  1. tyler

    tyler Guest

    I'm trying to set up a particular e-mail address to deliver mail to a ruby script. I've found several threads that explain how this can be done by setting up a mailname with no delivery options, and then editing the .qmail file for that mailname, but there are two problems with they way they're implemented, from my point of view:

    1. When the delivery script is executed, it has the permissions of "popuser". I need it to have the permissions of a virtual host. (We've moved completely away from all the mod_php safe_mode stuff, and are using fastcgi/suexec to run all scripts with real user permissions. This policy needs to extend to mail scripts, as well)

    2. There isn't any way to use qmail's wildcard addressing with this method. (e.g. I couldn't pipe tyler-spam@mydomain.com, tyler-amazon@mydomain.com, and tyler-plesk@mydomain.com to the same script without setting up seperate mailnames for each.)

    The solution, it seems, is to add custom lines directly into /var/qmail/users/assign. Unfortunately, whenever I do this, qmail overwrites my changes the next time I run mchk (and possibly at other times, as well; I haven't tested thoroughly).

    Is there any way to specify custom lines that should be included in /var/qmail/users/assign?
  2. tyler

    tyler Guest

    nevermind :p

    Nevermind -- found my own solution. If you're curious:

    I setup a script@domainname.com address, and made that the catchall for the domain. (the script will have to filter out stuff that's not directed to it, but hey, that's doable.) Then I made the script@domainname.com .qmail file look like this:

    | /home/httpd/vhosts/domain/mail/deliver

    qmail lets you use the suexec bit to execute scripts as other users, so chmod u+s /home/httpd/vhosts/domain/mail/deliver, and voila!