-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add basic support for xdg base directory specification
- Loading branch information
Showing
8 changed files
with
104 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,7 @@ Command-line Options: | |
prompt for cache encryption during oauth2 setup | ||
|
||
-d, --confdir <DIR> | ||
use a different directory than ~/.nmail | ||
use a different directory than ~/.config/nmail | ||
|
||
-e, --verbose | ||
enable verbose logging | ||
|
@@ -82,18 +82,15 @@ Command-line Options: | |
|
||
Configuration files: | ||
|
||
~/.nmail/auth.conf | ||
~/.config/nmail/auth.conf | ||
configures custom oauth2 client id and secret | ||
|
||
~/.nmail/main.conf | ||
~/.config/nmail/main.conf | ||
configures mail account and general settings | ||
|
||
~/.nmail/ui.conf | ||
~/.config/nmail/ui.conf | ||
customizes UI settings | ||
|
||
~/.nmail/secret.conf | ||
stores saved passwords | ||
|
||
Examples: | ||
|
||
nmail -s gmail | ||
|
@@ -236,8 +233,8 @@ file: | |
|
||
$ nmail | ||
|
||
Then open the config file `~/.nmail/main.conf` in your favourite text editor | ||
and fill out the required fields: | ||
Then open the config file `~/.config/nmail/main.conf` in your favourite text | ||
editor and fill out the required fields: | ||
|
||
[email protected] | ||
drafts=Drafts | ||
|
@@ -251,7 +248,7 @@ and fill out the required fields: | |
trash=Trash | ||
[email protected] | ||
|
||
Full example of a config file `~/.nmail/main.conf`: | ||
Full example of a config file `~/.config/nmail/main.conf`: | ||
|
||
[email protected] | ||
addressbook_encrypt=0 | ||
|
@@ -571,8 +568,8 @@ different config directories (and thus different email accounts), but it will | |
be just that - multiple instances - each in its own terminal. To facilitate | ||
such usage one can set up aliases for accessing different accounts, e.g.: | ||
|
||
alias gm='nmail -d ${HOME}/.nmail-gm' # gmail | ||
alias hm='nmail -d ${HOME}/.nmail-hm' # hotmail | ||
alias gm='nmail -d ${HOME}/.config/nmail-gm' # gmail | ||
alias hm='nmail -d ${HOME}/.config/nmail-hm' # hotmail | ||
|
||
|
||
Email Viewer | ||
|
@@ -699,7 +696,7 @@ encrypted). | |
Storing the account password (`save_pass=1` in main.conf) is *not* secure. | ||
While nmail encrypts the password, the key is trivial to determine from | ||
the source code. Only store the password if measurements are taken to ensure | ||
`~/.nmail/secret.conf` cannot by accessed by a third-party. | ||
`~/.config/nmail/secret.conf` cannot by accessed by a third-party. | ||
|
||
|
||
Configuration | ||
|
@@ -708,8 +705,8 @@ Configuration | |
Aside from `main.conf` covered above, the following files can be used to | ||
configure nmail. | ||
|
||
~/.nmail/ui.conf | ||
---------------- | ||
~/.config/nmail/ui.conf | ||
----------------------- | ||
This configuration file controls the UI aspects of nmail. Default configuration | ||
file (platform-dependent defaults are left empty below): | ||
|
||
|
@@ -1002,10 +999,11 @@ an email (default disabled). | |
### signature | ||
|
||
Determines whether to suffix emails with a signature (default disabled). When | ||
enabled, nmail will use `~/.nmail/signature.txt` if present, or otherwise use | ||
`~/.signature` for signature plain text content. When composing markdown | ||
formatted emails, nmail will use `~/.nmail/signature.html` if present, for the | ||
html part, and otherwise simply convert the plain text signature to html. | ||
enabled, nmail will use `~/.config/nmail/signature.txt` if present, or | ||
otherwise use `~/.signature` for signature plain text content. When composing | ||
markdown formatted emails, nmail will use `~/.config/nmail/signature.html` if | ||
present, for the html part, and otherwise simply convert the plain text | ||
signature to html. | ||
|
||
Note: For **custom html** signature to work properly, the plain text signature | ||
should not be present more than once in the composed message, thus a very short | ||
|
@@ -1029,14 +1027,14 @@ Controls which character to indicate that an email is unread (default: `N`). | |
For a more graphical interface, an emoji such as `✉` can be used. | ||
|
||
|
||
~/.nmail/colors.conf | ||
-------------------- | ||
~/.config/nmail/colors.conf | ||
--------------------------- | ||
This configuration file controls the configurable colors of nmail. For this | ||
configuration to take effect, `colors_enabled=1` must be set in | ||
`~/.nmail/ui.conf`. | ||
`~/.config/nmail/ui.conf`. | ||
|
||
Example color config files are provided in `/usr/local/share/nmail/themes` | ||
and can be used by overwriting `~/.nmail/colors.conf`. | ||
and can be used by overwriting `~/.config/nmail/colors.conf`. | ||
|
||
### Htop style theme | ||
|
||
|
@@ -1047,7 +1045,7 @@ nmail and htop. | |
|
||
To use this config: | ||
|
||
cp /usr/local/share/nmail/themes/htop-style.conf ~/.nmail/colors.conf | ||
cp /usr/local/share/nmail/themes/htop-style.conf ~/.config/nmail/colors.conf | ||
|
||
### Manual configuration | ||
|
||
|
@@ -1119,8 +1117,8 @@ Selected messages in message list view. | |
Top / title bar. | ||
|
||
|
||
~/.nmail/auth.conf | ||
------------------ | ||
~/.config/nmail/auth.conf | ||
------------------------- | ||
This configuration file allows users to set up custom OAuth 2.0 client id and | ||
client secret. If not specified, nmail uses its own application id and secret. | ||
Default configuration file: | ||
|
@@ -1164,7 +1162,7 @@ to `d99kris at gmail dot com` with subject `nmail google oauth2 invite` from | |
the google account address you would like to be invited. | ||
|
||
Alternatively a user may set up their own OAuth 2.0 application with Google | ||
and configure `~/.nmail/auth.conf` accordingly. | ||
and configure `~/.config/nmail/auth.conf` accordingly. | ||
|
||
|
||
Accessing Email Cache using Other Email Clients | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,7 +60,7 @@ int main(int argc, char* argv[]) | |
{ | ||
// Defaults | ||
umask(S_IRWXG | S_IRWXO); | ||
Util::SetApplicationDir(std::string(getenv("HOME")) + std::string("/.nmail")); | ||
Util::SetApplicationDir(Util::GetDefaultApplicationDir()); | ||
Log::SetVerboseLevel(Log::INFO_LEVEL); | ||
bool online = true; | ||
bool changePass = false; | ||
|
@@ -462,47 +462,46 @@ static void ShowHelp() | |
"Usage: nmail [OPTION]\n" | ||
"\n" | ||
"Options:\n" | ||
" -c, --cache-encrypt prompt for cache encryption during oauth2 setup\n" | ||
" -d, --confdir <DIR> use a different directory than ~/.nmail\n" | ||
" -e, --verbose enable verbose logging\n" | ||
" -ee, --extra-verbose enable extra verbose logging\n" | ||
" -h, --help display this help and exit\n" | ||
" -k, --keydump key code dump mode\n" | ||
" -o, --offline run in offline mode\n" | ||
" -p, --pass change password\n" | ||
" -s, --setup <SERVICE> setup wizard for specified service, supported\n" | ||
" services: gmail, gmail-oauth2, icloud, outlook,\n" | ||
" outlook-oauth2\n" | ||
" -v, --version output version information and exit\n" | ||
" -x, --export <DIR> export cache to specified dir in Maildir format\n" | ||
" -c, --cache-encrypt prompt for cache encryption during oauth2 setup\n" | ||
" -d, --confdir <DIR> use a different directory than ~/.config/nmail\n" | ||
" -e, --verbose enable verbose logging\n" | ||
" -ee, --extra-verbose enable extra verbose logging\n" | ||
" -h, --help display this help and exit\n" | ||
" -k, --keydump key code dump mode\n" | ||
" -o, --offline run in offline mode\n" | ||
" -p, --pass change password\n" | ||
" -s, --setup <SERVICE> setup wizard for specified service, supported\n" | ||
" services: gmail, gmail-oauth2, icloud, outlook,\n" | ||
" outlook-oauth2\n" | ||
" -v, --version output version information and exit\n" | ||
" -x, --export <DIR> export cache to specified dir in Maildir format\n" | ||
"\n" | ||
"Examples:\n" | ||
" nmail -s gmail setup nmail for a gmail account\n" | ||
" nmail running nmail without setup wizard will generate\n" | ||
" default configuration files in ~/.nmail dir if\n" | ||
" not present already, these can be manually edited\n" | ||
" to configure nmail for email service providers not\n" | ||
" supported by the built-in setup wizard (refer to\n" | ||
" FILES section on ~/.nmail/main.conf for details)\n" | ||
" nmail -s gmail setup nmail for a gmail account\n" | ||
" nmail running nmail without setup wizard will generate\n" | ||
" default configuration files in the nmail dir if\n" | ||
" not present already, these can be edited to\n" | ||
" configure nmail for email service providers not\n" | ||
" supported by the built-in setup wizard (refer to\n" | ||
" FILES section for details)\n" | ||
"\n" | ||
"Files:\n" | ||
" ~/.nmail/auth.conf configures custom oauth2 client id and secret\n" | ||
" ~/.nmail/main.conf configures mail account and general settings, for\n" | ||
" full nmail functionality the following fields\n" | ||
" shall be configured:\n" | ||
" address (ex: [email protected]),\n" | ||
" drafts (folder name, ex: Drafts),\n" | ||
" imap_host (ex: imap.example.com),\n" | ||
" imap_port (ex: 993),\n" | ||
" inbox (folder name, ex: Inbox),\n" | ||
" name (ex: Firstname Lastname),\n" | ||
" sent (folder name, ex: Sent),\n" | ||
" smtp_host (ex: smtp.example.com),\n" | ||
" smtp_port (ex: 465 or 587),\n" | ||
" trash (folder name, ex: Trash),\n" | ||
" user (ex: [email protected] or example).\n" | ||
" ~/.nmail/ui.conf customizes UI settings\n" | ||
" ~/.nmail/secret.conf stores saved passwords\n" | ||
" ~/.config/nmail/auth.conf configures custom oauth2 client id and secret\n" | ||
" ~/.config/nmail/main.conf configures mail account and general settings,\n" | ||
" for full functionality the following fields\n" | ||
" shall be configured:\n" | ||
" address (ex: [email protected]),\n" | ||
" drafts (folder name, ex: Drafts),\n" | ||
" imap_host (ex: imap.example.com),\n" | ||
" imap_port (ex: 993),\n" | ||
" inbox (folder name, ex: Inbox),\n" | ||
" name (ex: Firstname Lastname),\n" | ||
" sent (folder name, ex: Sent),\n" | ||
" smtp_host (ex: smtp.example.com),\n" | ||
" smtp_port (ex: 465 or 587),\n" | ||
" trash (folder name, ex: Trash),\n" | ||
" user (ex: [email protected] or example).\n" | ||
" ~/.config/nmail/ui.conf customizes UI settings\n" | ||
"\n" | ||
"Report bugs at https://github.com/d99kris/nmail\n" | ||
"\n"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man. | ||
.TH NMAIL "1" "July 2024" "nmail 5.1.3" "User Commands" | ||
.TH NMAIL "1" "July 2024" "nmail 5.1.4" "User Commands" | ||
.SH NAME | ||
nmail \- ncurses mail | ||
.SH SYNOPSIS | ||
|
@@ -14,7 +14,7 @@ alpine / pine, supporting IMAP and SMTP. | |
prompt for cache encryption during oauth2 setup | ||
.TP | ||
\fB\-d\fR, \fB\-\-confdir\fR <DIR> | ||
use a different directory than ~/.nmail | ||
use a different directory than ~/.config/nmail | ||
.TP | ||
\fB\-e\fR, \fB\-\-verbose\fR | ||
enable verbose logging | ||
|
@@ -46,12 +46,12 @@ output version information and exit | |
export cache to specified dir in Maildir format | ||
.SH FILES | ||
.TP | ||
~/.nmail/auth.conf | ||
~/.config/nmail/auth.conf | ||
configures custom oauth2 client id and secret | ||
.TP | ||
~/.nmail/main.conf | ||
configures mail account and general settings, for | ||
full nmail functionality the following fields | ||
~/.config/nmail/main.conf | ||
configures mail account and general settings, | ||
for full functionality the following fields | ||
shall be configured: | ||
address (ex: [email protected]), | ||
drafts (folder name, ex: Drafts), | ||
|
@@ -65,23 +65,20 @@ smtp_port (ex: 465 or 587), | |
trash (folder name, ex: Trash), | ||
user (ex: [email protected] or example). | ||
.TP | ||
~/.nmail/ui.conf | ||
~/.config/nmail/ui.conf | ||
customizes UI settings | ||
.TP | ||
~/.nmail/secret.conf | ||
stores saved passwords | ||
.SH EXAMPLES | ||
.TP | ||
nmail \-s gmail | ||
setup nmail for a gmail account | ||
.TP | ||
nmail | ||
running nmail without setup wizard will generate | ||
default configuration files in ~/.nmail dir if | ||
not present already, these can be manually edited | ||
to configure nmail for email service providers not | ||
default configuration files in the nmail dir if | ||
not present already, these can be edited to | ||
configure nmail for email service providers not | ||
supported by the built\-in setup wizard (refer to | ||
FILES section on ~/.nmail/main.conf for details) | ||
FILES section for details) | ||
.SH AUTHOR | ||
Written by Kristofer Berggren. | ||
.SH "REPORTING BUGS" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters