{"id":21094453,"url":"https://github.com/d99kris/nmail","last_synced_at":"2026-02-21T09:06:05.881Z","repository":{"id":37445189,"uuid":"184770500","full_name":"d99kris/nmail","owner":"d99kris","description":"Terminal-based email client for Linux and macOS","archived":false,"fork":false,"pushed_at":"2026-01-17T13:48:30.000Z","size":4314,"stargazers_count":234,"open_issues_count":0,"forks_count":17,"subscribers_count":12,"default_branch":"master","last_synced_at":"2026-01-18T00:12:55.122Z","etag":null,"topics":["console","email","email-client","imap","linux","macos","ncurses","smtp","terminal-based","tui"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/d99kris.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-05-03T14:35:19.000Z","updated_at":"2026-01-17T13:48:34.000Z","dependencies_parsed_at":"2023-10-15T09:41:32.866Z","dependency_job_id":"f700fc00-8a6d-4077-be40-8ec28813d8bd","html_url":"https://github.com/d99kris/nmail","commit_stats":null,"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"purl":"pkg:github/d99kris/nmail","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d99kris%2Fnmail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d99kris%2Fnmail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d99kris%2Fnmail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d99kris%2Fnmail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d99kris","download_url":"https://codeload.github.com/d99kris/nmail/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d99kris%2Fnmail/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29677881,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T06:23:40.028Z","status":"ssl_error","status_checked_at":"2026-02-21T06:23:39.222Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["console","email","email-client","imap","linux","macos","ncurses","smtp","terminal-based","tui"],"created_at":"2024-11-19T22:17:33.555Z","updated_at":"2026-02-21T09:06:05.863Z","avatar_url":"https://github.com/d99kris.png","language":"C++","readme":"nmail\n=====\n\n| **Linux** | **Mac** |\n|-----------|---------|\n| [![Linux](https://github.com/d99kris/nmail/workflows/Linux/badge.svg)](https://github.com/d99kris/nmail/actions?query=workflow%3ALinux) | [![macOS](https://github.com/d99kris/nmail/workflows/macOS/badge.svg)](https://github.com/d99kris/nmail/actions?query=workflow%3AmacOS) |\n\nnmail is a terminal-based email client for Linux and macOS with a user interface\nsimilar to alpine / pine.\n\n![screenshot nmail](/doc/screenshot-nmail.png)\n\nFeatures\n--------\n- Support for IMAP and SMTP protocols\n- Local cache using sqlite (optionally AES256-encrypted)\n- Multi-threaded (email fetch and send done in background)\n- Address book auto-generated based on email messages\n- Viewing HTML emails (converted to text in terminal, or in external browser)\n- Opening/viewing attachments in external program\n- Simple setup wizard for Gmail, iCloud and Outlook/Hotmail\n- UI similar to Alpine / Pine\n- Compose message using external editor ($EDITOR)\n- View message using external viewer ($PAGER)\n- Saving and continuing draft messages\n- Compose HTML emails using Markdown (see `markdown_html_compose` option)\n- Email search\n- Compose emails while offline\n- Color customization\n- Signature\n\nNot Supported / Out of Scope\n----------------------------\n- Local mailbox downloaded by third-party application (OfflineIMAP, fdm, etc)\n- Multiple email accounts in a single session\n- Special handling for Gmail labels\n- Threaded view\n\n\nUsage\n=====\n\nUsage:\n\n    nmail [OPTION]\n\nCommand-line Options:\n\n    -c, --cache-encrypt\n        prompt for cache encryption during oauth2 setup\n\n    -d, --confdir \u003cDIR\u003e\n        use a different directory than ~/.config/nmail\n\n    -e, --verbose\n        enable verbose logging\n\n    -ee, --extra-verbose\n        enable extra verbose logging\n\n    -h, --help\n        display this help and exit\n\n    -k, --keydump\n        key code dump mode\n\n    -o, --offline\n        run in offline mode\n\n    -p, --pass\n        change password\n\n    -s, --setup \u003cSERV\u003e\n        setup wizard for specified service, supported services: gmail,\n        gmail-oauth2, icloud, outlook, outlook-oauth2\n\n    -v, --version\n        output version information and exit\n\n    -x, --export \u003cDIR\u003e\n        export cache to specified dir in Maildir format\n\nConfiguration files:\n\n    ~/.config/nmail/auth.conf\n        configures custom oauth2 client id and secret\n\n    ~/.config/nmail/key.conf\n        configures user interface key bindings\n\n    ~/.config/nmail/main.conf\n        configures mail account and general settings\n\n    ~/.config/nmail/ui.conf\n        customizes user interface settings\n\nExamples:\n\n    nmail -s gmail\n        setup nmail for a gmail account\n\n\nSupported Platforms\n===================\n\nnmail is developed and tested on Linux and macOS. Current version has been\ntested on:\n\n- macOS Sonoma 14.0\n- Ubuntu 22.04 LTS\n\nInstall using Package Manager\n=============================\n\nmacOS\n-----\n**Brew**\n\n    brew install nmail\n\n**MacPorts**\n\n    sudo port install nmail\n\nLinux\n-----\n**Arch**\n\nThere are two AUR packages available -\n[nmail](https://aur.archlinux.org/packages/nmail) (stable release) and\n[nmail-git](https://aur.archlinux.org/packages/nmail-git) (latest git).\n\n    git clone https://aur.archlinux.org/nmail.git \u0026\u0026 cd nmail\n    makepkg -srciA\n\n**Guix**\n\n    guix install nmail\n\nBuild from Source\n=================\n**Get Source**\n\n    git clone https://github.com/d99kris/nmail \u0026\u0026 cd nmail\n\nUsing make.sh script\n--------------------\nIf using macOS, Alpine, Arch, Fedora, Gentoo, Raspbian or Ubuntu, one can use\nthe `make.sh` script provided.\n\n**Dependencies**\n\n    ./make.sh deps\n\n**Build / Install**\n\n    ./make.sh build \u0026\u0026 ./make.sh install\n\nManually\n--------\n**Dependencies**\n\nmacOS\n\n    brew install openssl ncurses xapian sqlite libmagic ossp-uuid\n\nArch\n\n    sudo pacman -Sy cmake make openssl ncurses xapian-core sqlite cyrus-sasl curl expat zlib file\n\nDebian-based (Ubuntu, Raspbian, etc)\n\n    sudo apt install git cmake build-essential libssl-dev libreadline-dev libncurses5-dev libxapian-dev libsqlite3-dev libsasl2-dev libsasl2-modules libcurl4-openssl-dev libexpat-dev zlib1g-dev libmagic-dev uuid-dev\n\nFedora\n\n    sudo yum -y install cmake openssl-devel ncurses-devel xapian-core-devel sqlite-devel cyrus-sasl-devel cyrus-sasl-plain libcurl-devel expat-devel zlib-devel file-devel libuuid-devel clang\n\nGentoo\n\n    sudo emerge -n dev-util/cmake dev-libs/openssl sys-libs/ncurses dev-libs/xapian dev-db/sqlite dev-libs/cyrus-sasl net-misc/curl dev-libs/expat sys-libs/zlib sys-apps/file\n\n**Build**\n\n    mkdir -p build \u0026\u0026 cd build \u0026\u0026 cmake .. \u0026\u0026 make -s\n\n**Install**\n\n    sudo make install\n\nOptional Run-time Dependencies\n------------------------------\nExternal programs will be utilized by default if installed on the system, in\nparticular for handling HTML-formatted emails. For best user experience the\nfollowing packages are recommended to be installed.\n\nmacOS\n\n    brew install pandoc w3m poppler lesspipe\n\nDebian-based (Ubuntu, Raspbian, etc)\n\n    sudo apt install pandoc w3m poppler-utils less\n\nGetting Started\n===============\n\nGmail Password Authenticated Setup\n----------------------------------\nUse the setup wizard to set up nmail for the account. Example (replace\nexample@gmail.com with your actual gmail address):\n\n    $ nmail -s gmail\n    Email: example@gmail.com\n    Name: Firstname Lastname\n    Password:\n    Save password (y/n): y\n\nNote: Refer to [Gmail Prerequisites](#gmail-prerequisites) for enabling\nIMAP access and password authentication.\n\nGmail OAuth 2.0 Setup\n---------------------\nUse the setup wizard to set up nmail for the account. Example:\n\n    $ nmail -s gmail-oauth2\n\nNote: Refer to [Gmail Prerequisites](#gmail-prerequisites) for enabling\nIMAP access and obtaining OAuth 2.0 access.\n\nOutlook (and Hotmail) Setup\n---------------------------\nUse the setup wizard to set up nmail for the account. Example (replace\nexample@hotmail.com with your actual outlook / hotmail address):\n\n    $ nmail -s outlook\n    Email: example@hotmail.com\n    Name: Firstname Lastname\n    Password:\n    Save password (y/n): y\n\nOutlook OAuth 2.0 Setup\n-----------------------\nUse the setup wizard to set up nmail for the account. Example:\n\n    $ nmail -s outlook-oauth2\n\nOther Email Providers\n---------------------\nRun nmail once in order for it to automatically generate the default config\nfile:\n\n    $ nmail\n\nThen open the config file `~/.config/nmail/main.conf` in your favourite text\neditor and fill out the required fields:\n\n    address=example@example.com\n    drafts=Drafts\n    imap_host=imap.example.com\n    imap_port=993\n    inbox=Inbox\n    name=Firstname Lastname\n    sent=Sent\n    smtp_host=smtp.example.com\n    smtp_port=587\n    trash=Trash\n    user=example@example.com\n\nFull example of a config file `~/.config/nmail/main.conf`:\n\n    address=example@example.com\n    addressbook_encrypt=0\n    auth=pass\n    auth_encrypt=1\n    cache_encrypt=0\n    cache_index_encrypt=0\n    client_store_sent=0\n    copy_to_trash=\n    coredump_enabled=0\n    downloads_dir=\n    drafts=Drafts\n    editor_cmd=\n    file_picker_cmd=\n    folders_exclude=\n    html_preview_cmd=\n    html_to_text_cmd=\n    html_viewer_cmd=\n    idle_inbox=1\n    idle_timeout=29\n    imap_host=imap.example.com\n    imap_port=993\n    inbox=Inbox\n    logdump_enabled=0\n    msg_viewer_cmd=\n    name=Firstname Lastname\n    network_timeout=30\n    pager_cmd=\n    parts_viewer_cmd=\n    prefetch_all_headers=1\n    prefetch_level=2\n    queue_encrypt=1\n    save_pass=1\n    send_ip=1\n    sent=Sent\n    server_timestamps=0\n    smtp_host=smtp.example.com\n    smtp_port=587\n    smtp_user=\n    sni_enabled=1\n    text_to_html_cmd=\n    trash=Trash\n    user=example@example.com\n    verbose_logging=0\n\n### address\n\nThe from-address to use. Required for sending emails.\n\n### addressbook_encrypt\n\nIndicates whether nmail shall encrypt local address book cache or not. Enabling\nit has some performance impact when starting and exiting nmail (default\ndisabled).\n\n### auth\n\nSpecifies whether nmail shall use password authentication (`pass`) or Gmail\nOAuth 2.0 authentication (`gmail-oauth2`).\n\n### auth_encrypt\n\nIndicates whether nmail shall encrypt local OAuth 2.0 access token store\n(default enabled).\n\n### cache_encrypt\n\nIndicates whether nmail shall encrypt local message cache or not. Enabling\nit has some performance impact when starting and exiting nmail, as well as\nwhen navigating to different folders (default disabled).\n\n### cache_index_encrypt\n\nIndicates whether nmail shall encrypt local search index or not. Enabling\nit has some performance impact when starting and exiting nmail (default\ndisabled).\n\n### client_store_sent\n\nThis field should generally be left `0`. It indicates whether nmail shall upload\nsent emails to configured `sent` folder. Many email service providers\n(gmail, outlook, etc) do this on server side, so this should only be enabled if\nemails sent using nmail do not automatically gets stored in the sent folder.\n\n### copy_to_trash\n\nSpecifies whether to delete messages by copying them to trash and then deleting\nfrom current folder, instead of using the IMAP move command. This is disabled\nby default, except for GMail IMAP where it is enabled to work around a\nserver-side issue, for details see\n[Issue #172](https://github.com/d99kris/nmail/issues/172).\n\n### coredump_enabled\n\nSpecifies whether to enable core dumps on application crash.\n\n### downloads_dir\n\nSpecifies a custom downloads directory path to save attachments to, for example\n`downloads_dir=~/Downloads`. If not specified, the current working dir is used.\n\n### drafts\n\nName of drafts folder - needed if using functionality to postpone email editing.\n\n### editor_cmd\n\nThe field `editor_cmd` allows overriding which external editor to use when\ncomposing / editing an email using an external editor (`Ctrl-E`). If not\nspecified, nmail will use the editor specified by the environment variable\n`$EDITOR`. If `$EDITOR` is not set, nmail will use `nano`.\n\n### file_picker_cmd\n\nBy default when using `Ctrl-T` to select attachment files, the nmail internal\nfile picker is used. By specifying this parameter an external command may be\nused instead. The command must output selected file(s) separated by line breaks,\non stdout. Examples:\n\nnnn: `file_picker_cmd=TMP=$(mktemp); 2\u003e\u00261 nnn -p ${TMP}; (cat ${TMP} | tr '\\0' '\\n' | uniq; rm ${TMP})`\n\nranger: `file_picker_cmd=TMP=$(mktemp); 2\u003e\u00261 ranger --choosefiles=${TMP}; (cat ${TMP}; rm ${TMP})`\n\n### folders_exclude\n\nThis field allows excluding certain folders from being accessible in nmail\nand also from being indexed by the search engine. This is mainly useful for\nemail service providers with \"virtual\" folders that are holding copies of\nemails in other folders. When using the setup-wizard to configure a Gmail\naccount, this field will be configured to\n`\"[Gmail]/All Mail\",\"[Gmail]/Important\",\"[Gmail]/Starred\"`. As an alternative\nto configuring this parameter for Gmail, folders can be excluded from IMAP\naccess on server side. In Gmail web interface, navigate to \"Settings\",\n\"See all settings\", \"Labels\" and untick \"Show in IMAP\" for \"Starred\",\n\"Important\" and \"All Mail\".\n\n### html_preview_cmd\n\nThis field allows overriding the external viewer used when previewing\nmessages composed using markdown. The viewer may be a terminal-based\nprogram, e.g. `w3m -o confirm_qq=false`. By default nmail uses `open`\non macOS and `xdg-open \u003e/dev/null 2\u003e\u00261` on Linux.\n\n### html_to_text_cmd\n\nThis field allows customizing how nmail should convert HTML emails to text.\nIf not specified, nmail uses a helper script `html2nmail` which in turn uses\n`pandoc` (for html without tables), `w3m`, `lynx` or `elinks` if available\non the system (in that order). The exact command used is one of:\n- `pandoc -f html -t plain+literate_haskell --wrap=preserve`\n- `w3m -T text/html -I utf-8 -dump`\n- `lynx -assume_charset=utf-8 -display_charset=utf-8 -nomargins -dump`\n- `elinks -dump-charset utf-8 -dump`\n\nNote that while pandoc generally produces a better text-equivalent to an\nhtml email, it is also slower than the other tools. For usage on a lower\nspec'ed system, consider using any of the other conversion utilities instead.\n\n### html_viewer_cmd\n\nThis field allows overriding the external viewer used when viewing message\nhtml using `V`. If not specified, nmail checks if `w3m`, `lynx`, `elinks`\nis available on the system (in that order), with fallback to\n`xdg-open` (Linux) and `open` (macOS). The exact default commands used:\n- `LESSOPEN=\"|$(which lesspipe.sh lesspipe | head -1) %s\" w3m -o confirm_qq=0 -o use_mouse=0 -o use_lessopen=1`\n- `lynx`\n- `elinks`\n- `xdg-open \u003e/dev/null 2\u003e\u00261` or `open`\n\n### idle_inbox\n\nThis parameter controls whether imap idle should watch the inbox for new\nmessages (default enabled) or the currently selected imap folder.\n\n### idle_timeout\n\nThis parameter controls the imap idle timeout in minutes (default 29). This\nshould generally not be changed, refer to RFC 2177 for details.\n\n### imap_host\n\nIMAP hostname / address. Required for fetching emails.\n\n### imap_port\n\nIMAP port. Required for fetching emails.\n\n### inbox\n\nIMAP inbox folder name. Required for nmail to open the proper default folder.\n\n### logdump_enabled\n\nSpecifies whether to dump warning and error log messages to stdout upon exit.\n\n### msg_viewer_cmd\n\nThis field allows overriding the command used for externally viewing a\nmessage (`.eml` file) with `W`. By default nmail uses `open` on macOS and\n`xdg-open \u003e/dev/null 2\u003e\u00261` on Linux.\n\n### name\n\nReal name of sender. Recommended when sending emails.\n\n### network_timeout\n\nSpecify timeout for IMAP and SMTP operations in seconds. If using a very slow\nnetwork connection and sending very large emails it may be necessary to increase\nthis timeout. By setting it to 0 network operations will not time out.\nDefault 30 seconds.\n\n### pager_cmd\n\nThe field `pager_cmd` allows overriding which external pager / text viewer to\nuse when viewing an email using an external pager (`E`). If not specified,\nnmail will use the pager specified by the environment variable `$PAGER`.\nIf `$PAGER` is not set, nmail will use `less`.\n\n### parts_viewer_cmd\n\nThis field allows overriding the external viewer used when viewing email\nparts and attachments. By default nmail uses `open` on macOS and\n`xdg-open \u003e/dev/null 2\u003e\u00261` on Linux.\n\n### prefetch_all_headers\n\nDetermines whether nmail shall fetch headers for all messages when viewing a\nfolder, or only the latest based on message uid. By disabling this option there\nis no guarantee folder message lists are sorted by timestamp, as only headers\nfor the last messages stored/added in the folder will be retrieved from server.\nAlso note that some other nmail features may operate in degraded mode when this\nsetting is disabled. The ability to disable pre-fetching of all headers is\nmainly to encompass use-cases where one wants to minimize network usage, or\nuse nmail without persistant cache. Default enabled.\n\n### prefetch_level\n\nMessages are pre-fetched from server based on the `prefetch_level` config\nsetting. The following levels are supported:\n\n    0 = no pre-fetching, messages are retrieved when viewed\n    1 = pre-fetching of currently selected message\n    2 = pre-fetching of all messages in current folder view (default)\n    3 = pre-fetching of all messages in all folders, i.e. full sync\n\nWith level 0-2 configured, pre-fetch level 3 - a single full sync - may be\ntriggered at run-time by pressing `s` from the message list.\n\n### queue_encrypt\n\nIndicates whether nmail shall encrypt local message offline queue or not\n(default enabled).\n\n### save_pass\n\nSpecifies whether nmail shall store the password(s) (default enabled).\n\n### send_ip\n\nControls whether to send client local IP address (otherwise local hostname) in\nSMTP handshaking when sending outgoing emails (default enabled).\n\n### sent\n\nIMAP sent folder name. Used by nmail if `client_store_sent` is enabled to store\ncopies of outgoing emails. \n\n### server_timestamps\n\nUse server timestamps for messages, rather than the timestamp in the message\nheader (default disabled).\n\n### smtp_host\n\nSMTP hostname / address. Required for sending emails.\n\n### smtp_port\n\nSMTP port. Required for fetching emails. Default 587.\n\n### smtp_user\n\nThe field `smtp_user` should generally be left blank, and only be specified in\ncase the email account has different username and password for sending emails\n(or if one wants to use one email service provider for receiving and another\nfor sending emails). If not specified, the configured `user` field will be\nused.\n\n### sni_enabled\n\nControls whether to enable Server Name Indication (SNI) during TLS handshaking.\n\n### spell_cmd\n\nThis field specifies a custom command to use for spell checking composed\nmessages. If not specified, nmail checks if `aspell` or `ispell` is available\non the system (in that order), and uses the first found. The command used is\none of:\n- `aspell -c`\n- `spell -o -x`\n\n### text_to_html_cmd\n\nThis field allows customizing how nmail should convert composed plain text\nmarkdown message to corresponding text/html part. If not specified, nmail\nchecks if `pandoc` or `markdown` is available on the system (in that order),\nand uses the first found. The exact command used is one of:\n- `pandoc -s -f gfm -t html`\n- `markdown`\n\n### trash\n\nIMAP trash folder name. Needs to be specified in order to delete emails.\n\n### user\n\nEmail account username for IMAP (and SMTP).\n\n### verbose_logging\n\nAllows forcing nmail to enable specified logging level:\n\n    0 = info, warnings, errors (default)\n    1 = debug (same as `-e`, `--verbose` - enable verbose logging)\n    2 = trace (same as `-ee`, `--extra-verbose` - enable extra verbose logging)\n\n\nMultiple Email Accounts\n=======================\n\nnmail does currently not support multiple email accounts (in a single session).\nIt is however possible to run multiple nmail instances in parallel with\ndifferent config directories (and thus different email accounts), but it will\nbe just that - multiple instances - each in its own terminal. To facilitate\nsuch usage one can set up aliases for accessing different accounts, e.g.:\n\n    alias gm='nmail -d ${HOME}/.config/nmail-gm' # gmail\n    alias hm='nmail -d ${HOME}/.config/nmail-hm' # hotmail\n\n\nEmail Viewer\n============\n\nThe email navigator / viewer supports the following commands:\n\n    \u003c              select folder\n    \u003e              view message / attachments\n    p              previous message\n    n              next message\n    r              reply all\n    R              reply to sender\n    f              forward\n    F              forward as attachment\n    d              delete\n    c              compose\n    C              compose copy of message\n    l              refresh current folder\n    m              move with auto-selection of folder\n    M              move without auto-selection of folder\n    t              toggle unread\n    v              view html part in external viewer\n    x              export\n    w              view message in external viewer\n    i              import\n    a              select all\n    /              search\n    \u003cspace\u003e        select\n    s              start full sync\n    =              search messages with same subject\n    -              search messages with same sender\n    j              jump to message in search results\n\n    !              sort by unread flag\n    @              sort by attachment flag\n    #              sort by date\n    $              sort by sender name\n    %              sort by subject\n\n    1              filter by current message unread flag\n    2              filter by current message attachment flag\n    3              filter by current message date\n    4              filter by current message sender name\n    5              filter by current message subject\n\n    `              filter reset\n\n\nCompose Editor\n==============\n\nThe built-in email compose editor in nmail supports the following:\n\n    Alt-Backspace  delete previous word\n    Alt-Delete     delete next word\n    Alt-Left       move the cursor backward one word\n    Alt-Right      move the cursor forward one word\n    Arrow keys     move the cursor\n    Backspace      backspace\n    Ctrl-C         cancel message\n    Ctrl-E         edit message in external editor\n    Ctrl-K         delete current line\n    Ctrl-N         toggle markdown editing\n    Ctrl-O         postpone message\n    Ctrl-R         toggle rich headers (bcc)\n    Ctrl-T         to select, from address book / from file dialog\n    Ctrl-V         preview html part (using markdown to html conversion)\n    Ctrl-X         send message\n    Delete         delete\n    Enter          new line\n    Page Up/Down   move the cursor page up / down\n\nThe email headers `To`, `Cc` and `Attchmnt` support comma-separated values, ex:\n\n    To      : Alice \u003calice@example.com\u003e, Bob \u003cbob@example.com\u003e\n    Cc      : Chuck \u003cchuck@example.com\u003e, Dave \u003cdave@example.com\u003e\n    Attchmnt: localpath.txt, /tmp/absolutepath.txt\n    Subject : Hello world\n\nAttachment paths may be local (just filename) or absolute (full path).\n\n\nEmail Search\n============\n\nPress `/` in the message list view to search the local cache for an email. The\nlocal cache can be fully syncronized with server by pressing `s`. The search\nengine supports queries with `\"quoted strings\"`, `+musthave`, `-mustnothave`,\n`partialstring*`, `AND`, `OR`, `XOR` and `NOT`.\n\nSearch terms may be prefixed by `body:`, `subject:`, `from:`, `to:` or\n`folder:` to search only specified fields. By default search query terms are\ncombined with `AND` unless specified. Results are sorted by email timestamp.\n\nPress `\u003c` or `Left` to exit search results and go back to current folder\nmessage list.\n\n\nTroubleshooting\n===============\n\nRefer to [Debugging](/doc/DEBUGGING.md) for details.\n\n\nUser Discussion Forums\n======================\n\nTelegram Group\n--------------\nA Telegram group [https://t.me/nmailusers](https://t.me/nmailusers) is\navailable for users to discuss nmail usage and related topics.\n\n\nSecurity\n========\n\nnmail caches data locally to improve performance. Cached data can be encrypted\nby setting by setting `cache_encrypt=1` in main.conf. Message databases are\nthen encrypted using OpenSSL AES256-CBC with a key derived from a random salt\nand the email account password. Folder names are hashed using SHA256 (thus not\nencrypted).\n\nStoring the account password (`save_pass=1` in main.conf) is *not* secure.\nWhile nmail encrypts the password, the key is trivial to determine from\nthe source code. Only store the password if measurements are taken to ensure\n`~/.config/nmail/secret.conf` cannot by accessed by a third-party.\n\n\nConfiguration\n=============\n\nAside from `main.conf` covered above, the following files can be used to\nconfigure nmail.\n\n~/.config/nmail/ui.conf\n-----------------------\nThis configuration file controls the UI aspects of nmail. Default configuration\nfile (platform-dependent defaults are left empty below):\n\n    attachment_indicator=📎\n    automove_trash_allow=1\n    bottom_reply=0\n    cancel_without_confirm=0\n    colors_enabled=1\n    compose_backup_interval=10\n    compose_line_wrap=0\n    delete_without_confirm=0\n    full_header_include_local=0\n    help_enabled=1\n    invalid_input_notify=1\n    localized_subject_prefixes=\n    markdown_html_compose=0\n    new_msg_bell=1\n    persist_file_selection_dir=1\n    persist_find_query=0\n    persist_folder_filter=1\n    persist_search_query=0\n    persist_selection_on_sortfilter_change=1\n    persist_sortfilter=1\n    plain_text=1\n    postpone_without_confirm=0\n    quit_without_confirm=1\n    respect_format_flowed=1\n    rewrap_quoted_lines=1\n    search_show_folder=0\n    send_without_confirm=0\n    show_embedded_images=1\n    show_progress=1\n    show_rich_header=0\n    signature=0\n    tab_size=8\n    terminal_title=\n    top_bar_show_version=0\n    unread_indicator=N\n    unwrap_quoted_lines=1\n\n### attachment_indicator\n\nControls which character to indicate that an email has attachments\n(default: `📎`). For a more plain layout one can use an ascii character: `+`.\n\n### automove_trash_allow\n\nSpecifies whether trash folder may be selected as automove target folder.\n\n### bottom_reply\n\nControls whether to reply at the bottom of emails (default disabled).\n\n### cancel_without_confirm\n\nAllow cancelling email compose without confirmation prompt (default disabled).\n\n### colors_enabled\n\nEnable terminal color output (default enabled).\n\n### compose_backup_interval\n\nSpecify interval in seconds for local backups during compose (default 10).\nIf the system running nmail is unexpectedly shutdown while user is composing\nan email, then upon next nmail startup any backuped compose message will be\nautomatically uploaded to the draft folder.\nSetting this parameter to 0 disables local backups.\n\n### compose_line_wrap\n\nSpecify how nmail shall wrap lines in outgoing emails. Supported options:\n\n    0 = none (default)\n    1 = using format=flowed\n    2 = hard wrap at 72 chars width\n\n### delete_without_confirm\n\nAllow deleting emails (moving to trash folder) without confirmation\nprompt (default disabled).\n\n### full_header_include_local\n\nWhile viewing full headers (by pressing `h`) nmail displays RFC 822 headers\nby default. This parameter allows enabling nmail to also display local /\ninternal header fields, such as server timestamp. Default disabled.\n\n### help_enabled\n\nShow supported keyboard shortcuts at bottom of screen (default enabled).\n\n### invalid_input_notify\n\nNotify user when unsupported keyboard shortcuts are input (default enabled).\n\n### localized_subject_prefixes\n\nEmail subjects are normalized (stripped of `re:`, `fwd:`) when sorting emails\nby subject, and when replying to, or forwarding an email. By default only the\nEnglish prefixes `re` and `fwd?` (regex for `fwd` and `fw`) are removed. This\nparameter allows extending the removal to other localized prefixes. Example\nconfiguration for a Swedish user:\n\n    localized_subject_prefixes=sv,vb\n\nFor a French user:\n\n    localized_subject_prefixes=ref,tr\n\nFor a German user:\n\n    localized_subject_prefixes=aw,wg\n\n### markdown_html_compose\n\nDefault value for each new email, whether nmail shall enable markdown HTML\ncompose. I.e. whether nmail shall generate a text/html message part based on\nprocessing the composed message as Markdown, when sending sending emails from\nnmail. This can be overridden on a per-email basis by pressing CTRL-N when\nediting an email (default disabled).\n\n### new_msg_bell\n\nIndicate new messages with terminal bell (default enabled).\n\n### persist_file_selection_dir\n\nDetermines whether file selection view shall remember previous directory\n(default enabled).\n\n### persist_find_query\n\nControls whether to start with previous find query when performing repeated\nfind queries (default disabled).\n\n### persist_folder_filter\n\nDetermines whether to persist move-to-folder list filter (default enabled).\n\n### persist_search_query\n\nControls whether to start with previous search query when performing repeated\nsearch queries (default disabled).\n\n### persist_selection_on_sortfilter_change\n\nDetermines whether to keep current message list selection when\nfiltering/sorting mode is changed (default enabled).\n\n### persist_sortfilter\n\nSpecifies whether each folder listing shall persist its filtering/sorting\nmode (default enabled).\n\n### plain_text\n\nDetermines whether showing plain text (vs. html converted to text) is\npreferred. If the preferred email part is not present, nmail automatically\nattempts to show the other. This option can be re-configured at run-time\nby pressing `t` when viewing an email (default enabled).\n\n### postpone_without_confirm\n\nAllow postponing email compose without confirmation prompt (default disabled).\n\n### quit_without_confirm\n\nAllow exiting nmail without confirmation prompt (default enabled).\n\n### respect_format_flowed\n\nSpecify whether nmail shall respect email line wrapping of format=flowed\ntype (default enabled).\n\n### rewrap_quoted_lines\n\nControl whether nmail shall rewrap quoted lines (default enabled).\n\n### search_show_folder\n\nDetermines whether folder name should be shown in search results. This option\ncan be re-configured at run-time by pressing `\\` when viewing search results\n(default disabled).\n\n### send_without_confirm\n\nAllow sending email during compose without confirmation prompt (default\ndisabled).\n\n### show_embedded_images\n\nDetermines whether to show embedded images in text/html part when viewing it\nusing external viewer; press right arrow when viewing a message to go to parts\nview, and then select the text/html part and press right arrow again (default\nenabled).\n\n### show_progress\n\nSpecify how nmail shall show progress indication when fetching or indexing\nemails. Supported options:\n\n    0 = disabled\n    1 = show floating point percentage (default)\n    2 = show integer percentage\n\n### show_rich_header\n\nDetermines whether to show rich headers (bcc field) during email compose. This\noption can be re-configured in run-time by pressing `CTRL-R` when composing\nan email (default disabled).\n\n### signature\n\nDetermines whether to suffix emails with a signature (default disabled). When\nenabled, nmail will use `~/.config/nmail/signature.txt` if present, or\notherwise use `~/.signature` for signature plain text content. When composing\nmarkdown formatted emails, nmail will use `~/.config/nmail/signature.html` if\npresent, for the html part, and otherwise simply convert the plain text\nsignature to html.\n\nNote: For **custom html** signature to work properly, the plain text signature\nshould not be present more than once in the composed message, thus a very short\nplain text signature may not be ideal.\n\nExample signature files: [signature.txt](/doc/signature.txt),\n[signature.html](/doc/signature.html)\n\n### tab_size\n\nTabs are expanded to spaces when viewed in nmail. This parameter controls the\nspace between tab stops (default 8).\n\n### terminal_title\n\nSpecifies custom terminal title, ex: `terminal_title=nmail - d99kris@email.com`.\n\n### unread_indicator\n\nControls which character to indicate that an email is unread (default: `N`).\nFor a more graphical interface, an emoji such as `✉` can be used.\n\n### unwrap_quoted_lines\n\nSpecifies whether nmail shall unwrap quoted lines before wrapping them when\ncomposing a message reply.\n\n\n~/.config/nmail/key.conf\n------------------------\nThis configuration file holds user interface key bindings. Default content:\n\n    key_auto_move=m\n    key_back=,\n    key_backspace=KEY_BACKSPACE\n    key_backspace_alt=KEY_BACKSPACE_ALT\n    key_backward_kill_word=\n    key_backward_word=\n    key_begin_line=KEY_CTRLA\n    key_cancel=KEY_CTRLC\n    key_compose=c\n    key_compose_copy=C\n    key_delete=d\n    key_delete_char=KEY_DC\n    key_delete_char_after_cursor=KEY_CTRLD\n    key_delete_line_after_cursor=KEY_CTRLK\n    key_delete_line_before_cursor=KEY_CTRLU\n    key_down=KEY_DOWN\n    key_end=KEY_END\n    key_end_line=KEY_CTRLE\n    key_enter=KEY_ENTER\n    key_export=x\n    key_ext_editor=KEY_CTRLW\n    key_ext_html_preview=KEY_CTRLV\n    key_ext_html_viewer=v\n    key_ext_msg_viewer=w\n    key_ext_pager=e\n    key_filter_show_current_date=3\n    key_filter_show_current_name=4\n    key_filter_show_current_subject=5\n    key_filter_show_has_attachments=2\n    key_filter_show_unread=1\n    key_filter_sort_reset=`\n    key_find=/\n    key_find_next=?\n    key_forward=f\n    key_forward_attached=F\n    key_forward_word=\n    key_goto_folder=g\n    key_goto_inbox=i\n    key_home=KEY_HOME\n    key_import=z\n    key_jump_to=j\n    key_kill_word=\n    key_left=KEY_LEFT\n    key_move=M\n    key_next_msg=n\n    key_next_page=KEY_NPAGE\n    key_next_page_compose=KEY_NPAGE\n    key_open=.\n    key_othercmd_help=o\n    key_postpone=KEY_CTRLO\n    key_prev_msg=p\n    key_prev_page=KEY_PPAGE\n    key_prev_page_compose=KEY_PPAGE\n    key_quit=q\n    key_refresh=l\n    key_reply_all=r\n    key_reply_sender=R\n    key_return=KEY_RETURN\n    key_rich_header=KEY_CTRLR\n    key_right=KEY_RIGHT\n    key_save_file=s\n    key_search=/\n    key_search_current_name=-\n    key_search_current_subject==\n    key_search_show_folder=\n    key_select_all=a\n    key_select_item=KEY_SPACE\n    key_send=KEY_CTRLX\n    key_sort_date=#\n    key_sort_has_attachments=@\n    key_sort_name=$\n    key_sort_subject=%\n    key_sort_unread=!\n    key_space=KEY_SPACE\n    key_spell=KEY_CTRLS\n    key_sync=s\n    key_tab=KEY_TAB\n    key_terminal_resize=KEY_RESIZE\n    key_to_select=KEY_CTRLT\n    key_toggle_full_header=h\n    key_toggle_markdown_compose=KEY_CTRLN\n    key_toggle_text_html=t\n    key_toggle_unread=u\n    key_up=KEY_UP\n\nThe key bindings may be specified in the following formats:\n- Ncurses macro (ex: `KEY_CTRLK`)\n- Hex key code (ex: `0x22e`)\n- Octal key code sequence (ex: `\\033\\177`)\n- Plain-text lower-case ASCII (ex: `r`)\n- Disable key binding (`KEY_NONE`)\n\nTo determine the key code sequence for a key, one can run nmail in key code\ndump mode `nmail -k` which will output the octal code, and ncurses macro name\n(if present).\n\n\n~/.config/nmail/colors.conf\n---------------------------\nThis configuration file controls the configurable colors of nmail. For this\nconfiguration to take effect, `colors_enabled=1` must be set in\n`~/.config/nmail/ui.conf`.\n\nExample color config files are provided in `/usr/local/share/nmail/themes`\nand can be used by overwriting `~/.config/nmail/colors.conf`.\n\n### Htop style theme\n\nThis color theme is similar to htop's default, see screenshot below with\nnmail and htop.\n\n![screenshot nmail htop style theme](/doc/screenshot-nmail-htop-theme.png)\n\nTo use this config:\n\n    cp /usr/local/share/nmail/themes/htop-style.conf ~/.config/nmail/colors.conf\n\n### Manual configuration\n\nAlternatively one may manually edit `colors.conf`. Colors may\nbe specified using standard palette names (`black`, `red`, `green`, `yellow`,\n`blue`, `magenta`, `cyan`, `white`, `gray`, `bright_red`, `bright_green`,\n`bright_yellow`, `bright_blue`, `bright_magenta`, `bright_cyan` and\n`bright_white`) or using integer palette numbers (`0`, `1`, `2`, etc).\n\nTo use default terminal color, leave the color empty or set it to `normal`.\nTo use inverted / reverse color set both `fg` and `bg` values to `reverse`.\n\nFor terminals supporting custom palettes it is also possible to specify colors\nusing six digit hex format with `0x` prefix, e.g. `0xa0a0a0`. For each item\nbackground `_bg` and foreground `_fg` can be specified. Default\nconfiguration file:\n\n    color_dialog_bg=reverse\n    color_dialog_fg=reverse\n    color_help_desc_bg=\n    color_help_desc_fg=\n    color_help_keys_bg=reverse\n    color_help_keys_fg=reverse\n    color_highlighted_text_bg=reverse\n    color_highlighted_text_fg=reverse\n    color_quoted_text_bg=\n    color_quoted_text_fg=gray\n    color_regular_text_bg=\n    color_regular_text_fg=\n    color_selected_item_bg=\n    color_selected_item_fg=gray\n    color_top_bar_bg=reverse\n    color_top_bar_fg=reverse\n\n### color_dialog\n\nUser prompt dialogs and notifications at bottom of the screen, just above the\nhelp bar.\n\n### color_help_desc\n\nHelp shortcut description texts at bottom of the screen, i.e. `Compose` in\n`C Compose`.\n\n### color_help_keys\n\nHelp shortcut key binding texts at bottom of the screen, i.e. `C` in\n`C Compose`.\n\n### color_highlighted_text\n\nHighlighted text, such as current message in message view, current folder in\nfolder list, text strings found in message find, etc.\n\n### color_quoted_text\n\nQuoted message text (lines starting with `\u003e`).\n\n### color_regular_text\n\nDefault text color.\n\n### color_selected_item\n\nSelected messages in message list view.\n\n### color_top_bar\n\nTop / title bar.\n\n\n~/.config/nmail/auth.conf\n-------------------------\nThis configuration file allows users to set up custom OAuth 2.0 client id and\nclient secret. If not specified, nmail uses its own application id and secret.\nDefault configuration file:\n\n    oauth2_client_id=\n    oauth2_client_secret=\n\n### oauth2_client_id\n\nCustom OAuth 2.0 client id.\n\n### oauth2_client_secret\n\nCustom OAuth 2.0 client secret.\n\n\nEmail Service Providers\n=======================\n\nGmail Prerequisites\n-------------------\nGmail prevents IMAP access by default.\n\nIn order to enable IMAP access go to the Gmail web interface - typically\n[mail.google.com](https://mail.google.com) - and navigate to \n`Settings -\u003e Forwarding and POP/IMAP -\u003e IMAP access` and select: `Enable IMAP`\n\n### Password Authentication\nGmail prevents password authentication by default. To enable\npassword-authenticated IMAP access, one must set up an \"app password\".\n\nTo set up an \"app password\", navigate to\n[https://myaccount.google.com/apppasswords](https://myaccount.google.com/apppasswords)\nand select app \"Mail\" and an appropriate device, e.g. \"Mac\", then click\nGenerate.\n\n### OAuth 2.0 Authentication\nGoogle OAuth 2.0 application review has not yet been requested for nmail, and\nas such users need to request an invitation to use this. Please send an email\nto `d99kris at gmail dot com` with subject `nmail google oauth2 invite` from\nthe google account address you would like to be invited.\n\nAlternatively a user may set up their own OAuth 2.0 application with Google\nand configure `~/.config/nmail/auth.conf` accordingly.\n\n\nAccessing Email Cache using Other Email Clients\n===============================================\n\nThe nmail message cache may be exported to the Maildir format using the\nfollowing command:\n\n    nmail --export ~/Maildir\n\nA basic `~/.muttrc` config file for reading the exported Maildir in `mutt`:\n\n    set mbox_type=Maildir\n    set spoolfile=\"~/Maildir\"\n    set folder=\"~/Maildir\"\n    set mask=\".*\"\n\nNote: nmail is not designed for working with other email clients, this export\noption is mainly available as a data recovery option in case access to an\nemail account is lost, and one needs a local Maildir archive to import into\na new email account. Such import is not supported by nmail, but is supported\nby some other email clients, like Thunderbird.\n\n\nTechnical Details\n=================\n\nThird-party Libraries\n---------------------\nnmail is implemented in C++. Its source tree includes the source code from the\nfollowing third-party libraries:\n\n- [apathy](https://github.com/dlecocq/apathy) -\n  Copyright 2013 Dan Lecocq - [MIT License](/ext/apathy/LICENSE)\n- [cereal](https://github.com/USCiLab/cereal) -\n  Copyright 2014 Randolph Voorhies, Shane Grant - [BSD-3 License](/ext/cereal/LICENSE)\n- [cxx-prettyprint](https://github.com/louisdx/cxx-prettyprint) -\n  Copyright 2010 Louis Delacroix - [Boost License](/ext/cxx-prettyprint/LICENSE_1_0.txt)\n- [cyrus-imap](https://opensource.apple.com/source/CyrusIMAP/CyrusIMAP-156.9/cyrus_imap) -\n  Copyright 1994-2000 Carnegie Mellon University - [BSD-3 License](/ext/cyrus-imap/COPYRIGHT)\n- [libetpan](https://github.com/dinhvh/libetpan) -\n  Copyright 2001-2005 Dinh Viet Hoa - [BSD-3 License](/ext/libetpan/COPYRIGHT)\n- [sqlite_modern_cpp](https://github.com/SqliteModernCpp/sqlite_modern_cpp) -\n  Copyright 2017 aminroosta - [MIT License](/ext/sqlite_modern_cpp/License.txt)\n\nCode Formatting\n---------------\nUncrustify is used to maintain consistent source code formatting, example:\n\n    ./make.sh src\n\n\nLicense\n=======\n\nnmail is distributed under the MIT license. See [LICENSE](/LICENSE) file.\n\n\nKeywords\n========\n\nalternative to alpine, command line, console-based, email client, linux, macos, ncurses,\nterminal-based.\n","funding_links":[],"categories":["C++","\u003ca name=\"email\"\u003e\u003c/a\u003eEmail"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd99kris%2Fnmail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd99kris%2Fnmail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd99kris%2Fnmail/lists"}