Hi Bill,

2025.December 1.(H) 23:56 időpontban Bill Steinberg via dovecot ezt írta:
>    Hello again,
>    I didn't fully read the section in the documentation about using the
> mbox
>    format. There is a setting, mail_inbox_path = /var/mail/%{user} to
> specify
>    the iNBOX location for mails that are stored in /var/mail.
>    After setting mail_inbox_path I did initially have an issue about
> dovecot
>    being able to write dotlock files, which was noted in the
> documentation. I
>    was able to fix by adding users to the group "mail".
>    I am using these settings in the new server now:
>
>    mail_driver = mbox
>
>    mail_path = ~/mail
>
>    mail_inbox_path = /var/mail/%{user}
>
>    mail_index_path = ~/mail/index
>
>    mail_control_path = ~/mail/control

I'm struggling with the same setup as yourself. Sendmail delivers mails
under /var/spool/mail/username and mail user agents were fetching the
incoming mail from there and put them under /home/username/mail. This has
been fine for ages - I have to say decades now.
While 2.3 created files/directories in the name of the current user under
~/mail, 2.4 tries to write as mail:mail and therefore gets denied, since
the user directories are owned by username:users and obviously have no
permissions for other users.
This change of behaviour is unacceptable in my opinion and 2.4 should also
act in the name of the actual user. If some of the files would be owned by
mail:mail and others by username:users: that would be a mess and the user
would not be able to read contents using other user agents (for e.g.
alpine) or make a backup of their own emails using an arbitrary tool or
script of their own.

For this reason I downgraded back to 2.3, because I have no time to dig
deeper into this and reintroduce the mechanism granting current user
access rights - running certain processes under proper conditions.

Bill: how do you achieve that dovecot creates and writes files in users
home directories in the name of the current user?

Back in the good old 2.3 days I had this in the config and everything just
worked as expected:
mail_location = mbox:~/mail/:INBOX=/var/spool/mail/%u

In case of the new 2.4 version I was unsuccessful with the following:
mail_driver = mbox
mail_path = /home/%{user}/mail
mail_inbox_path = /var/spool/mail/%{user}

server dovecot: imap(user)<48978><1LgipBQ3LO1/AAAB>: Error:
mkdir(/home/user/mail/.imap) failed: Permission denied (euid=8(mail)
egid=12(mail) missing +x perm: /home/user/mail, dir owned by 1000:100
mode=0700)

Although I haven't specified mail_index_path and mail_control_path as you,
I wouldn't expect this to make any difference regarding user rights.

I'm aware, that mbox is deprecated, but still: this is a regression from
my point of view.

So how about user rights in your case Bill?

Thanks:
Dwokfur

>
>      On Dec 1, 2025, at 10:18AM, Bill Steinberg via dovecot
>      <[email protected]> wrote:
>        Hello,
>        I'm attempting to upgrade a mbox format based dovecot server to the
>      latest
>        2.4.1 on Fedora release 43. I am using sendmail at the MTA. I
have provided a synopsis of my 2.4.1 dovecot config below. The
dovecot
>      server
>        I'm attempting to upgrade is running dovecot 2.3.21 on Fedora 37.
In the 2.3.21 setup all mbox based folders are at the top level
in
> the
>        user's ~/mail location  For example Sent, Trash, Drafts, ... In
dovecot 2.4.1 this setting no longer works:  "mail_location =
mbox:~/mail:INBOX=/var/mail/%u",so when a client connects to the
>      dovecot
>        server their sendmail based mbox /var/mail isn't visible.
Additionally mbox folders directly under a user's ~/mail iike
Sent,
>      Trash,
>        Drafts are not visible either.
>        The new 2.4.1 dovecot server creates a folder named "inbox" under
>      ~/mail
>        as well as an .imap directory which contains directories that
> appear
>      to
>        correspond to the folders at the top level along with other dovecot
>      based
>        files.
>        Can you describe how I would make the seamail delivered mail in
>      /var/spool
>        as well as a users top level mbox folders accessible in the new
>      dovecot
>        mbox structures?
>        Thanks in advance for any help,
>        -Bill
>        ======================================
>        Dovecot config
>        ======================================
>
>        dovecot_config_version = 2.4.1
>
>        dovecot_storage_version = 2.4.1
>
>        protocols {
>
>          imap = yes
>
>          lmtp = yes
>
>        }
>
>        mail_driver = mbox
>
>        mail_home = /home/%{user}
>
>        mail_path = ~/mail
>
>        mbox_write_locks = fcntl
>
>        namespace inbox {
>
>          inbox = yes
>
>          separator = /
>
>        }
>      _______________________________________________
>      dovecot mailing list -- [email protected]
>      To unsubscribe send an email to [email protected]
> _______________________________________________
> dovecot mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
>




_______________________________________________
dovecot mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to