diff --git a/alot/defaults/alot.rc.spec b/alot/defaults/alot.rc.spec index ad5988d9a..07432846f 100644 --- a/alot/defaults/alot.rc.spec +++ b/alot/defaults/alot.rc.spec @@ -346,14 +346,16 @@ thread_focus_linewise = boolean(default=True) # sendmail command. This is the shell command used to send out mails via the sendmail protocol sendmail_command = string(default='sendmail -t') - # where to store outgoing mails, e.g. `maildir:///home/you/mail/Sent` or `maildir://~/mail/Sent`. + # where to store outgoing mails, e.g. `maildir:///home/you/mail/Sent`, + # `maildir://$MAILDIR/Sent` or `maildir://~/mail/Sent`. # You can use mbox, maildir, mh, babyl and mmdf in the protocol part of the URL. # # .. note:: If you want to add outgoing mails automatically to the notmuch index # you must use maildir in a path within your notmuch database path. sent_box = mail_container(default=None) - # where to store draft mails, e.g. `maildir:///home/you/mail/Drafts` or `maildir://~/mail/Drafts`. + # where to store draft mails, e.g. `maildir:///home/you/mail/Drafts`, + # `maildir://$MAILDIR/Drafts` or `maildir://~/mail/Drafts`. # You can use mbox, maildir, mh, babyl and mmdf in the protocol part of the URL. # # .. note:: You will most likely want drafts indexed by notmuch to be able to diff --git a/alot/utils/configobj.py b/alot/utils/configobj.py index d895b05f9..203119754 100644 --- a/alot/utils/configobj.py +++ b/alot/utils/configobj.py @@ -106,7 +106,7 @@ def mail_container(value): } klass = uri_scheme_to_mbclass.get(mburl.scheme) if klass: - return klass(mburl.netloc + mburl.path) + return klass(os.path.expandvars(mburl.netloc + mburl.path)) raise VdtTypeError(value) diff --git a/docs/source/configuration/accounts.rst b/docs/source/configuration/accounts.rst index 81f45b35d..7ab093a0d 100644 --- a/docs/source/configuration/accounts.rst +++ b/docs/source/configuration/accounts.rst @@ -17,7 +17,7 @@ Here is an example configuration gpg_key = D7D6C5AA sendmail_command = msmtp --account=wayne -t sent_box = maildir:///home/bruce/mail/work/Sent - # ~ expansion also works + # ~, $VAR and ${VAR} expansion also work draft_box = maildir://~/mail/work/Drafts [[secret]] diff --git a/docs/source/configuration/accounts_table b/docs/source/configuration/accounts_table index 3c8db96ee..a29bc95ad 100644 --- a/docs/source/configuration/accounts_table +++ b/docs/source/configuration/accounts_table @@ -52,7 +52,8 @@ .. describe:: draft_box - where to store draft mails, e.g. `maildir:///home/you/mail/Drafts` or `maildir://~/mail/Drafts`. + where to store draft mails, e.g. `maildir:///home/you/mail/Drafts`, + `maildir://$MAILDIR/Drafts` or `maildir://~/mail/Drafts`. You can use mbox, maildir, mh, babyl and mmdf in the protocol part of the URL. .. note:: You will most likely want drafts indexed by notmuch to be able to @@ -177,7 +178,8 @@ .. describe:: sent_box - where to store outgoing mails, e.g. `maildir:///home/you/mail/Sent` or `maildir://~/mail/Sent`. + where to store outgoing mails, e.g. `maildir:///home/you/mail/Sent`, + `maildir://$MAILDIR/Sent` or `maildir://~/mail/Sent`. You can use mbox, maildir, mh, babyl and mmdf in the protocol part of the URL. .. note:: If you want to add outgoing mails automatically to the notmuch index