Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error creating mailbox #307

Open
winne27 opened this issue May 2, 2023 · 4 comments
Open

error creating mailbox #307

winne27 opened this issue May 2, 2023 · 4 comments

Comments

@winne27
Copy link

winne27 commented May 2, 2023

the following error is raised by creating a mailbox with ViMbAdmin

`ViMbAdmin_Exception

File
/opt/ViMbAdmin/library/ViMbAdmin/Dovecot.php
Line
57
Message
Error executing Dovecot password command: /usr/bin/doveadm pw -s 'BLF-CRYPT' -u 'username' -p 'pw'
Code
0
`

Environment:
ubuntu 22.04
PHP 8.2
dovecot 2.3.16

/usr/bin/doveadm is executable for all

on cli the command is executed succesfull.

@winne27
Copy link
Author

winne27 commented May 2, 2023

the problem is that www-data cannot read the letsencrypt certificates in /etc/archive/domain/. Read access for fullchain.pem and privatkey.pem is neccessary for executing doveadm. But the dir archive is only readable by root and privatekey.pem also.

A workarround is to give read access to this directories and files, to all, at least temporarily. This works for me.

I tried some solutions with sudo, but it did not work work.

@PhrozenByte
Copy link
Contributor

Switch to defaults.mailbox.password_scheme = "crypt:sha512" (or any other crypt: scheme) and configure a Dovecot SQL query like the following:

SELECT username AS user,
    CASE
        WHEN password LIKE '{%}%'
            THEN password
        WHEN password LIKE '$1$%'
            THEN CONCAT('{MD5}', password)
        WHEN password LIKE '$2a$%'
            THEN CONCAT('{BLF-CRYPT}', password)
        WHEN password LIKE '$5$%'
            THEN CONCAT('{SHA256-CRYPT}', password)
        WHEN password LIKE '$6$%'
            THEN CONCAT('{SHA512-CRYPT}', password)
        ELSE
            password
    END AS password,
    homedir AS userdb_home,
    maildir AS userdb_mail,
    CONCAT('*:bytes=', quota) AS userdb_quota_rule,
    uid AS userdb_uid,
    gid AS userdb_gid
FROM mailbox
WHERE username = '%Lu'
    AND ( access_restriction = 'ALL' OR LOCATE('%Us', access_restriction) > 0 )

@winne27
Copy link
Author

winne27 commented May 3, 2023 via email

@winne27
Copy link
Author

winne27 commented May 3, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants