Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support env variables in mail_container path #1625

Merged
merged 1 commit into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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