summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-01-23 18:58:42 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-01-23 18:58:42 +0900
commit1c837bbf6f10c008623fd7cf3bd9386e64f0e786 (patch)
tree5031ec8644be1e5d6fab7390466615527e27cef7
parent50d24d108c9b85d7242e8544fa9314d69a1e0b1f (diff)
modified bin/mw, modified mw.1
-rwxr-xr-xbin/mw28
-rw-r--r--mw.123
2 files changed, 40 insertions, 11 deletions
diff --git a/bin/mw b/bin/mw
index 2feadb7..1e29076 100755
--- a/bin/mw
+++ b/bin/mw
@@ -131,6 +131,30 @@ EOF
iport="${iport:-$iportsugg}"
}
+userinfo() {
+ if [ -z "${fulladdr+x}" ]; then
+ echo "Select the account you would like to delete (by number):"
+ list || exit 1
+ read -r input
+ match="^\s*$input\s\+"
+ else
+ match="\s\+$fulladdr$"
+ getaccounts
+ fi
+
+ fulladdr="$(echo "$accounts" | grep "$match" | grep -o "\S*@\S*")"
+
+ [ -z "$fulladdr" ] && echo "$fulladdr is not a valid account name." && return 1
+
+ awk -v user="$fulladdr" '
+ BEGIN {found = 0; in_block = 0; block = ""}
+ /^account / {if (found) {exit} in_block = 1; block = ""} # Start a new block, stop if user found
+ in_block {block = block $0 "\n"} # Append lines to the block
+ in_block && /^user / && $2 == user {found = 1} # Mark when the user is found
+ END {if (found) printf "%s", block} # Print the stored block if found
+ ' "$msmtprc"
+}
+
delete() {
if [ -z "${fulladdr+x}" ]; then
echo "Select the account you would like to delete (by number):"
@@ -340,7 +364,7 @@ reorder() {
' "$tempfile" >>"$muttrc"
}
-while getopts "cdfhloprTXYa:D:i:I:m:n:N:P:s:S:t:x:y:" o; do case "${o}" in
+while getopts "cdfhloprTuXYa:D:i:I:m:n:N:P:s:S:t:x:y:" o; do case "${o}" in
c) setact create ;;
d) setact delete ;;
f)
@@ -410,6 +434,7 @@ while getopts "cdfhloprTXYa:D:i:I:m:n:N:P:s:S:t:x:y:" o; do case "${o}" in
setact toggle
cronmin="$OPTARG"
;;
+ u) setact info ;;
x)
setact add
password="$OPTARG"
@@ -430,6 +455,7 @@ case "$action" in
add) checkbasics && askinfo && getboxes && getprofiles && finalize ;;
create) basicdir ;;
delete) delete ;;
+info) userinfo ;;
list) list ;;
reorder) reorder ;;
sync)
diff --git a/mw.1 b/mw.1
index ebe5bb1..c978330 100644
--- a/mw.1
+++ b/mw.1
@@ -36,11 +36,8 @@ pick an already configured account and remove its configuration
.B -D your@email.com
remove a configured account without confirmation
.TP
-.B -y your@email.com
-download and upload mail for an email account
-.TP
-.B -Y
-sync all email accounts
+.B -r
+reorder account shortcut numbers
.TP
.B -t 15
toggle a cronjob that syncs your mail every 15 minutes (or any other number under 60)
@@ -48,20 +45,26 @@ toggle a cronjob that syncs your mail every 15 minutes (or any other number unde
.B -T
toggle a cronjob without specifying minutes between sync
.TP
-.B -r
-reorder account shortcut numbers
+.B -u
+show an email account information
+.TP
+.B -y your@email.com
+download and upload mail for an email account
+.TP
+.B -Y
+sync all email accounts
.SH OPTIONS FOR ADDING ACCOUNTS
These can be specified on the command line, otherwise, you will be prompted for what is necessary. mutt-wizard knows the IMAP/SMTP server information for most email providers, so specifying them is usually redundant.
.TP
+.B -m number
+Set a maximum number of messages to be stored offline.
+.TP
.B -n Billy
Real name which will appear in emails. Should be put in quotes if multiple words.
.TP
.B -N billy
Account logon/username if required and different from email address.
.TP
-.B -m number
-Set a maximum number of messages to be stored offline.
-.TP
.B -i
IMAP/POP server address
.TP