Browse Source

reordering, services file added

tags/v3.1
Luke 6 years ago
parent
commit
4b9b111d27
6 changed files with 27 additions and 20 deletions
  1. +0
    -8
      README.md
  2. +2
    -1
      autoconf/domains.csv
  3. +7
    -0
      autoconf/services.csv
  4. BIN
      credentials/imappwd.pyc
  5. +17
    -11
      mutt_install.sh
  6. +1
    -0
      removeaccount.sh

+ 0
- 8
README.md View File

@@ -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

+ 2
- 1
autoconf/domains.csv View File

@@ -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

+ 7
- 0
autoconf/services.csv View File

@@ -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,,,

BIN
credentials/imappwd.pyc View File


+ 17
- 11
mutt_install.sh View File

@@ -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

+ 1
- 0
removeaccount.sh View File

@@ -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


Loading…
Cancel
Save