August 11, 2006

Qmail : Domain specific relaying

Recipe to forward e-malis destined to a particular domain in qmail
1) Edit smtproutes (usually located in /var/qmail/control) and add the following line
DOMIAN_TO_FORWARD:HOST_TO_FORWARD_TO

2) Edit rcpthosts (usually located in /var/qmail/control) and add name of the domain

3) Restart qmail

Note: Make sure that the domain is not listed in the virtualdomains files too. Or qmail will process the virtualdomains file first and ignore the smtproutes entry.

Qmail : Trick

If you are using vpopmail and qmail to host virtual domains, you can get a list of all the aliases in a domain by using valias. The syntax is
valias -s DOMAIN_YOU_WANT_TO_LIST_ALIASES

If you want to list the users (and NOT aliases) in a domain, you can use vuserinfo. The syntax is
vuserinfo -D DOMAIN_YOU_WANT_TO_LIST_USERS