Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[gentoo-user] postfix: /etc/postfix/aliases or /etc/mail/aliases ?

86 views
Skip to first unread message

Adam Carter

unread,
Jul 11, 2021, 11:30:03 PM7/11/21
to
I have an old log warning I want to clean up, and am assuming that the aliases and aliases.db file would typically be in the same directory. When the postfix service starts at boot;
postfix/postalias[607]: fatal: open /etc/postfix/aliases.db: Read-only file system

The location is currently configured in main.cf;
# postconf alias_maps
alias_maps = hash:/etc/postfix/aliases

And looks like the installer puts the original alias file there too, so I assume my config is per the default config;
# qlist postfix | grep aliases
/etc/postfix/aliases

But this;
# grep aliases /lib/systemd/system/postfix.service
ExecStartPre=-/usr/bin/newaliases
ReadWritePaths=-/etc/mail/aliases.db

Suggests that /etc/mail is the correct location, so i'm wondering if i missed an update to postfix.service. Can a postfix user please check their ReadWritePaths to see if it's /etc/mail/aliases.db or /etc/postfix/aliases.db ? Cheers.








Eray Aslan

unread,
Jul 12, 2021, 2:30:03 AM7/12/21
to
On Mon, Jul 12, 2021 at 01:21:14PM +1000, Adam Carter wrote:
> The location is currently configured in main.cf;
> # postconf alias_maps
> alias_maps = hash:/etc/postifix/aliases

That's a non-default value. /etc/mail/aliases is the gentoo default.
Changing the default is fine but you need to let postfix create the db
file as well if you want to use /etc/postfix as your aliases location.

> And looks like the installer puts the original alias file there too, so I
> assume my config is per the default config;
> # qlist postfix | grep aliases
> /etc/postfix/aliases

yes postfix-install command places aliases file - along with a few
others - into standart configuration directory. It is somewhat of an
hassle to remove them as other commands expect at least some of them to
be present.

> But this;
> # grep aliases /lib/systemd/system/postfix.service
> ExecStartPre=-/usr/bin/newaliases
> ReadWritePaths=-/etc/mail/aliases.db
>
> Suggests that /etc/mail is the correct location, so i'm wondering if i
> missed an update to postfix.service. Can a postfix user please check their
> ReadWritePaths to see if it's /etc/mail/aliases.db or
> /etc/postfix/aliases.db ? Cheers.

Two options:
1/ use dafaults, i.e. /etc/mail/aliases
2/ use a custom location but then change postfix.service to give r/w
access to the new aliases.db location

I'd go with option #1 if you do not have a strong preference either way.

--
Eray

Adam Carter

unread,
Jul 12, 2021, 6:10:04 AM7/12/21
to
Two options:
1/ use dafaults, i.e. /etc/mail/aliases
2/ use a custom location but then change postfix.service to give r/w
access to the new aliases.db location

I'd go with option #1 if you do not have a strong preference either way.


Agreed - will go with #1 now. Thanks for your comment about postfix-install

Cheers!
0 new messages