From 4b9b111d27948090fac2a96988041c318f6259d8 Mon Sep 17 00:00:00 2001 From: Luke Date: Sat, 10 Feb 2018 11:02:44 -0700 Subject: [PATCH] reordering, services file added --- README.md | 8 -------- autoconf/domains.csv | 3 ++- autoconf/services.csv | 7 +++++++ credentials/imappwd.pyc | Bin 724 -> 0 bytes mutt_install.sh | 28 +++++++++++++++++----------- removeaccount.sh | 1 + 6 files changed, 27 insertions(+), 20 deletions(-) create mode 100644 autoconf/services.csv delete mode 100644 credentials/imappwd.pyc diff --git a/README.md b/README.md index 54e3c12..4af0296 100644 --- 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 index 647af41..fb169ed 100644 --- 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 new file mode 100644 index 0000000..b1d927a --- /dev/null +++ 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 deleted file mode 100644 index 194e73cc260cf1694bd1006d38f6c158a54de8e9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 724 zcmbVKJ8#rL5dPM_M|4~eiWEYP6v@rm1qBU4ND*xm`3lfAXwSRxUY7Cj4#ri_f)J?0(Bchb%LeD;8>4d7$D(0rrqChY`$&65a-Qd0@;y z8XLx8gc=x(?D5cCC>(4yKIyzy*YkJN4 zl9D*<+S@Wun!)=d>#eb^FLh1HCB?bRnFPR=p0Qo62C^%ia|zAI`0G&GCx5GbR*-CM zWq2T91oD#Th{*s>`@#$QR+DXYW5;aKv9sVT4O`cDnI-Z|4zt2$yD#0~9aEdid*7GN zpRsqP>)M)|WAVqn@A^o1j_q`o`Bc!3QJ+)90Y*hJdx-!h^{})59=>d}b9W|o4by*6<4ZRBk^#W%ZZa Ye-k|6Ht(9w47GhPe-}yfrCKt<-!l@Li2wiq diff --git a/mutt_install.sh b/mutt_install.sh index c9ac842..53be42b 100755 --- 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 < /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 index cfae388..e1be72e 100755 --- 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