0

I have an SMTP server:

  • Dovecot as its IMAP server
  • Postfix as its MTA
  • OpenDKIM to sign the emails.

When I send mail it throws this error:

Jan 01 10:46:01 example.com dovecot[211047]: lmtp(219823): Error: lmtp-server: conn unix:pid=219911,uid=113 [10]: rcpt opendkim@example.com: Failed to initialize user: Mail access for users with UID 114 not permitted (see first_valid_uid in config file, uid from userdb lookup).

I should note that I can connect to my server to read emails, but cannot send. This relates to a previous question: Postfix doesn't send mail; example.com loops back to myself & Connection timed out

Esa Jokinen
  • 52,963
  • 3
  • 95
  • 151

1 Answers1

2

You need to work on your diagnostic skills as the error message directly points to the related configuration and tells what might be wrong with it.

  • dovecot[211047]

    This part tells that the log message is from the dovecot process; there is probably something wrong with Dovecot's configuration.

  • Mail access for users with UID 114 not permitted

    For some reason, user with UID 114 is not allowed to login to Dovecot. That is a system user: you can use command id 114 to show which user it is to decide whether it should be able to login to Dovecot or not.

  • (see first_valid_uid in config file, uid from userdb lookup)

    Here it tells what to look for. The related System users used by Dovecot configuration says:

    By default Dovecot allows users to log in only with UID numbers 500 and above. This check tries to make sure that no-one can ever log in as daemons or other system users. If you’re using an UID lower than 500, you’ll need to change the first_valid_uid setting.

    On a fresh installation of dovecot-imapd on Ubuntu 22.04:

    $ doveconf -a | grep "first_valid_uid"
    first_valid_uid = 500
    

    As a default setting it is commented out in configuration files:

    $ grep "first_valid_uid" /etc/dovecot/conf.d/*.conf
    /etc/dovecot/conf.d/10-mail.conf:# be done even if first_valid_uid is set to 0.
    /etc/dovecot/conf.d/10-mail.conf:#first_valid_uid = 500
    

    Edit /etc/dovecot/conf.d/10-mail.conf by uncommenting the line add set is as required, e.g.,

    first_valid_uid = 114
    

    Keep in mind that this allows all system users with UID 114 and above to login to Dovecot. User Databases could be used for more fine-graded configuration.

Esa Jokinen
  • 52,963
  • 3
  • 95
  • 151