I thought it would be polite to come back with an update, especially as
it is a positive one...
After admitting to myself that I wasn't going to solve this without some
serious help, this evening I fired up Anthropic's Claude AI. I started
the conversation at 19:50 - on the "free" account - and we finished with
a working solution at 21:15 - so just shy of 90 minutes of
back-and-forth to get it to work.
What was interesting was that in the case of several parameter sections
we actually went round in circles, with the model giving me dud advice
that I had to go back and correct, and in some cases [quite a surprise]
with me doing more than instructed and then seeing the model come back
and "compliment me" for being a bit more precise...
My sense is - and I asked the model, which sort of concurred - that a
very significant part of the issue is that the documentation for Dovecot
2.4.x is absolutely awful [and in fairness, I think it's why Claude gave
me so many examples of bad advice]. Ultimately, we used the artillery
technique of "fire a ranging shot" and then "look for the error
message/explosion" and go from there. A lot of iteration to get there,
but get there we did.
Grateful to both of you for stepping in to guide me through the start of
the process - and your input was spot on...
And if anyone else comes to this thread and is interested, I saved the
entire chat transcript to a document that I'm happy to share.
90 minutes of pretty good AI support for free: not bad.
On 07/05/2026 06:30, Brad MacPherson via Hampshire wrote:
>
> On 05/05/2026 17:01, Hants LUG via Hampshire wrote:
>> Hello all…
>
> G'day :-)
>
>>
>> The TLDR; is - First time poster here, hoping that someone might be
>> able to direct me to a guide to help me install a
>> Postfix/Dovecot/MariaDB setup on a Raspberry Pi 4B running Trixie
>> please?
>>
>>
>> I appreciate that’s exceedingly brief, so in the hope that it will
>> help, here’s (quite a bit) more detail…
>>
>> In readiness for the (hopefully soon) arrival of FTTP, I’d like to
>> get some experience with a locally-hosted mail service and would like
>> to build out some Raspberry Pi infrastructure to that effect.
>>
>> Current setup:-
>>
>> * Nominated Mail Server Host – Raspberry Pi 4B / running “Trixie”
>> * Proposed MTA – Postfix (“Compatability Level 3.6”)
>> * Proposed MDA/IMAP/POP3 – Dovecot 2.4.1-4
>> * Proposed SQL Server – MariaDB 11.8.5 [hosted on primary QNAP NAS]
>> * Existing DNS Infrastructure – Technitium DNS running on a Primary/
>> Secondary pair of Pi4Bs...
>>
>> Current State of Play:-
>>
>> * I have set up most of the requirements DNS – all but the DKIM
>> record…
>>
>> * I have [I think!] successfully installed and configured Postfix,
>> using this guide:-
>>
>> https://raw.org/tutorial/seting-up-email-server-with-postfix-
>> dovecot-and-mysql/
>>
>> * I’ve been able to get a MariaDB database configured and populated
>> and to use the “postmap -q” command to ensure that PostFix has the
>> ability to access the “Domain”, “User”, and “Alias” tables – all
>> that test OK.
>>
>> * I’ve followed the guide all the way through editing Dovecot – the
>> section on the above-linked page that has the sub-title, “Update
>> Dovecot Configuration Files” – and then in that part of the guide
>> and depending on your viewpoint, I am getting stuck and either Step
>> 4 [Edit /etc/dovecot/conf.d/auth-sql.conf.ext] or Step 5 [Edit /etc/
>> dovecot/dovecot-sql.conf.ext]… in that when I add the edits
>> described in Step 4 I get errors reported within the “passdb”
>> clause… or, if I comment that out, I find that the file /etc/
>> dovecot/dovecot-sql/conf.ext simply doesn’t exist in the Raspberry
>> Pi package.
>>
>> However, given that the file defined in Step 5, above, appears to be
>> explicitly named and linked from Step 4, I did try to simply create
>> an empty file and populate it as specified… but the error I get
>> suggests that I am missing some “syntactic wrapping” – headers, block
>> definitions, or similar. More specifically, I see this in syslog:
>>
>> /“dovecot[20420]: doveconf: Fatal: Error in configuration file /etc/
>> dovecot/conf.d/auth-sql.conf.ext line 186: passdb_args: Unknown
>> setting: passdb_args (passdb_passdb_args or passdb_sql_passdb_args
>> not found either.)”/
>>
>
> I recently upgraded my Bookworm hosted server to Trixie, and found the
> config file format has changed incompatibly between Dovecot 2.3 and
> 2.4. So a lot of the guides out there are now incorrect.
>
> For example, in /etc/dovecot/conf.d/10-auth.conf:
>
> auth_default_realm = teched-creations.com
>
> becomes
>
> auth_default_domain = teched-creations.com
>
>>
>> This is the relevant section of the auth-sql.conf.ext file:
>>
>> passdb sql {
>> driver = sql
>> args = /etc/dovecot/conf.d/dovecot-sql.conf.ext
>> }
>
> So this changed too - instead of referencing yet another config file,
> my file has:
>
> sql_driver = pgsql
>
> pgsql localhost {
> parameters {
> dbname=dovecot
> user=dovecot
> password=THEPASSWORD
> }
> }
>
> passdb sql {
> default_password_scheme = SHA256
>
> query = \
> SELECT username AS user, domain, password
> FROM users WHERE (username = '%{user|username}' AND domain =
> '%{user|domain}')
> }
>
>
>> userdb static {
>> driver = static
>> args = uid=vmail gid=vmail home=/var/mail/vhosts/%d/%n
>> }
>>
>> The error I get in Step 4 – before commenting it out – is an error on
>> the line that begins “args =” in the sample code listed with that step.
>>
>> My sense is that a big part of my struggle [other than ignorance] is
>> the slight deviation in package layout between my Pi setup and the
>> worked examples.
>>
>
> Nope, it's the 2.3 vs 2.4 config layout. Both the format of the dict
> and the formatting used to interpolate strings changed ( '%u' is now
> '%{user|username}', for example):
>
> userdb static {
> fields {
> uid=vmail
> gid=vmail
> home=/var/mail/vhosts/%{user|domain}/%{user|username}
> }
> }
>
>
>> I have looked at e.g. mail-in-a-box, Citadel, and others and I’m not
>> opposed to using a different software stack if someone can make a
>> good recommendation… this is just where I’ve got to so far.
>>
>> Any recommendations for a workable how-to guide for an Intranet Pi
>> running a local mail solution would be gratefully received.
>>
>> Thanks in advance.
>>
>>
>>
>
> Hope this helps!
>
> Cheers
> Brad
>
--
Please post to: Hampshire@???
Manage subscription:
https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG website:
http://www.hantslug.org.uk
--------------------------------------------------------------