Import creates mailbox records with an empty username, and they cannot be deleted

Author: zhihuz123Created Sep 14, 2026Updated Sep 14, 2026
Labelsbug

Operating System

Linux

OS Version

CentOS Linux 8

System Architecture

ARM64

Docker Version

Docker version 27.3.1, build ce12230

Docker Compose Version

Docker Compose version v2.27.0

Reproducible in Latest Version?

Yes, occurs in the latest stable release

Reproduction Steps

  1. Deploy BillionMail (core 4.7.2) and log in.
  2. Open Mailboxes and click Import.
  3. Upload a CSV with a username column whose cell is empty:
csv
username,password
,secret123
  1. The import is reported as successful. The list now contains a record with an empty Username (local_part='', domain='', maildir='@/', quota=1000).
  2. Click Delete on that row.

The same happens when the header has no username column at all — for example email,password with two data rows — which collapses every row onto the same empty identity.

Observed Behavior

Deleting the record always fails:

http
POST /api/mailbox/delete  {"emails":[""]}
→ {"success":false,"code":500,"msg":"No valid email addresses provided"}
  • The mailbox row count is unchanged before and after the request, and the delete never reaches the database.
  • The record stays in the list; retrying returns the same error.
  • The import that created it reported success, so nothing warns the operator. Rows that InsertIgnore silently discarded are counted as imported as well.
  • Batch delete does not remove it either: the empty identifier is dropped from the request, the other selected rows are deleted, and the response still reports the batch as successful.

Expected Behavior

The record is deleted. username is the primary key of mailbox and PostgreSQL accepts an empty string as a key value, so an empty identifier is a legal — if unwanted — input that a delete must be able to address. A row that exists must be removable from the UI.

Supplemental Information

ImageImage