From 458ae95c95671899f9cf4ad611112eecc2102b5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Guth?= Date: Sun, 18 Feb 2018 15:37:51 +0100 Subject: [PATCH 1/2] Add separate login to account creation queries This is first working version of an added login query to the account creation process. It fixes the first part of #6, but there still needs to be more testing for the second part of that issue, which concerns creating accounts with domains not listed in domain.csv. --- autoconf/mutt_profile | 2 +- autoconf/offlineimap_profile | 2 +- mutt-wizard.sh | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/autoconf/mutt_profile b/autoconf/mutt_profile index ac8dc90..6983f5b 100644 --- a/autoconf/mutt_profile +++ b/autoconf/mutt_profile @@ -2,7 +2,7 @@ # muttrc file for account $title set realname = "$realname" set from = "$fulladdr" -set smtp_url = "smtp://$fulladdr@$smtp:$sport/" +set smtp_url = "smtp://$login@$smtp:$sport/" set sendmail = "/usr/bin/msmtp -a $title" set folder = "~/.mail/$title" set header_cache = ~/.config/mutt/accounts/$title/cache/headers diff --git a/autoconf/offlineimap_profile b/autoconf/offlineimap_profile index 8311e1c..01b572c 100644 --- a/autoconf/offlineimap_profile +++ b/autoconf/offlineimap_profile @@ -5,7 +5,7 @@ remoterepository = $title-remote [Repository $title-remote] type = $type -remoteuser = $fulladdr +remoteuser = $login sslcacerfile = /etc/ssl/cets/ca-certificates.crt remotepasseval = mailpasswd("$title") remotehost = $imap diff --git a/mutt-wizard.sh b/mutt-wizard.sh index 559c19d..2ed1702 100755 --- a/mutt-wizard.sh +++ b/mutt-wizard.sh @@ -109,6 +109,7 @@ EOF 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 3>&1 1>&2 2>&3 3>&- ) title=$( dialog --title "Luke's mutt/offlineIMAP autoconfig" --inputbox "Give a short, one-word name for this email account that will differentiate it from other email accounts." 10 60 3>&1 1>&2 2>&3 3>&- ) +login=$(dialog --title "Luke's mutt/offlineIMAP autoconfig" --inputbox "Enter your login." 10 60 3>&1 1>&2 2>&3 3>&- ) # Sets the repo type and other variables for the sed regex. if [[ "$service" == "gmail.com" ]]; then @@ -128,8 +129,8 @@ replacement=" s/\$smtp/$smtp/g; s/\$sport/$sport/g; s/\$type/$type/g; + s/\$login/$login/g; /$delet/d" - # Gets the first unused shortcut number in the muttrc and puts it in $idnum. cat "$muttdir"personal.muttrc | grep i[0-9] | awk '{print $3}' | sed -e 's/i//g' > /tmp/mutt_used echo -e "1\n2\n3\n4\n5\n6\n7\n8\n9" > /tmp/mutt_all_possible From 90fe2383c0b25d6011405e2863526fcc539998b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Guth?= Date: Sun, 18 Feb 2018 16:53:26 +0100 Subject: [PATCH 2/2] Use $fulladdr if no login is given This should resolve #6. --- mutt-wizard.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mutt-wizard.sh b/mutt-wizard.sh index 2ed1702..107d1ec 100755 --- a/mutt-wizard.sh +++ b/mutt-wizard.sh @@ -109,7 +109,7 @@ EOF 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 3>&1 1>&2 2>&3 3>&- ) title=$( dialog --title "Luke's mutt/offlineIMAP autoconfig" --inputbox "Give a short, one-word name for this email account that will differentiate it from other email accounts." 10 60 3>&1 1>&2 2>&3 3>&- ) -login=$(dialog --title "Luke's mutt/offlineIMAP autoconfig" --inputbox "Enter your login." 10 60 3>&1 1>&2 2>&3 3>&- ) +login=$(dialog --title "Luke's mutt/offlineIMAP autoconfig" --inputbox "Enter your login for the \"$title\" account.\n(If left empty, the full email address will be used instead.)" 10 60 3>&1 1>&2 2>&3 3>&- ) # Sets the repo type and other variables for the sed regex. if [[ "$service" == "gmail.com" ]]; then @@ -119,6 +119,10 @@ if [[ "$service" == "gmail.com" ]]; type="IMAP" delet="Gmail]\/" fi +if [[ -z "$login" ]]; + then + login=$fulladdr +fi # The replacements replacement=" s/\$realname/$realname/g;