RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1280436 - Setting first_valid_gid/last_valid_gid leads to (wrong) error messages
Summary: Setting first_valid_gid/last_valid_gid leads to (wrong) error messages
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: dovecot
Version: 7.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Michal Hlavinka
QA Contact: Frantisek Sumsal
URL:
Whiteboard:
Depends On:
Blocks: 1298243 1393870 1400961
TreeView+ depends on / blocked
 
Reported: 2015-11-11 17:54 UTC by Robert Scheck
Modified: 2020-09-10 09:28 UTC (History)
4 users (show)

Fixed In Version: dovecot-2.2.10-8.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 21:44:24 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:2187 0 normal SHIPPED_LIVE dovecot bug fix update 2017-08-01 18:41:44 UTC

Description Robert Scheck 2015-11-11 17:54:58 UTC
Description of problem:
Setting first_valid_gid/last_valid_gid leads to (wrong) error messages: In
/etc/dovecot/conf.d/10-mail.conf you can configure first_valid_gid = 100 and
last_valid_gid = 100 (while leaving the rest on default values). This assumes
that your e-mail users are in group users and other users in !users groups.
This works more or less but throws error messages which are right by content
but wrong that they are created:

$ doveadm purge -A
doveadm(polkitd): Error: user polkitd: Mail access for users with GID 997 not permitted (see first_valid_gid in config file, gid from userdb lookup).
doveadm(polkitd): Error: User init failed
doveadm(dovenull): Error: user dovenull: Mail access for users with GID 996 not permitted (see first_valid_gid in config file, gid from userdb lookup).
doveadm(dovenull): Error: User init failed
doveadm(unbound): Error: user unbound: Mail access for users with GID 995 not permitted (see first_valid_gid in config file, gid from userdb lookup).
doveadm(unbound): Error: User init failed
doveadm(saslauth): Error: user saslauth: Mail access for users with GID 76 not permitted (see first_valid_gid in config file, gid from userdb lookup).
doveadm(saslauth): Error: User init failed
doveadm(nfsnobody): Error: user nfsnobody: Mail access for users with GID 65534 not permitted (see first_valid_gid in config file, gid from userdb lookup).
doveadm(nfsnobody): Error: User init failed
$ 

I agree with Dovecot that mail access isn't allowed for these users, but the
users are also not used for e-mail but they are excluded via first_valid_gid/
last_valid_gid. So "doveadm purge -A" should not complain, but ignore these
users (based on their GID).

Version-Release number of selected component (if applicable):
dovecot-2.2.10-4.el7_0.1.x86_64

How reproducible:
Everytime, see above and below.

Actual results:
Setting first_valid_gid/last_valid_gid leads to (wrong) error messages.

Expected results:
No complains by "doveadm purge -A" if the GID is excluded (because Dovecot
decides what -A contains, thus Dovecot should not complain about its own
selection of applicable users).

Additional info:
This is not a duplicate of bug #1280433, these are two different issues.

Comment 1 Robert Scheck 2015-11-11 18:01:02 UTC
Note, the userdb is passwd - I am not aware that there already a restriction
would be possible.

Comment 3 Robert Scheck 2015-11-11 18:10:24 UTC
Cross-filed case 01538033 on the Red Hat customer portal.

Comment 4 Michal Hlavinka 2016-06-20 15:23:01 UTC
could you post your configuration? Output of: doveconf -n 
based on this http://hg.dovecot.org/dovecot-2.1/rev/85a8d582d37f
it should already work

Comment 5 Robert Scheck 2016-06-20 15:36:01 UTC
auth_mechanisms = plain login
auth_verbose = yes
first_valid_gid = 100
first_valid_uid = 1000
hostname = mail.example.net
imap_client_workarounds = delay-newmail
last_valid_gid = 100
mail_location = mdbox:/home/%u/Mail
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave
mbox_write_locks = fcntl
mdbox_rotate_interval = 1 weeks
mdbox_rotate_size = 10 M
namespace inbox {
  inbox = yes
  location = 
  mailbox Drafts {
    special_use = \Drafts
  }
  mailbox Junk {
    special_use = \Junk
  }
  mailbox Sent {
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
  mailbox Trash {
    special_use = \Trash
  }
  prefix = 
}
passdb {
  driver = pam
}
plugin {
  sieve = ~/.dovecot.sieve
  sieve_dir = ~/sieve
}
postmaster_address = postmaster
protocols = imap lmtp sieve
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0666
    user = postfix
  }
  unix_listener auth-userdb {
    group = root
    mode = 0666
    user = root
  }
}
service imap-login {
  inet_listener imap {
    port = 143
  }
}
service managesieve-login {
  inet_listener sieve {
    port = 4190
  }
}
ssl = required
ssl_cert = </etc/pki/tls/certs/mail.example.net.pem
ssl_cipher_list = ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA
ssl_key = </etc/pki/tls/private/mail.example.net.pem
ssl_prefer_server_ciphers = yes
ssl_protocols = !SSLv2 !SSLv3
userdb {
  driver = passwd
}
protocol lda {
  mail_plugins = " sieve"
}
protocol imap {
  mail_max_userip_connections = 10
}
protocol sieve {
  managesieve_logout_format = bytes=%i/%o
}

Comment 6 Michal Hlavinka 2016-06-29 11:14:01 UTC
I have prepared a patch for this. I've send it upstream, waiting for their feedback.

Comment 13 errata-xmlrpc 2017-08-01 21:44:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2187


Note You need to log in before you can comment on or make changes to this bug.