-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


> Works dandy if your users all have a .qmail file containing:
> 
> |preline -f /usr/local/bin/deliver scotte
> 
> (or equivalent), where 'scotte' is the local username of course.
> 

Since I didn't want to put a .qmail file in each user's directory,
I'm using this setup, instead:

- --- /var/qmail/users/assign ----
+:alias:81:12:/var/qmail/alias:-::
.

(12 is the mail group, otherwise deliver cannot deliver the message)

- --- /var/qmail/alias/.qmail-default
| ./entrega

- --- /var/qmail/alias/entrega
###############################################
# Local delivery to cyrus
#
# get what's before the first dash
#
userid="`echo "${LOCAL%%-*}" | tr "A-Z" "a-z"`"
# change dashes with dots
mailbox="`echo "$EXT2" | tr "A-Z" "a-z" | sed "s/-/./g"`"


if [ "$mailbox" = "" ]
then
# direct delivery to user's INBOX
  /usr/cyrus/bin/deliver -e -f "$SENDER" "$userid"
else
# deliver to a user folder (if it fails the message will 
# end up in INBOX anyway)
  /usr/cyrus/bin/deliver -e -f "$SENDER" -m "$mailbox" -a "$userid"
"$userid"
fi

result="$?"
# 67 is "no such mailbox"
if [ "$result" = "67" ]
then
# force a 65 so that qmail will bounce the message
  result=65
fi

exit $result

- -- 
Luca Olivetti  http://www.luca.ddns.org
Telefonica es un freno para el desarrollo del pa�s
Telefonica is a restrain on the development of the country
- ------------------[ http://www.internautas.org ]---------------------


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v0.9.3 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE3KsxSCQPXTRx9NmQRApfFAKCzFDaS4OMLON+b1AYP488YVl/iawCgsYUw
hrNJefHpqDRpxQMKDVbb8+A=
=xqh3
-----END PGP SIGNATURE-----

Reply via email to