
kyle-qmail at memoryhole
May 14, 2009, 12:23 PM
Post #4 of 4
(1523 views)
Permalink
|
|
Re: How to use wildcard subdomains with Qmail? Please help!
[In reply to]
|
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On Thursday, May 14 at 08:37 AM, quoth Olaf Spaarmann: > I understand very well that one should read the documentation first > and I probably feel the same when people ask stupid questions in a > domain I know a lot about. But I read a lot and still didn't find a > solution. That's very fair, and I can respect that. The only reason I jumped on the "read the documentation" thing up front was because it *appeared* that you had not read the documentation, and were instead using the error messages as a kind of on-line step-by-step configuration howto. > I already tried to add something like > > .example.com:foo > > to control/virtualdomains. After that qmail accepted the message first > but didn't know where to put it. So it didn't work. Ahh, you didn't mention that. You were close! In order to understand how the virtualdomains system works, you have to understand qmail's address extension scheme. Here's the basics: Let's assume a very basic LWQ setup where the machine has only one domain (example.com) and all the users are system users (e.g. home directories in /home/$USERNAME). If I have a user (say, "me") on this system, it's clear that mail addressed to me [at] example will be delivered according to /var/qmail/control/defaultdelivery unless the user does more specific setup (e.g. I create a ~/.qmail file). What is not always clear is that mail addressed to me-foo [at] example is also considered valid. I (the user) can tell qmail to deliver that mail differently by creating a ~/.qmail-foo file. In this case, "foo" is called the "extension". I can also use wildcards, by using the "special" extension, "default". Thus, a ~/.qmail-default file specifies how to handle the delivery of messages addressed to me-*@example.com. With me so far? Now, virtualdomains work by prepending things to the local part of the email address. For example, if I added example2.com to rcpthosts and then added example2.com:bar to virtualdomains, qmail will accept all mail addressed to example2.com email addresses. When it does so, it will prepend the address with "bar-", so mail addressed to whatever [at] example2 is treated like it was addressed to bar-whatever [at] example2 See how that fits nicely with the extension scheme? So, if I specify example2.com:me in virtualdomains, then the "me" user is responsible for all example2.com email addresses. For example, email addressed to foo [at] example2 would be treated as if it was addressed to me-foo [at] example2, which would be handled by a ~me/.qmail-foo file. Of course, wildcards here work as expected, so it could also be handled by a ~me/.qmail-default file if the .qmail-foo file doesn't exist. Does that make sense? > Another question: Do you think it is generally a bad idea to allow > all subdomains? Nah; I do that a lot. You just have to be aware that qmail doesn't do any sort of verification of the existence of the subdomain. ~Kyle - -- Reality is that which, when you stop believing in it, doesn't go away. -- Philip K. Dick -----BEGIN PGP SIGNATURE----- Comment: Thank you for using encryption! iQIcBAEBCAAGBQJKDG+7AAoJECuveozR/AWeobcP/1KJxj2LBCqEJdPJM3iaYjJV +4oL/bp1wgKZOYGknXFe7ZxiTlqnsj/29en7M/mj7Fgxf5eF4EYOJPH6Ubo9tYbr 9u42y5PkkHo0/QgcEkoqH9pnIvRCfcnQqCpL3F+Mneh3dZOGzfYeoUEdxnSDChuo YsGN5PWgwNNZLGt1qmd7gFpdlVSv6aS67V2DU5UdXxhYFhc4fFYWW7XLjssK9kQt vmpMVo4xK0XuiXyZ7rxNm3BVhxJqmOsV/JWYJaUS4xNpb6LiADVtkJ2+VFTlAIO/ KNriK34UX0yp7AcKknkS4/uW7dvFnzVCWANUWEqHRFGyBqFqKy9PejtMquIyGNBF sKlIF0yWycAv1yXDlnjDtgDsfDKw9QLCdKgW/l9pHtXkliWagbTTqyV6ybTlx2f3 yO/1k66T6I0gC7iyEcJscuRkNmvQ6AGqXMNxFnyIZ9sUWh1L/2q6n3529yqB7JNg m+oKAs6scSWCAdbeBmveYictaqc313ePWwHhENd196pjjmvO3pvR+SPN3zhFeGqH crZOXAVcvG/y7tvw9mnK4CBux4TOE0rBzxDH/WfKajVYIcWPKgtFRjYQnux3fqWx 3HxJmjpKegx2n/iu0ZwtcbWXyZFtnojgBR/iTm4zmpxLPgONXXJkKtPUJcjjY3QI vQpbSycajp6neWwQR1I9 =o5RE -----END PGP SIGNATURE-----
|