>> Of course. When qmail rewrites the local part of a virtual domain
>> address, it does NOT change the domain. So all you have to do is to
>> look up $DOMAIN in virtualdomains, and if you find it strip off the
>> prepend string. It should take about three lines of perl.
>
>Or three lines of Python in this case. It isn't that this is hard to
>implement, but that it involves unnecessary overhead for such a simple
>issue that could have (and should have IMO) been worked into the
>design. This is like having to climb a long flight of stairs when an
>elevator would be so much simpler and more efficient.
This is silly. It's more like a building with 100,000 residents, only
one of whom wants to go upstairs, and he's moaning and groaning that
there isn't an express elevator just for him.
>For my application, your suggestion would involve parsing the
>virtualdomains file each time an incoming message arrives. What if
>the box hosts 10K, 100K or even more virtualdomains?
So if it's huge, shadow the entries in a dbm or cdb file. We have, as
the saying goes, the technology. If you're firing up a perl or python
script for each delivery, the extra overhead of reading looking up the
domain in virtualdomains or a database version thereof would be
imperceptible.
> What if the virtualdomains file is not readable by the user?
Tell people who are using your software not to do that.
Either you can deal with the problem, or you can complain. I happen
to have a dispatch system here that uses a MySQL database to lookup
and deal with mail to a bunch of virtual domains. It works by putting
the same exact prefix in the virtualdomains file for each one of the
domains it handles. It would be nuts to do it any other way, random
inconsistent prefixes would be impossible to keep track of. It
currentlt handles 119 domains, but there's no reason it wouldn't scale
up into the thousands and beyond.
Finally, if you look at the source code for qmail, you will see that
even if you wanted to pass along the unprefixed version of the
address, it would take a great deal of hackery to do so. The virtual
domain rewriting happens in qmail-send, which then stashes the
envelope addresses in queue files, then passes the queue info down a
pipe to qmail-lspawn, which then runs qmail-local to do the local
delivery. You'd have to change the queue file format to make room for
the unprefixed address, then change qmail-lspawn to pick it up and
pass it to qmail-local, and change qmail-local to take it and put it
in an environment variable. It'd be possible, but it's a lot of work
to write, and it'd do a lot of wasted work for the vast majority of
deliveries that don't care about the prefix.
--
John R. Levine, IECC, POB 727, Trumansburg NY 14886 +1 607 387 6869
[EMAIL PROTECTED], Village Trustee and Sewer Commissioner, http://iecc.com/johnl,
Member, Provisional board, Coalition Against Unsolicited Commercial E-mail