cruxports/mblaze/mcom.patch

39 lines
1.4 KiB
Diff

--- a/mcom 2024-09-13 15:45:12.000000000 +0000
+++ b/mcom 2024-09-14 19:21:01.680579567 +0000
@@ -12,13 +12,13 @@
notmine() {
mine="$(maddr -a -h local-mailbox:alternate-mailboxes: "$MBLAZE/profile")"
- grep -Fv -e "$mine"
+ grep -Fvi -e "$mine"
}
replyfrom() {
addrs="$(maddr -a -h reply-from: "$MBLAZE/profile")"
[ -z "$addrs" ] && addrs="$(maddr -a -h alternate-mailboxes: "$MBLAZE/profile")"
- grep -F -e "$addrs"
+ grep -Fi -e "$addrs"
}
ouniq() {
@@ -134,6 +134,19 @@
"$draft" 1>&2
exit 1
fi
+ outbox=$(mhdr -h outbox "$MBLAZE/profile" | sed "s:^~/:$HOME/:")
+ anyout=$(basename $outbox)
+ if [ -n "$(dirname "$draft" | grep "$anyout/cur$")" ]; then
+ newdraft=$(true | mdeliver -v -c -XD "$outbox")
+ if [ -z "$newdraft" ]; then
+ printf '%s\n' "$0: failed to load draft for editing." 1>&2
+ exit 1
+ fi
+ sed "s/^\(Message-Id: \).*/\1$(mgenmid 2>/dev/null)/" $draft \
+ > $newdraft
+ sed -i "s/^\(Date: \).*/\1$(mdate)/" $newdraft
+ draft=$newdraft
+ fi
echo "using draft $draft"
shift
fi