Bug 1212035

Summary: "Group 'mail' not found" error when adding new user via useradd
Product: [openSUSE] openSUSE Distribution Reporter: Archie Cobbs <archie.cobbs>
Component: BasesystemAssignee: Michael Vetter <mvetter>
Status: NEW --- QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: amajer
Version: Leap 15.4   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Archie Cobbs 2023-06-05 16:13:34 UTC
On a newly created Leap 15.4 system:

  $ useradd -p '*' -g users -M foobar
  Group 'mail' not found. Creating the user mailbox file with 0600 mode.

Note the error emitted.

Diagnosis: If useradd is going to try to add users to group 'mail' then it should require the RPM that provides group 'mail.

Related issue: https://bugzilla.opensuse.org/show_bug.cgi?id=1191624
Comment 1 Adam Majer 2023-08-03 09:56:56 UTC
This sounds more like a warning than an error. The mailbox is still accessible locally to the user so things like fetchmail will work. Systemwide mail delivery daemons will not be able to deliver things, but then they are probably not installed since the group is missing.
Comment 2 Archie Cobbs 2023-08-03 15:33:44 UTC
> Systemwide mail delivery daemons will not be able to deliver things, but then they are probably not installed since the group is missing.

This is not a counter-argument: if you install group 'mail' later, the problem does not automatically fix itself.

This is a simple problem with a simple fix: There should be a 'system-group-mail' RPM similar to the others (system-group-audit, system-group-hardware, system-group-kvm, system-group-libvirt, system-group-ne, system-group-wheel) that installs group 'mail' and the shadow RPM (which provides useradd) should require it.

Or for a quicker solution, simply add this to the shadow RPM:

  %pre

  getent group mail >/dev/null || /usr/sbin/groupadd -r mail