[Novalug] postfix Q (my domain as a virtual domain)
John Franklin
franklin at elfie.org
Mon Apr 5 11:20:40 EDT 2010
On Apr 5, 2010, at 10:45 AM, Chris Snyder wrote:
> So I just found that if I treat 'example.com' as a completely
> virtual domain,
> I can get around this problem:
>
> myhostname = mx.example.com
> mydomain = example.com
> mydestination = $myhostname, localhost.$mydomain, localhost
> virtual_alias_domains = example.com
> virtual_alias_maps = hash:/etc/postfix/virtual
>
> Now, all mail addressed to '@example.com' is treated as a virtual
> domain and
> if an address doesn't exist in the file /etc/postfix/virtual it's
> ignored
> (whereas, before if the account was in /etc/passwd or /etc/aliases,
> the
> recipent was considered valid). On the other hand the only way to
> deliver
> mail to a local user is to address it to @mx.example.com or send it
> from
> localhost to localhost. But, this is exactly what I want as the only
> local
> accounts that should ever recieve mail are the usual Ubuntu utility
> accounts
> such as mysql, root, etc. and that's all generated internal to the
> host
> anyway.
>
> So, am I missing anything here? Any major downsides to this? All
> the examples
> on the net use the 'add your domain to $mydestination' approach and
> I can't
> find anything like I've described, but neither can I find anything
> warning me
> not to do it.
That should work, and I do similar things for some of my domains. I
would point out three things:
* Postfix may complain if you put example.com in both mydomain and
virtual_alias_domains. I know it will if you put it in both
mydestination and virtual_alias_domains, but you're getting around
that with localhost.$mydomain and mx.$mydomain.
* Consider setting virtual_alias_domains to /etc/postfix/
virtual_domains and maintaining the domain name list in a file. This
will make it easier later on to set up additional virtual domains
(e.g., gopher.me), even if all they do is forward on a limited number
of addresses to Gmail.
* A Makefile in the /etc/postfix directory like the one below can make
managing the mail system a lot easier.
--- Example Makefile ---
all: virtusertable.db aliases.db transport.db
postfix reload
# I name the virtual_alias_maps 'virtusertable'
virtusertable.db: virtusertable
postmap /etc/postfix/virtusertable
aliases.db: aliases
newaliases
transport.db: transport
postmap /etc/postfix/transport
--- End Example Makefile ---
jf
--
John Franklin
franklin at elfie.org
ICBM: 39º 01' 58.4"N 77º 24' 49.6"W Z+84m
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2665 bytes
Desc: not available
Url : http://calypso.tux.org/pipermail/novalug/attachments/20100405/e957ad1c/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 203 bytes
Desc: This is a digitally signed message part
Url : http://calypso.tux.org/pipermail/novalug/attachments/20100405/e957ad1c/attachment-0001.bin
More information about the Novalug
mailing list