Accidentally deleted from my primary mailbox...

2017-01-12 12:41 GMT+01:00 Damian McGuckin <dami...@esi.com.au>:

>
> For faster access, I assume it is better to use
>
>         table aliases db:/etc/mail/aliases.db
>
> instead of
>
>         table aliases file:/etc/mail/aliases
>

Wrong assumption.

file is actually faster than db as has been benchmarked before we switched
it to become the new default.

The reason is that file actually processes the file to create a memory
mapping and avoid disk access.

The file backend is the preferred method, it is superior to it, provides
better performances, better integration with smtpd (atomic fail-safe reload
through smtpctl table reload) and doesn't rely on a separate command like
newaliases/makemap.



> It would appear that if you use the latter syntax, OpenSMPTD does not even
> use the '.db' file, i.e. aliases.db. Am I correct? Sorry, I went through
> the source but I found it tough going.
>

Yes, if you use db: it reads the db, if you use file: it reads the  file
(and maps it to memory)


> Is ony of the other better form for smallish systems, i.e. under 100
> users, under 100 aliases?
>

file


> I ask this because sending emails to an alias worked for me without an
> 'aliases.db'. I note that some older OpenSMTPD discussions out on the
> internet gives the impression that 'aliases.db' is needed even it the
> latter form of the table definition is used. I think that those authors
> must have been confused with ugly old 'sendmail' which complains if the
> file 'aliases.db' is out of date relative to 'aliases'.
>

yes, they are confused, smtpd doesn't rely on db, if it were just me, I'd
kill that code.


> Note that with OpenSMTPD, if the first form appears in 'smtpd.conf', and
> the file 'aliases.db' does not exist, then calling 'newaliases' results in
> a message
>
> /etc/mail/smtpd.conf:6: invalid configuration file /etc/mail/aliases.db
> for table aliases
>

newaliases only works for .db files, you don't need it if you don't build a
db (which  again is the prefered way)



> This is a bit cryptic as the file is not invalid, just missing.
>
> The quick fix is to
>
>         cd /etc/mail
>
> and then either
>
>         makemap aliases
> or
>         makemap -d hash -o aliases.db aliases
>
> After that, 'newaliases' works nicely. I would have thought that one of
> the first things OpenSMTPD's version of 'newaliases' did was a 'makemap'.
>

nope because db is a historical leftover we can't kill ... yet.

Reply via email to