afewmail / afew

an initial tagging script for notmuch mail
ISC License
325 stars 98 forks source link

add MAILDIR as fallback for database location #219

Closed paretje closed 5 years ago

paretje commented 5 years ago

Notmuch cli uses the MAILDIR environment variable as a default when no database path is configured in notmuch config. This adds the same behaviour to afew.

       database.path
              The top-level directory where your mail currently exists and to where mail will be delivered in the future. Files
              should be individual email messages. Notmuch will store its database within a sub-directory of the  path  config‐
              ured here named .notmuch.

              Default: $MAILDIR variable if set, otherwise $HOME/mail.
flokli commented 5 years ago

I'm wondering, can we avoid reading notmuch settings on our own completely?

paretje commented 5 years ago

I checked, and notmuch_config_open isn't exposed in libnotmuch. So unless we would use something like notmuch config get database.path, I don't think we can get rid of this. E.g. alot also reads the config file on its own.

flokli commented 5 years ago

@paretje then fine for me - could you rebase this on master?

In addition, it would be nice if you could add a line to docs/configuration.rst mentioning that afew honors the MAILDIR environment variable as fallback, like notmuch does too.

paretje commented 5 years ago

@flokli I just documented how afew determines the notmuch database location.

flokli commented 5 years ago

Thanks!