I would say the most reliable way would be to just parse
/var/qmail/virtualdomains and compare the LHS with $HOST (although this
is a problem while somebody has updated virtualdomains but haven't sent
-HUP to qmail-send yet). Do you just need to test for these three packages
or does it need to handle all types (for example, maildrop has its own
virtual users mechanism)? How reliable does it need to be?
Tim
On Wed, May 16, 2001 at 09:53:13AM -0600, Jason R. Mastaler wrote:
> Does anyone know of a reliable way to programatically test whether an
> incoming message is part of a qmail "virtualdomain" or not?
>
> I've been looking at qmail-send's environment variables under
> both a regular setup and a virtualdomain, and can't find a surefire
> way to differentiate the two cases. Take a look at qmail-command(8)
> under "ENVIRONMENT VARIABLES" to see what I'm talking about.
>
> I need a method that works under vmailmgr, vpopmail, and qmail's
> builtin "virtualdomains" support.
>
> For example, under vpopmail, the 'USER' environment variable is set to
> the virtualdomain instead of the username, so this is easily tested
> for (if username != $USER, ...). However, this isn't the case under
> vmailmgr or "virtualdomains".
>
> Thanks.
>
> --
> (TMDA - http://tmda.sourceforge.net/)
> (A qmail-based SPAM reduction system)