r-raymond / nixos-mailserver

A complete and Simple Nixos Mailserver

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Duplicate entries in vaccounts

dotlambda opened this issue · comments

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"

Also happens on nixos-17.09-small.

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.

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

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

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