r-raymond / nixos-mailserver

A complete and Simple Nixos Mailserver
GNU General Public License v3.0
181 stars 27 forks source link

Duplicate entries in vaccounts #94

Closed dotlambda closed 6 years ago

dotlambda commented 6 years ago

SNM Version: (e.g. v2.1.3)

v2.1.3

Nixos Version: (e.g. 17.09 or unstable)

unstable

Relevant part of the config to reproduce:

I have set fqdn, domains and loginAccounts. Some of the loginAccounts have aliases.

What happened:

The file /var/lib/postfix/conf/vaccounts contains the lines that do not represent aliases twice.

Relevant journald log:

postfix-pre-start[12408]: postmap: warning: /var/lib/postfix/conf/vaccounts.db: duplicate entry: "mail@example.com"
postfix/postmap[12451]: warning: /var/lib/postfix/conf/vaccounts.db: duplicate entry: "mail@example.com"
phdoerfler commented 6 years ago

Also happens on nixos-17.09-small.

r-raymond commented 6 years ago

Hi @dotlambda, thanks for pointing this out. Please note that postfix complains about vaccounts, not about valiases (where your fix is applied). It is important to have the valiases have the identity map if you want to use catch alls (it is stupid that postfix works this way - but that is just the way it is) - otherwise the catchall binds all addresses that are not mentioned in valiases. vaccounts has these duplicate entries from a time where the accounts were regular system users, so we can remove them.

dotlambda commented 6 years ago

So, we'd have to compute vaccounts in a different way?

dotlambda commented 6 years ago

Actually, vaccounts should be exactly all_valiases_postfix then, shouln't it?

r-raymond commented 6 years ago

You are right. Unfortynately I can't test right now. If you send a PR and travis accepts it I'll merge it.