Hi,
  I've attached an update of mutt-wizard to latest commit.

Along with that, I've added openbsd specific patches for
account ordering and mailbox loading.

Another addition is to add gpg-wks functions. That part of
the patch has been sent upstream.

Things I've checked to work:
 - adding multiple accounts
 - switching accounts
 - mail searching using notmuch
 - publishing keys to wkd

Cheers,
Aisha 


diff --git a/mail/mutt-wizard/Makefile b/mail/mutt-wizard/Makefile
index 531c01d268b..2e18298200c 100644
--- a/mail/mutt-wizard/Makefile
+++ b/mail/mutt-wizard/Makefile
@@ -2,11 +2,11 @@
 
 COMMENT =      neomutt and isync configuration with good defaults
 CATEGORIES =   mail
-DISTNAME =     mutt-wizard-3.2.1.20211006
+DISTNAME =     mutt-wizard-3.2.1.20211101
 
 GH_ACCOUNT =   LukeSmithxyz
 GH_PROJECT =   mutt-wizard
-GH_COMMIT =    85c5d01dcd09058094a8a180c38751e88416b1f4
+GH_COMMIT =    e6087481ad26e7a328a11d9537dcce18982bbc5e
 
 EPOCH =                0
 
@@ -27,7 +27,7 @@ USE_GMAKE =   Yes
 
 FAKE_FLAGS =   PREFIX=${TRUEPREFIX} MANPREFIX=${PREFIX}/man
 
-post-patch:
+post-extract:
        cd ${WRKSRC} && \
        sed -e "s/\<grep\>/ggrep/g" -i bin/mw
 
