Enable interpolation of alias destinations
This patch modifies the virtual_alias_maps function so that the destination
address is parsed for the place holders %n, %d and %=, which are replaced with
the localpart, the domain or the full address with '@' replaced by '=' of the
queried key.
In combination with alias domains, this allows for domain-specific recipients.
E.g. given example.org and its alias domain example.com, defining an alias
postmaster@example.org → postmaster+%d@example.org
will cause mail to postmaster@example.*com* to go to
postmaster+example.*com*@example.org.
# -*- coding: UTF-8 -*-# Copyright (c) 2007 - 2011, Pascal Volk# See COPYING for distribution information.""" VirtualMailManager.constants ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ VirtualMailManager's constants: * version information * upper and lower limits MIN_* / MAX_* * exit codes * error codes"""# version information__all__=['__author__','__date__','__version__']AUTHOR='Pascal Volk <user+vmm@localhost.localdomain.org>'RELDATE='2009-09-09'VERSION='0.5.2'__author__=AUTHOR__copyright__='Copyright (c) 2007-2011 %s'%__author____date__=RELDATE__version__=VERSION# limitsMIN_GID=70000MIN_UID=70000# exit codesEX_SUCCESS=0EX_MISSING_ARGS=1EX_UNKNOWN_COMMAND=2EX_USER_INTERRUPT=3# error codesACCOUNT_AND_ALIAS_PRESENT=20ACCOUNT_EXISTS=21ACCOUNT_MISSING_PASSWORD=69ALIASDOMAIN_EXISTS=23ALIASDOMAIN_ISDOMAIN=24ALIASDOMAIN_NO_DOMDEST=25ALIAS_EXCEEDS_EXPANSION_LIMIT=27ALIAS_EXISTS=28ALIAS_PRESENT=30CONF_ERROR=31CONF_NOFILE=32CONF_NOPERM=33CONF_WRONGPERM=34DATABASE_ERROR=35DOMAINDIR_GROUP_MISMATCH=36DOMAIN_ALIAS_EXISTS=37DOMAIN_EXISTS=38DOMAIN_INVALID=39DOMAIN_NO_NAME=40DOMAIN_TOO_LONG=41FOUND_DOTS_IN_PATH=42INVALID_ADDRESS=43INVALID_ARGUMENT=44INVALID_MAIL_LOCATION=70INVALID_SECTION=46LOCALPART_INVALID=47LOCALPART_TOO_LONG=48MAILDIR_PERM_MISMATCH=49MAILLOCATION_INIT=50NOT_EXECUTABLE=51NO_SUCH_ACCOUNT=52NO_SUCH_ALIAS=53NO_SUCH_ALIASDOMAIN=54NO_SUCH_BINARY=55NO_SUCH_DIRECTORY=56NO_SUCH_DOMAIN=57NO_SUCH_RELOCATED=58RELOCATED_ADDR_DEST_IDENTICAL=59RELOCATED_EXISTS=60UNKNOWN_SERVICE=65VMM_ERROR=67VMM_TOO_MANY_FAILURES=68