Re: doveadm expunge silently ignores multiple -u flags instead of erroring or processing all users

Michael Slusarz via dovecot <[email protected]> Tue, 21 Apr 2026 11:05:27 -0600 (MDT)
Newsgroups gmane.mail.imap.dovecot
Message-ID <[email protected]>
> On 04/16/2026 3:20 AM MDT Robert Kretowicz via dovecot <[email protected]> wrote:
>
> I would like to report what I believe is a bug in doveadm expunge 
> argument handling.
> Summary
> When multiple -u flags are passed to doveadm expunge, for example:
> doveadm expunge -u user1 -u user2 -u user3 mailbox '*' BEFORE 2015-01-01
> the command exits with code 0 (success) but only processes one of the 
> specified users. The remaining users are silently skipped with no 
> warning or error message produced.
> Why this is a bug
> This is a silent failure on a destructive, irreversible operation. An 
> administrator has no indication that most users were not processed. Good 
> CLI tools should either:
> 
> Accept multiple -u flags and process all specified users (consistent 
> with how -F file works), or
> Reject the command immediately with a clear error such as: Error: -u 
> flag specified multiple times. Use -F <file> for multiple users.

Agreed. Have proposed code changes to error out on seeing multiple user inputs for commands that only run on a single user.

michael

_______________________________________________
dovecot mailing list -- [email protected]
To unsubscribe send an email to [email protected]