---
name: "lei-import"
section: "1"
platform: "linux"
package: "lei"
version: "2.1.0-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/lei-import"
---

# lei-import(1)

one-time import of messages into local store

## NAME

lei-import - one-time import of messages into local store

## SYNOPSIS

lei import \[OPTIONS\] LOCATION \[LOCATION...\] \[+L:LABEL\]

lei import \[OPTIONS\] (--stdin\|-)

## DESCRIPTION

Import messages into the local storage of [**lei**(1)](/lei/1.md) (aka lei/store).  `"LOCATION"` is a source of messages: a directory (Maildir), a file, or a URL (`"imap://"`, `"imaps://"`, `"nntp://"`, or `"nntps://"`).  URLs requiring authentication use [**git-credential**(1)](/git-credential/1.md) to fill in the username and password.

For a regular file, the `"LOCATION"` must have a `"<format>:"` prefix specifying one of the following formats: `"mboxrd"`, `"mboxcl2"`, `"mboxcl"`, or `"mboxo"`.

## OPTIONS

- \-F MAIL\_FORMAT

  - \--in-format=MAIL\_FORMAT

  Message input format.  Unless messages are given on stdin, using a format prefix with `"LOCATION"` is preferred.

- \--stdin

  Read messages from stdin.

- \--lock

  [**mbox**(5)](/mbox/5.md) locking method(s) to use: `"dotlock"`, `"fcntl"`, `"flock"` or `"none"`.

  Default: fcntl,dotlock

- \+L:LABEL

  Add the given `"LABEL"` to all messages imported, where `"LABEL"` is an arbitrary user-defined value consisting of lowercase and digits. See [**lei-tag**(1)](/lei-tag/1.md) for more info on labels.

  For example, specifying `"+L:inbox"` applies the `"inbox"` label to all messages being imported.

  May be specified multiple times to apply multiple labels.

  Default: none

- \+kw:KEYWORD

  Apply `"KEYWORD"` to all messages being imported in addition to any per-message keywords from the store (unless `"--no-kw"` is specified).  See [**lei-tag**(1)](/lei-tag/1.md) for more info on keywords.

  May be specified multiple times to apply multiple keywords.

  Default: none

- \--no-kw

  Don't import message keywords (or "flags" in IMAP terminology).

- \--no-incremental

  Import already seen IMAP and NNTP articles.

- \--torsocks=auto\|no\|yes

  - \--no-torsocks

  Whether to wrap [**git**(1)](/git/1.md) and [**curl**(1)](/curl/1.md) commands with [**torsocks**(1)](/torsocks/1.md).

  Default: `"auto"`

- \--proxy=PROTOCOL://HOST\[:PORT\]

  Use the specified proxy (e.g., `"socks5h://0:9050"`).

  Consider imap.proxy and nntp.proxy which can be persistently configured on a per-host basis in [**lei-config**(1)](/lei-config/1.md).

- \--noisy

  Warn on misformatted email headers.  Not particularly useful but this was the default prior to public-inbox 2.0.0.  New in public-inbox 2.0.0.

See [**lei-config**(1)](/lei-config/1.md) for various `"imap.*"` and `"nntp.*"` options.

## CONTACT

Feedback welcome via plain-text mail to \<mailto:meta@public-inbox.org\>

The mail archives are hosted at \<https://public-inbox.org/meta/\> and \<http://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/meta/\>

## COPYRIGHT

Copyright all contributors \<mailto:meta@public-inbox.org\>

License: AGPL-3.0+ \<https://www.gnu.org/licenses/agpl-3.0.txt\>

## SEE ALSO

[**lei-config**(1)](/lei-config/1.md), [**lei-index**(1)](/lei-index/1.md), [**lei-store-format**(5)](/lei-store-format/5.md)
