@@ -73,6 +73,7 @@ prepmutt() { mkdir -p "${muttrc%/*}" "$accdir" | |||||
} | } | ||||
getprofiles() { \ | getprofiles() { \ | ||||
safename="$(echo $fulladdr | sed 's/@/_/g')" | |||||
case "$type" in | case "$type" in | ||||
online) | online) | ||||
folder="imaps://$login@$imap:$iport" | folder="imaps://$login@$imap:$iport" | ||||
@@ -124,7 +125,7 @@ delete() { if [ -z "${fulladdr+x}" ]; then | |||||
sed -ibu "/account $fulladdr$/,/^\(\s*$\|account\)/d" "$msmtprc" 2>/dev/null; rm -f "$msmtprc"bu | sed -ibu "/account $fulladdr$/,/^\(\s*$\|account\)/d" "$msmtprc" 2>/dev/null; rm -f "$msmtprc"bu | ||||
sed -ibu "/account $fulladdr$/,/^\(\s*$\|account\)/d" "$mpoprc" 2>/dev/null; rm -f "$mpoprc"bu | sed -ibu "/account $fulladdr$/,/^\(\s*$\|account\)/d" "$mpoprc" 2>/dev/null; rm -f "$mpoprc"bu | ||||
pass rm -f "$passprefix$fulladdr" >/dev/null 2>&1 | pass rm -f "$passprefix$fulladdr" >/dev/null 2>&1 | ||||
[ -n "${purge+x}" ] && rm -rf "${maildir:?}/${fulladdr:?}" | |||||
[ -n "${purge+x}" ] && safename="$(echo $fulladdr | sed 's/@/_/g')" && rm -rf "${cachedir:?}/${safename:?}" "${maildir:?}/${fulladdr:?}" | |||||
} | } | ||||
askinfo() { \ | askinfo() { \ | ||||
@@ -199,6 +200,7 @@ getboxes() { if [ -n "${force+x}" ] ; then | |||||
finalize() { echo "$toappend" >> "$accdir/$fulladdr.muttrc" | finalize() { echo "$toappend" >> "$accdir/$fulladdr.muttrc" | ||||
[ "$type" != "online" ] && echo "$mailboxes" | xargs -I {} mkdir -p "$maildir/$fulladdr/{}/cur" "$maildir/$fulladdr/{}/tmp" "$maildir/$fulladdr/{}/new" | [ "$type" != "online" ] && echo "$mailboxes" | xargs -I {} mkdir -p "$maildir/$fulladdr/{}/cur" "$maildir/$fulladdr/{}/tmp" "$maildir/$fulladdr/{}/new" | ||||
mkdir -p "$cachedir/$safename/bodies" | |||||
echo "$fulladdr (account #$idnum) added successfully." | echo "$fulladdr (account #$idnum) added successfully." | ||||
command -V urlview >/dev/null 2>&1 && [ ! -f "$HOME/.urlview" ] && echo "COMMAND \$BROWSER" > "$HOME/.urlview" | command -V urlview >/dev/null 2>&1 && [ ! -f "$HOME/.urlview" ] && echo "COMMAND \$BROWSER" > "$HOME/.urlview" | ||||
return 0 ;} | return 0 ;} | ||||
@@ -236,8 +238,6 @@ Main actions: | |||||
-l List email addresses configured | -l List email addresses configured | ||||
-d Remove an already added address | -d Remove an already added address | ||||
-D your@email.com Force remove account without confirmation | -D your@email.com Force remove account without confirmation | ||||
-y your@email.com Sync mail for account by name | |||||
-Y Sync mail for all accounts | |||||
-t number Toggle automatic mailsync every <number> minutes | -t number Toggle automatic mailsync every <number> minutes | ||||
-T Toggle automatic mailsync | -T Toggle automatic mailsync | ||||
-r Reorder account numbers | -r Reorder account numbers | ||||
@@ -250,8 +250,8 @@ Options allowed with -a: | |||||
-s SMTP server address | -s SMTP server address | ||||
-S SMTP server port | -S SMTP server port | ||||
-x Password for account (recommended to be in double quotes) | -x Password for account (recommended to be in double quotes) | ||||
-P Pass Prefix (prefix of the file where password is stored) | |||||
-p Add for a POP server instead of IMAP. | -p Add for a POP server instead of IMAP. | ||||
-P Pass Prefix (prefix of the file where password is stored) | |||||
-X Delete an account's local email too when deleting. | -X Delete an account's local email too when deleting. | ||||
-o Configure address, but keep mail online. | -o Configure address, but keep mail online. | ||||
-f Assume typical English mailboxes without attempting log-on. | -f Assume typical English mailboxes without attempting log-on. | ||||
@@ -2,5 +2,7 @@ account $fulladdr | |||||
tls on | tls on | ||||
user $login | user $login | ||||
host $imap | host $imap | ||||
port $iport | |||||
timeout 10 | |||||
delivery maildir $maildir/$fulladdr/INBOX | delivery maildir $maildir/$fulladdr/INBOX | ||||
passwordeval pass $passprefix$fulladdr | passwordeval pass $passprefix$fulladdr |
@@ -5,8 +5,8 @@ set from = "$fulladdr" | |||||
set sendmail = "msmtp -a $fulladdr" | set sendmail = "msmtp -a $fulladdr" | ||||
alias me $realname <$fulladdr> | alias me $realname <$fulladdr> | ||||
set folder = "$folder" | set folder = "$folder" | ||||
set header_cache = $cachedir/$fulladdr/headers | |||||
set message_cachedir = $cachedir/$fulladdr/bodies | |||||
set header_cache = "$cachedir/$safename/headers" | |||||
set message_cachedir = "$cachedir/$safename/bodies" | |||||
set mbox_type = Maildir | set mbox_type = Maildir | ||||
set hostname = "$hostname" | set hostname = "$hostname" | ||||
source $muttshare/switch.muttrc | source $muttshare/switch.muttrc | ||||
@@ -16,5 +16,3 @@ set trash = "+Trash" | |||||
set record = "+Sent" | set record = "+Sent" | ||||
$extra | $extra | ||||
macro index o "<shell-escape>mailsync $fulladdr<enter>" "sync $fulladdr" | macro index o "<shell-escape>mailsync $fulladdr<enter>" "sync $fulladdr" | ||||
macro index \eg "<enter-command>unset wait_key<enter><shell-escape>gpg --list-secret-keys; printf 'Enter email ID of user to publish: '; read eID; printf 'Enter fingerprint of GPG key to publish: '; read eFGPT; $prefix/libexec/gpg-wks-client --create \\\$eFGPT \\\$eID | msmtp --read-envelope-from --read-recipients -a $fulladdr<enter>" "publish GPG key to WKS provider" | |||||
macro index \eh "<pipe-message>$prefix/libexec/gpg-wks-client --receive | msmtp --read-envelope-from --read-recipients -a $fulladdr<enter>" "confirm GPG publication" |
@@ -95,6 +95,8 @@ macro index,pager Ca ";<copy-message>=Archive<enter>" "copy mail to archive" | |||||
#set crypt_opportunistic_encrypt = yes | #set crypt_opportunistic_encrypt = yes | ||||
#set pgp_self_encrypt = yes | #set pgp_self_encrypt = yes | ||||
#set pgp_default_key = 'your@gpgemailaddre.ss' | #set pgp_default_key = 'your@gpgemailaddre.ss' | ||||
macro index \eg "<enter-command>unset wait_key<enter><shell-escape>gpg --list-secret-keys; printf 'Enter email ID of user to publish: '; read eID; printf 'Enter fingerprint of GPG key to publish: '; read eFGPT; $prefix/libexec/gpg-wks-client --create \\\$eFGPT \\\$eID | msmtp --read-envelope-from --read-recipients -a $fulladdr<enter>" "publish GPG key to WKS provider" | |||||
macro index \eh "<pipe-message>$prefix/libexec/gpg-wks-client --receive | msmtp --read-envelope-from --read-recipients -a $fulladdr<enter>" "confirm GPG publication" | |||||
macro index,pager a "<enter-command>set my_pipe_decode=\$pipe_decode pipe_decode<return><pipe-message>abook --add-email<return><enter-command>set pipe_decode=\$my_pipe_decode; unset my_pipe_decode<return>" "add the sender address to abook" | macro index,pager a "<enter-command>set my_pipe_decode=\$pipe_decode pipe_decode<return><pipe-message>abook --add-email<return><enter-command>set pipe_decode=\$my_pipe_decode; unset my_pipe_decode<return>" "add the sender address to abook" | ||||
macro index \Cr "T~U<enter><tag-prefix><clear-flag>N<untag-pattern>.<enter>" "mark all messages as read" | macro index \Cr "T~U<enter><tag-prefix><clear-flag>N<untag-pattern>.<enter>" "mark all messages as read" | ||||