An email client for terminal users. Currently, it supports sending emails via any IMAP/SMTP server and retrieving received emails from the server.
Run the email_client and enter your required information to login to your
email account (login, password and IMAP/SMTP server addresses).
If updating from v1.0 to v2.0, you may need to remove the configuration file at
~/.config/email_client/config.json.
Email-Client is avaliable on the Arch User Repository.
cmake -S . -B build
cmake --build build --parallel "$(nproc)"
./build/email_clientThe first build downloads and compiles the dependencies, which takes a few minutes.
If you have just installed, you can also use the
build, run, buildrun and clean recipes from the provided Justfile;
just buildrun builds and starts the client in one command.
dev/mail-server.sh runs a local GreenMail
server in Docker (or Podman), so the client can be tested without a real email
account. It requires docker or podman, openssl and curl.
dev/mail-server.sh run # start the server if needed and run ./build/email_client against it
dev/mail-server.sh send # send a test mail from bob to alice
dev/mail-server.sh down # stop the serverRun dev/mail-server.sh without arguments to see all commands. With just:
just dev-run, just mail-send, just mail-up, just mail-down.
| Account | Password | SMTP | IMAP |
|---|---|---|---|
alice@localhost |
alice |
smtps://localhost:3465 |
imaps://localhost:3993 |
bob@localhost |
bob |
smtps://localhost:3465 |
imaps://localhost:3993 |
runuses a separate client config and cache indev/.state/, with both accounts already added. Your real config is not touched.- The server's certificate is issued by a dev CA generated in
dev/.certs/.runpasses it to the client viaSSL_CERT_FILE, so nothing is added to the system trust store. Running./build/email_clientdirectly uses only the system CAs and rejects the dev server. - GreenMail keeps mail in memory only, so stopping the server clears all mailboxes.
Unit tests use GoogleTest (with GMock). They are off by default, so a normal build does not download GoogleTest.
cmake -S . -B build -DBUILD_TESTS=ON
cmake --build build --parallel "$(nproc)"
ctest --test-dir build/tests --output-on-failureOr just test. Extra arguments go to ctest, e.g. just test -R HtmlParser
runs only the tests whose name matches HtmlParser.
All sources except src/main.cpp are built into the email_client_core
library, which both the client and the tests link against. CI (GitHub
Actions) builds the project and runs the tests on every pull request and on
every push to main.
Conventions (see tests/backend/html_parser_test.cpp for an example):
- Test files mirror
src/: tests forsrc/backend/html_parser.cppgo intests/backend/html_parser_test.cpp. Add new files totests/CMakeLists.txt. - Suite name: the tested class or file +
Test, e.g.HtmlParserTest. - Test name: what the code should do, e.g.
DecodeQuotedPrintableDecodesHexEscapes. - Use
EXPECT_*by default. UseASSERT_*only when the rest of the test makes no sense after a failure, e.g. before using an element of a vector whose size was just checked. - Unit tests must not use the network or the user's config.
This project is licensed under the GNU GPL version 3 (or later). See the COPYING file for more details.