1

I have added entry to the sudoers to allow execute a script without typing

jdoe ALL=(ALL) NOPASSWD: /usr/bin/doveadm

but when user jdoe is trying to execute

/usr/bin/doveadm acl get -u jdoe@testdomain.com INBOX

it throws an error:

doveadm(jdoe@testdomain.com): Error: user jdoe@testdomain.com: Auth USER lookup failed
doveadm(jdoe@testdomain.com): Fatal: User lookup failed: Internal error occurred. Refer to server log for more information.

when above request is executed with sudo

sudo /usr/bin/doveadm acl get -u jdoe@testdomain.com INBOX

it work fine.

Any clue what is going on?

3

You need to run the command /usr/bin/doveadm via sudo e.g.

sudo /usr/bin/doveadm acl get -u jdoe@testdomain.com INBOX

The entry in sudoers only tells sudo that the user jdoe is allowed to run the /usr/bin/doveadm command without requiring a password.

  • Does adding a setuid flag chmod 4755 /usr/bin/doveadm will solve that? – JackTheKnife Nov 2 '16 at 15:45
  • 2
    This enables all users to execute dovecot management operations, I would rather not do that. If all you want to do is running multiple commands in sequence without the need of prefixing sudo all the time, consider switching to the dovecot user (sudo -su dovecot or su - dovecot). – Jens Erat Nov 2 '16 at 17:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.