Importing messages

Existing bulk messages can be ingested (imported) using mailpit ingest <file|folder>. By default, this will read the message(s) on disk and send them via SMTP to localhost:1025; however, you can specify a different host/port using the --smtp-addr flag.

Ingested messages must be individual email files and not in mbox format (i.e., not all messages in one file).

This can be useful for transferring an entire mailbox of messages directly into Mailpit and can be combined with --recent <x> to only consider messages modified within the last x days. If you are regularly “syncing” a folder to Mailpit, then this, combined with Mailpit’s --ignore-duplicate-ids flag, will prevent any duplicate messages from being added.

Edit this page