Skip to content

Commit

Permalink
Support env variables in mail_container path
Browse files Browse the repository at this point in the history
  • Loading branch information
milhnl authored and pazz committed Aug 24, 2023
1 parent 50fcd10 commit d94d0ad
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
6 changes: 4 additions & 2 deletions alot/defaults/alot.rc.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion alot/utils/configobj.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
2 changes: 1 addition & 1 deletion docs/source/configuration/accounts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down
6 changes: 4 additions & 2 deletions docs/source/configuration/accounts_table
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d94d0ad

Please sign in to comment.