diff --git a/mail/mutt-wizard/distinfo b/mail/mutt-wizard/distinfo
index f69e69329eb..ad45b93ada1 100644
--- a/mail/mutt-wizard/distinfo
+++ b/mail/mutt-wizard/distinfo
@@ -1,2 +1,2 @@
-SHA256 (mutt-wizard-3.2.1.20211006-85c5d01d.tar.gz) = 
NzpGCHDzOL48MRwgueOaZmMCW3eSWHmpSYIZSjcdUIA=
-SIZE (mutt-wizard-3.2.1.20211006-85c5d01d.tar.gz) = 34101
+SHA256 (mutt-wizard-3.2.1.20211101-e6087481.tar.gz) = 
2uqXKp9WtNpYOG8LaoOxft3/fUJmp7gP9lH6+x489Bs=
+SIZE (mutt-wizard-3.2.1.20211101-e6087481.tar.gz) = 34067
diff --git a/mail/mutt-wizard/patches/patch-bin_mailsync 
b/mail/mutt-wizard/patches/patch-bin_mailsync
new file mode 100644
index 00000000000..0c9028919cb
--- /dev/null
+++ b/mail/mutt-wizard/patches/patch-bin_mailsync
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: bin/mailsync
+--- bin/mailsync.orig
++++ bin/mailsync
+@@ -39,7 +39,7 @@ case "$(uname)" in
+                       *systemd*|*openrc*) export 
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus ;;
+               esac
+               # remember if a display server is running since `ps` doesn't 
always contain a display
+-              pgrepoutput="$(pgrep -a X\(org\|wayland\))"
++              pgrepoutput="$(pgrep X\(org\|wayland\))"
+               displays="$(echo "$pgrepoutput" | grep -wo "[0-9]*:[0-9]\+" | 
sort -u)"
+               notify() { [ -n "$pgrepoutput" ] && for x in ${displays:-0:}; do
+                               export DISPLAY=$x
diff --git a/mail/mutt-wizard/patches/patch-bin_mw 
b/mail/mutt-wizard/patches/patch-bin_mw
new file mode 100644
index 00000000000..4bef544482e
--- /dev/null
+++ b/mail/mutt-wizard/patches/patch-bin_mw
@@ -0,0 +1,42 @@
+$OpenBSD$
+
+fix account number switch macro
+fix account deletion
+publish gpg using gpg-wks protocol
+dynamically load mailboxes
+
+Index: bin/mw
+--- bin/mw.orig
++++ bin/mw
+@@ -108,6 +108,8 @@ set trash = "+Trash"
+ set record = "+Sent"
+ $extra
+ $synccmd
++macro index \eg \"<enter-command>unset wait_key<enter><shell-escape>gpg 
--list-secret-keys; printf 'Enter email ID of user to publish: '; read eID; 
printf 'Enter fingerprint of GPG key to publish: '; read eFGPT; 
$prefix/libexec/gpg-wks-client --create \\\$eFGPT \\\$eID | msmtp 
--read-envelope-from --read-recipients -a $fulladdr<enter>\"  \"publish GPG key 
to WKS provider\"
++macro index \eh \"<pipe-message>$prefix/libexec/gpg-wks-client --receive | 
msmtp --read-envelope-from --read-recipients -a $fulladdr<enter>\" \"confirm 
GPG publication\"
+ " > "$accdir/$fulladdr.muttrc"
+ 
+       [ ! -f "$muttrc" ] && echo "# vim: filetype=neomuttrc" > "$muttrc"
+@@ -171,7 +173,7 @@ delete() { if [ -z "${fulladdr+x}" ]; then
+ 
+       sed -ibu "/IMAPStore $fulladdr-remote$/,/# End profile/d" "$mbsyncrc" 
2>/dev/null ; rm -f "$mbsyncrc"bu
+       rm -rf "${cachedir:?}/${fulladdr:?}" "$accdir/$fulladdr.muttrc"  
"$accdir/"[0-9]-"$fulladdr.muttrc"
+-      sed -ibu "/\([0-9]-\)\?$fulladdr.muttrc/d" "$muttrc" 2>/dev/null; rm -f 
"$muttrc"bu
++      sed -ibu "/macro.*i[0-9].*$fulladdr.muttrc/d" "$muttrc" 2>/dev/null; rm 
-f "$muttrc"bu
+       sed -ibu "/account $fulladdr$/,/^\(\s*$\|account\)/d" "$msmtprc" 
2>/dev/null; rm -f "$msmtprc"bu
+       sed -ibu "/account $fulladdr$/,/^\(\s*$\|account\)/d" "$mpoprc" 
2>/dev/null; rm -f "$mpoprc"bu
+       pass rm -f "$fulladdr" >/dev/null 2>&1
+@@ -222,11 +224,11 @@ getboxes() { if [ -n "${force+x}" ] ; then
+               mailboxes="$(echo "$info" | ggrep -v HasChildren | sed "s/.*\" 
//;s/\"//g" | tr -d '\r')"
+       fi
+       [ "$type" = "pop" ] && mailboxes="INBOX"
+-      for x in $(sed -n "/^macro.* i[0-9] / s/\(^macro.* i\| .*\)//gp " 
"$muttrc" | sort -u; echo 0); do
++      for x in $(grep -Eo "^macro.* i[0-9] " "$muttrc" | sed "s/^macro.* 
i//g" | sort -u; echo 0); do
+               idnum=$((idnum + 1))
+               [ "$idnum" -eq "$x" ] || break
+       done
+-      toappend="mailboxes $(echo "$mailboxes" | sed "s/^/\"=/;s/$/\"/" | 
paste -sd ' ' - )"
++      toappend="mailboxes \`mdir=$maildir/$fulladdr/; find \$mdir -mindepth 1 
-type d -name cur | sed -e 's:/cur\$:\":' -e \"s:\$mdir:\\\"=:\" | sort | tr 
'\\\n' ' '\`"
+ }
+ 
+ finalize() { echo "$toappend" >> "$accdir/$fulladdr.muttrc"
diff --git a/mail/mutt-wizard/patches/patch-bin_mw.orig 
b/mail/mutt-wizard/patches/patch-bin_mw.orig
new file mode 100644
index 00000000000..510f2a312c8
--- /dev/null
+++ b/mail/mutt-wizard/patches/patch-bin_mw.orig
@@ -0,0 +1,32 @@
+$OpenBSD$
+
+fix account number ordering
+fix account deletion
+dynamically load mailboxes
+
+Index: bin/mw
+--- bin/mw.orig
++++ bin/mw
+@@ -171,7 +171,7 @@ delete() { if [ -z "${fulladdr+x}" ]; then
+ 
+       sed -ibu "/IMAPStore $fulladdr-remote$/,/# End profile/d" "$mbsyncrc" 
2>/dev/null ; rm -f "$mbsyncrc"bu
+       rm -rf "${cachedir:?}/${fulladdr:?}" "$accdir/$fulladdr.muttrc"  
"$accdir/"[0-9]-"$fulladdr.muttrc"
+-      sed -ibu "/\([0-9]-\)\?$fulladdr.muttrc/d" "$muttrc" 2>/dev/null; rm -f 
"$muttrc"bu
++      sed -ibu "/macro.*i[0-9].*$fulladdr.muttrc/d" "$muttrc" 2>/dev/null; rm 
-f "$muttrc"bu
+       sed -ibu "/account $fulladdr$/,/^\(\s*$\|account\)/d" "$msmtprc" 
2>/dev/null; rm -f "$msmtprc"bu
+       sed -ibu "/account $fulladdr$/,/^\(\s*$\|account\)/d" "$mpoprc" 
2>/dev/null; rm -f "$mpoprc"bu
+       pass rm -f "$fulladdr" >/dev/null 2>&1
+@@ -222,11 +222,11 @@ getboxes() { if [ -n "${force+x}" ] ; then
+               mailboxes="$(echo "$info" | ggrep -v HasChildren | sed "s/.*\" 
//;s/\"//g" | tr -d '\r')"
+       fi
+       [ "$type" = "pop" ] && mailboxes="INBOX"
+-      for x in $(sed -n "/^macro.* i[0-9] / s/\(^macro.* i\| .*\)//gp " 
"$muttrc" | sort -u; echo 0); do
++      for x in $(grep -Eo "^macro.* i[0-9] " "$muttrc" | sed "s/^macro.* 
i//g" | sort -u; echo 0); do
+               idnum=$((idnum + 1))
+               [ "$idnum" -eq "$x" ] || break
+       done
+-      toappend="mailboxes $(echo "$mailboxes" | sed "s/^/\"=/;s/$/\"/" | 
paste -sd ' ' - )"
++      toappend="mailboxes \`mdir=$maildir/$fulladdr/; find \$mdir -mindepth 1 
-type d -name cur | sed -e 's:/cur\$:\":' -e \"s:\$mdir:\\\"=:\" | sort | tr 
'\\\n' ' '\`"
+ }
+ 
+ finalize() { echo "$toappend" >> "$accdir/$fulladdr.muttrc"

Reply via email to