dotfiles/files/mutt/.local/bin/mutt-sorcerer
Ben Grande a76215014f
fix: mutt spoolfile set after other folder options
- Fix mutt-sorcerer printing an invalid glob
- Encrypt postponed messages
- Set different folders based on folder regexp
- Use mailboxes when offline
2025-01-09 16:25:55 +01:00

30 lines
818 B
Bash
Executable File

#!/bin/sh
##
## SPDX-FileCopyrightText: 2024 - 2025 Benjamin Grande M. S. <ben.grande.b@gmail.com>
##
## SPDX-License-Identifier: AGPL-3.0-or-later
##
## Mutt Sorcerer - source Mutt configuration like a wizard
## Useful if some configurations files in non-default locations might exist.
set -eu
credentials_file="${HOME}/.muttrc-credentials.local"
aliases_file="${HOME}/.muttrc-aliases.local"
local_file="${HOME}/.muttrc.local"
## source_existent(): do not require file existence.
source_existent(){
for file in "${@}"; do
if test -f "${file}" && test -r "${file}"; then
printf '%s\n' "source \"${file}\""
fi
done
unset file
}
## Source files that must exist, let mutt fail otherwise.
printf '%s\n' "source \"${credentials_file}\""
source_existent ./*.muttrc "${aliases_file}" "${local_file}"