mutt-wizard

fork of Luke Smiths mutt-wizard
git clone git://git.jakekoroman.com/mutt-wizard
Log | Files | Refs | README | LICENSE

commit 4b9b111d27948090fac2a96988041c318f6259d8
parent 7a8ded1b6c6f9a018785e5cda90c7508ad50d8b3
Author: Luke <luke@lukesmith.xyz>
Date:   Sat, 10 Feb 2018 11:02:44 -0700

reordering, services file added

Diffstat:
MREADME.md | 8--------
Mautoconf/domains.csv | 3++-
Aautoconf/services.csv | 7+++++++
Dcredentials/imappwd.pyc | 0
Mmutt_install.sh | 28+++++++++++++++++-----------
Mremoveaccount.sh | 1+
6 files changed, 27 insertions(+), 20 deletions(-)

diff --git a/README.md b/README.md @@ -30,11 +30,3 @@ Or you can help monetarily via [Patreon](https://patreon.com/lukesmith) or [Payp ### Todo: Add settings for email accounts not unified by one domain --------- - -zoho,imap.zoho.com,993.00,smtp.zoho.com,465.00 -icloud,imap.mail.me.com,993.00,smtp.mail.me.com,587.00 -inbox.com,imap.inbox.com,993.00,smtp.inbox.com,465.00 -office365,outlook.office365.com,993.00,smtp.office365.com,587.00,INBOX,Drafts,Sent Items -hostgator,gator4171.hostgator.com,993.00,gator4171.hostgator.com,587.00 -godaddy,imap.secureserver.net,993,smtpout.secureserver.net,465 diff --git a/autoconf/domains.csv b/autoconf/domains.csv @@ -86,5 +86,6 @@ cocaine.ninja,mail.cock.li,993.00,mail.cock.li,587.00,INBOX,Drafts,Sent waifu.club,mail.cock.li,993.00,mail.cock.li,587.00,INBOX,Drafts,Sent rape.lol,mail.cock.li,993.00,mail.cock.li,587.00,INBOX,Drafts,Sent nuke.africa,mail.cock.li,993.00,mail.cock.li,587.00,INBOX,Drafts,Sent -posteo.de,posteo.de,143/993,posteo.de,587/465,INBOX,Drafts,Sent +posteo.de,posteo.de,993,posteo.de,587,INBOX,Drafts,Sent runbox.com,mail.runbox.com,993,mail.runbox.com,587,INBOX,Drafts,Sent +lukesmith.xyz,gator4171.hostgator.com,993,gator4171.hostgator.com,587,INBOX,INBOX.Drafts,INBOX.Sent diff --git a/autoconf/services.csv b/autoconf/services.csv @@ -0,0 +1,7 @@ +SERVICE,IMAP,imap port,SMTP,smtp port,spoolfile,postponed,record +"Zoho",imap.zoho.com,993,smtp.zoho.com,465,,, +"iCloud",imap.mail.me.com,993,smtp.mail.me.com,587,,, +"Inbox.com",imap.inbox.com,993,smtp.inbox.com,465,,, +"Office 365",outlook.office365.com,993,smtp.office365.com,587,INBOX,Drafts,Sent Items +"Host Gator",gator4171.hostgator.com,993,gator4171.hostgator.com,587,INBOX,INBOX.Drafts,INBOX.Sent +"GoDaddy",imap.secureserver.net,993,smtpout.secureserver.net,465,,, diff --git a/credentials/imappwd.pyc b/credentials/imappwd.pyc Binary files differ. diff --git a/mutt_install.sh b/mutt_install.sh @@ -1,4 +1,5 @@ #!/bin/bash + muttdir="$HOME/.config/mutt/" mkdir -p ~/.config/mutt/credentials @@ -16,13 +17,15 @@ fulladdr=$(\ # Check to see if domain is in domain list serverinfo=$(cat autoconf/domains.csv | grep -w ^${fulladdr##*@}) -if [ -z "$serverinfo" ]; then echo No suitable match. && exit; fi - +if [ -z "$serverinfo" ]; + then + echo No suitable match. && exit + else # Read in server data as variables IFS=, read service imap iport smtp sport spoolfile postponed record <<EOF $serverinfo EOF -clear +fi realname=$(\ dialog --title "Luke's mutt/offlineIMAP autoconfig" --inputbox "Enter the full name you'd like to be identified by on this email account." 10 60 \ @@ -61,20 +64,23 @@ replacement=" /$delet/d" + addAccount() { + # First, adding the encrypted password. + dialog --title "Luke's mutt/offlineIMAP password wizard" --passwordbox "Enter the password for the \"$title\" account." 10 60 2> /tmp/$title + gpg -r $youremail --encrypt /tmp/$title + shred -u /tmp/$title && echo "Password encrypted and memory shredded." + mv /tmp/$title.gpg ~/.config/mutt/credentials/ + + # Creating the offlineimaprc if it doesn't exist already. if [ ! -f ~/.offlineimaprc ]; then cp "$muttdir"autoconf/offlineimap_header ~/.offlineimaprc; fi cat "$muttdir"autoconf/offlineimap_profile | sed -e "$replacement" >> ~/.offlineimaprc + # Add the mutt profile. cat "$muttdir"autoconf/mutt_profile | sed -e "$replacement" > "$muttdir"accounts/$title.muttrc + # Add on offlineimaprc sync list. sed -i "s/^accounts =.*[a-zA-Z]$/&, $title/g;s/^accounts =$/accounts = $title/g" ~/.offlineimaprc ;} addAccount - -dialog --title "Luke's mutt/offlineIMAP password wizard" --passwordbox "Enter the password for the \"$title\" account." 10 60 2> /tmp/$title -gpg -r $youremail --encrypt /tmp/$title -shred -u /tmp/$title && echo "Password encrypted and memory shredded." -mv /tmp/$title.gpg ~/.config/mutt/credentials/ - -echo Done lmao. -exit +clear diff --git a/removeaccount.sh b/removeaccount.sh @@ -16,6 +16,7 @@ removeAccount() { sed -ie " s/,$//g " ~/.offlineimaprc rm "$muttdir"accounts/$1.muttrc + rm "$muttdir"credentials/$1.gpg echo $1 deleted. ;} #/tmp/numbered