On Sat, Aug 05, 2017 at 07:11:08PM +0300, Marat Khalili wrote: > I'm cloning an LXC container which optionally can contain postfix > installation. After cloning the filesystem there's a number of > places I need to change the hostname in. > > I used grep to search for these places and unexpectedly found > mentioning of hostname in /etc/aliases.db, even though /etc/aliases > does not include it.
Is this an actual problem? Also, I wonder why you'd need multiple containers with Postfix installs? Did you consider possibly using a null client like msmtp, if all these containers need to do is send mail through a relayhost? > Thus I wonder if I need to re-generate /etc/aliases.db and how can > I do it without actually starting container? You might indeed want to generate your aliases.db for each container, and chroot(1) might be a means to do that. > I can run `newaliases -oAhash:/container/rootfs/etc/aliases` from > host, but then there's a name of the host system in aliases.db, > not container's. See also postalias(1), but I'm still not sure that this is a real problem. Does something in the container not work properly with host-generated aliases.db? > I can also re-generate it from within a container after starting > it and then reload postfix, but it is kludgy. Is there some better > way? The better way would probably be to simplify your mail infrastructure, using null clients where appropriate. I have nothing against containerizing Postfix nor running it in virtual machines, but unless your organization is very huge you do not need more than 1-2 MX hosts and perhaps a per-site MSA (which often can coexist on the submission port with MX instances.) -- http://rob0.nodns4.us/ Offlist GMX mail is seen only if "/dev/rob0" is in the Subject: