mirror of https://github.com/leahneukirchen/mblaze
Compare commits
91 Commits
Author | SHA1 | Date |
---|---|---|
|
6adf988980 | 24 hours ago |
|
b078f8c19e | 1 day ago |
|
d5e202b30f | 4 weeks ago |
|
a4502e83c4 | 1 month ago |
|
cf5493bb19 | 3 months ago |
|
76f5656401 | 5 months ago |
|
5310c4ea38 | 9 months ago |
|
59ee2e0ab9 | 11 months ago |
|
07d064fc11 | 11 months ago |
|
75de7d47da | 11 months ago |
|
43f2cb8b49 | 11 months ago |
|
23a9e7022e | 12 months ago |
|
ce435c8f6f | 1 year ago |
|
786238551a | 1 year ago |
|
1838158ef1 | 1 year ago |
|
cccf01cb9a | 2 years ago |
|
2365f48f06 | 2 years ago |
|
74e77845c3 | 2 years ago |
|
1babebc12c | 2 years ago |
|
8d543fdb21 | 2 years ago |
|
9d66764434 | 2 years ago |
|
e6813fd07c | 2 years ago |
|
877569a6f3 | 2 years ago |
|
bbc754e2a1 | 2 years ago |
|
bb3dacc604 | 2 years ago |
|
793e22ecb7 | 2 years ago |
|
47c5707d50 | 2 years ago |
|
cd5bc471f3 | 2 years ago |
|
e951b0ba27 | 2 years ago |
|
fa27d73ddd | 2 years ago |
|
3496545358 | 2 years ago |
|
a60147f633 | 3 years ago |
|
e1e5bfe5ff | 3 years ago |
|
e44aaad66e | 3 years ago |
|
b962fb6be0 | 3 years ago |
|
958e3e08bd | 3 years ago |
|
fcd8428b72 | 3 years ago |
|
41bd429452 | 3 years ago |
|
4be6e0ce91 | 3 years ago |
|
4ccf2f08c1 | 3 years ago |
|
65d43e3cea | 3 years ago |
|
386b65fcb4 | 3 years ago |
|
014f82ef0c | 3 years ago |
|
d324b92dd4 | 3 years ago |
|
0370916357 | 3 years ago |
|
5c7432aa7b | 3 years ago |
|
4f1f0ea2b3 | 3 years ago |
|
0ed7f72d31 | 3 years ago |
|
4e0de11300 | 3 years ago |
|
9713264f70 | 3 years ago |
|
23941c6c19 | 3 years ago |
|
6e8e4e01ed | 3 years ago |
|
6684f74f07 | 3 years ago |
|
605509cc06 | 3 years ago |
|
2b517f97c0 | 3 years ago |
|
c4008e43d9 | 3 years ago |
|
ce900601cb | 3 years ago |
|
41c681362d | 3 years ago |
|
8ba44643e4 | 3 years ago |
|
669af4ffca | 3 years ago |
|
7d04932813 | 3 years ago |
|
5b52110399 | 3 years ago |
|
93e8a4a892 | 3 years ago |
|
e8981b723d | 3 years ago |
|
709f8f1121 | 3 years ago |
|
41cf6272a5 | 3 years ago |
|
ff7537f6a7 | 3 years ago |
|
741972a416 | 3 years ago |
|
c2d497b139 | 3 years ago |
|
2d6de31cd7 | 3 years ago |
|
e96f0707de | 3 years ago |
|
318ac214f1 | 3 years ago |
|
8e0d57425f | 3 years ago |
|
4fcb4ae0a4 | 3 years ago |
|
8ad63494bf | 3 years ago |
|
c525c0097e | 4 years ago |
|
f95439a988 | 4 years ago |
|
bc021c53b6 | 4 years ago |
|
6a8543e321 | 4 years ago |
|
c43538fae9 | 4 years ago |
|
5167bbfe39 | 4 years ago |
|
5e6151e3bf | 4 years ago |
|
48c20b7efa | 4 years ago |
|
a825b4f8f4 | 4 years ago |
|
b076d09f3a | 4 years ago |
|
5d8f070e26 | 4 years ago |
|
4d566a6afe | 4 years ago |
|
0180f649d2 | 4 years ago |
|
02e4cf4001 | 4 years ago |
|
50dfdf5605 | 4 years ago |
|
d2621a715b | 4 years ago |
@ -0,0 +1,58 @@
|
||||
#!/bin/sh
|
||||
# mmailto mailto:... - mailto: handler spawning mcom in a terminal emulator
|
||||
|
||||
tryterm() {
|
||||
if [ -z "$TERMINAL" ] && command -v "$1" >/dev/null; then
|
||||
TERMINAL="$*"
|
||||
fi
|
||||
}
|
||||
|
||||
tryterm x-terminal-emulator
|
||||
tryterm urxvt
|
||||
tryterm xterm
|
||||
|
||||
if [ -z "$TERMINAL" ]; then
|
||||
echo 'No terminal emulator found, set $TERMINAL.' 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
IFS='
|
||||
'
|
||||
|
||||
exec $TERMINAL -e mcom $(
|
||||
awk -v url="$1" '
|
||||
|
||||
function decode(s) {
|
||||
hexdigits = "0123456789abcdef"
|
||||
for (i = 1; i < length(s); i++) {
|
||||
if (substr(s, i, 3) ~ /%[0-9a-fA-F][0-9a-fA-F]/) {
|
||||
c = sprintf("%c", (index(hexdigits, tolower(substr(s, i+1, 1)))-1) * 16 + \
|
||||
index(hexdigits, tolower(substr(s, i+2, 1)))-1)
|
||||
if (c == "\n") c = " "
|
||||
s = substr(s, 1, i-1) c substr(s, i+3)
|
||||
i += 2
|
||||
}
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
BEGIN {
|
||||
url = decode(url)
|
||||
sub(/^mailto:/, "", url)
|
||||
split(url, parts, "?")
|
||||
to = parts[1]
|
||||
split(parts[2], fields, "&")
|
||||
args[1] = to
|
||||
for (i in fields) {
|
||||
split(fields[i], kv, "=")
|
||||
if (kv[1] != "r") {
|
||||
args[length(args)+1] = "-" kv[1]
|
||||
args[length(args)+1] = kv[2]
|
||||
}
|
||||
}
|
||||
for (i in args) {
|
||||
print decode(args[i])
|
||||
}
|
||||
}
|
||||
'
|
||||
)
|
@ -0,0 +1,18 @@
|
||||
#!/bin/sh -e
|
||||
# mopenall [MSG] - open every attachements in xdg-open
|
||||
|
||||
[ "$#" -eq 0 ] && set -- .
|
||||
|
||||
f="$(mseq "$1" | sed 1q)"
|
||||
[ -z "$f" ] && printf 'No message %s.\n' "$1" 1>&2 && exit 1
|
||||
|
||||
dir=$(mktemp -d -t menter.XXXXXX)
|
||||
cd "$dir"
|
||||
mshow -t "$1"
|
||||
mshow -B -x "$1" 2>/dev/null
|
||||
for f in * ; do
|
||||
xdg-open "$f" &
|
||||
done
|
||||
wait
|
||||
echo rm -r "$dir"
|
||||
rm -r "$dir"
|
@ -0,0 +1,26 @@
|
||||
#!/bin/sh -e
|
||||
cd ${0%/*}
|
||||
. ./lib.sh
|
||||
|
||||
plan 9
|
||||
|
||||
cat <<EOF >tmp
|
||||
Header: foo
|
||||
Header2: bar
|
||||
Header-Three: quux
|
||||
Header_Four: ding
|
||||
|
||||
Body
|
||||
EOF
|
||||
|
||||
check_same 'Header' 'mhdr -h Header ./tmp' 'echo foo'
|
||||
check_same 'Header2' 'mhdr -h Header2 ./tmp' 'echo bar'
|
||||
check_same 'Header-Three' 'mhdr -h Header-Three ./tmp' 'echo quux'
|
||||
check_same 'Header_Four' 'mhdr -h Header_Four ./tmp' 'echo ding'
|
||||
|
||||
check_same 'header' 'mhdr -h header ./tmp' 'echo foo'
|
||||
check_same 'header2' 'mhdr -h header2 ./tmp' 'echo bar'
|
||||
check_same 'header-Three' 'mhdr -h header-Three ./tmp' 'echo quux'
|
||||
check_same 'header_Four' 'mhdr -h header_Four ./tmp' 'echo ding'
|
||||
|
||||
check 'issue 235' 'mhdr ./tmp |grep -i header_four'
|
@ -0,0 +1,41 @@
|
||||
#!/bin/sh -e
|
||||
cd ${0%/*}
|
||||
. ./lib.sh
|
||||
plan 2
|
||||
|
||||
# Nested MIME where the outer boundary is a prefix of the inner boundary
|
||||
cat <<EOF >tmp
|
||||
MIME-Version: 1.0
|
||||
Content-type: multipart/mixed; charset=iso-8859-1;
|
||||
boundary="_xec5AqfRYxfhARmklHx"
|
||||
|
||||
|
||||
--_xec5AqfRYxfhARmklHx
|
||||
Content-type: Multipart/alternative; charset=iso-8859-1;
|
||||
boundary="_xec5AqfRYxfhARmklHx8"
|
||||
|
||||
|
||||
--_xec5AqfRYxfhARmklHx8
|
||||
Content-type: text/plain; charset=iso-8859-1
|
||||
Content-Transfer-Encoding: 7bit
|
||||
Content-Disposition: inline
|
||||
|
||||
foo
|
||||
--_xec5AqfRYxfhARmklHx8
|
||||
Content-type: text/html; charset=iso-8859-1
|
||||
Content-Transfer-Encoding: Quoted-printable
|
||||
Content-Disposition: inline
|
||||
|
||||
bar
|
||||
--_xec5AqfRYxfhARmklHx8--
|
||||
|
||||
--_xec5AqfRYxfhARmklHx
|
||||
Content-Type: application/zip
|
||||
Content-Transfer-Encoding: Base64
|
||||
|
||||
quux
|
||||
--_xec5AqfRYxfhARmklHx--
|
||||
EOF
|
||||
|
||||
check 'nested mail has 5 attachments' 'mshow -t ./tmp | wc -l | grep 6'
|
||||
check 'nested mail has text/html attachment' 'mshow -t ./tmp | grep text/html'
|
@ -0,0 +1,53 @@
|
||||
#!/bin/sh -e
|
||||
cd ${0%/*}
|
||||
. ./lib.sh
|
||||
plan 3
|
||||
|
||||
# Mail with \n\n and \r\n\r\n
|
||||
cr=$(printf '\r')
|
||||
cat <<EOF >tmp
|
||||
Content-Type: multipart/form-data; boundary=------------------------55a586f81559face$cr
|
||||
$cr
|
||||
--------------------------55a586f81559face$cr
|
||||
Content-Disposition: form-data; name="a"; filename="foo"$cr
|
||||
Content-Type: application/octet-stream$cr
|
||||
$cr
|
||||
foo$cr
|
||||
|
||||
previously there are two NL$cr
|
||||
$cr
|
||||
--------------------------55a586f81559face$cr
|
||||
Content-Disposition: form-data; name="a"; filename="bar"$cr
|
||||
Content-Type: application/octet-stream$cr
|
||||
$cr
|
||||
bar$cr
|
||||
$cr
|
||||
--------------------------55a586f81559face--$cr
|
||||
EOF
|
||||
|
||||
check 'mail has 3 attachments' 'mshow -t ./tmp | wc -l | grep 4'
|
||||
check 'mail attachment foo has size 35' 'mshow -t ./tmp | grep size=35.*name=\"foo\"'
|
||||
|
||||
# Mail with linebreaks in base64 quartets
|
||||
cat <<EOF >tmp
|
||||
Subject: base64
|
||||
MIME-Version: 1.0
|
||||
Content-Type: multipart/mixed; boundary="----_=_2f8f1e2243b55f8618eaf0d9_=_"
|
||||
|
||||
This is a multipart message in MIME format.
|
||||
|
||||
------_=_2f8f1e2243b55f8618eaf0d9_=_
|
||||
Content-Disposition: attachment; filename=base64
|
||||
Content-Type: application/binary
|
||||
Content-Transfer-Encoding: base64
|
||||
|
||||
dGhp
|
||||
cyBpc
|
||||
yBzb21
|
||||
lIGJhc2
|
||||
U2NAo=
|
||||
|
||||
------_=_2f8f1e2243b55f8618eaf0d9_=_--
|
||||
EOF
|
||||
|
||||
check 'mail decodes correctly' 'mshow -O ./tmp 2 | grep -q "this is some base64"'
|
@ -0,0 +1,26 @@
|
||||
#!/bin/sh -e
|
||||
cd ${0%/*}
|
||||
. ./lib.sh
|
||||
plan 2
|
||||
|
||||
cat <<EOF >tmp.1
|
||||
Subject: message 1
|
||||
|
||||
This is message 1.
|
||||
EOF
|
||||
|
||||
cat <<EOF >tmp.2
|
||||
Subject: message 2
|
||||
|
||||
This is message 2. It has a trailing empty line.
|
||||
|
||||
EOF
|
||||
|
||||
printf >tmp.3 'Subject: message 3
|
||||
|
||||
This is message 3. It has a no trailing newline, oops.'
|
||||
|
||||
mexport ./tmp.1 ./tmp.2 ./tmp.3 >./tmp.mbox
|
||||
|
||||
check 'generated mbox has 16 lines' 'cat ./tmp.mbox | wc -l | grep 16'
|
||||
check 'generated mbox has 7 empty lines' 'grep -c "^$" ./tmp.mbox | grep 7'
|
@ -0,0 +1,85 @@
|
||||
#!/bin/sh -e
|
||||
cd ${0%/*}
|
||||
. ./lib.sh
|
||||
plan 9
|
||||
|
||||
rm -rf test.dir
|
||||
mkdir test.dir
|
||||
cd test.dir
|
||||
|
||||
mmkdir inbox
|
||||
|
||||
cat <<EOF >tmp.1
|
||||
Subject: message 1
|
||||
|
||||
This is message 1.
|
||||
EOF
|
||||
|
||||
cat <<EOF >tmp.2
|
||||
Subject: message 2
|
||||
|
||||
This is message 2. It has a trailing empty line.
|
||||
|
||||
EOF
|
||||
|
||||
printf >tmp.3 'Subject: message 3
|
||||
|
||||
This is message 3. It has a no trailing newline, oops.'
|
||||
|
||||
cat <<EOF >tmp.4
|
||||
Subject: message 4
|
||||
|
||||
|
||||
|
||||
This is message 4. It has multiple trailing empty lines.
|
||||
|
||||
|
||||
EOF
|
||||
|
||||
mexport ./tmp.1 | mdeliver -M inbox/
|
||||
check 'message 1 is delivered verbatim via mbox' 'cmp ./tmp.1 ./inbox/new/*:2,'
|
||||
rm -f ./inbox/new/*
|
||||
|
||||
mexport ./tmp.2 | mdeliver -M inbox/
|
||||
check 'message 2 is delivered verbatim via mbox' 'cmp ./tmp.2 ./inbox/new/*:2,'
|
||||
rm -f ./inbox/new/*
|
||||
|
||||
mexport ./tmp.3 | mdeliver -M inbox/
|
||||
check 'message 3 gets a newline via mbox' 'awk 1 ./tmp.3 | cmp - ./inbox/new/*:2,'
|
||||
rm -f ./inbox/new/*
|
||||
|
||||
mexport ./tmp.4 | mdeliver -M inbox/
|
||||
check 'message 4 gets delivered verbatim via mbox' 'cmp ./tmp.4 ./inbox/new/*:2,'
|
||||
rm -f ./inbox/new/*
|
||||
|
||||
mdeliver inbox/ <./tmp.1
|
||||
check 'message 1 is delivered verbatim via stdin' 'cmp ./tmp.1 ./inbox/new/*:2,'
|
||||
rm -f ./inbox/new/*
|
||||
|
||||
mdeliver inbox/ <./tmp.2
|
||||
check 'message 2 is delivered verbatim via stdin' 'cmp ./tmp.2 ./inbox/new/*:2,'
|
||||
rm -f ./inbox/new/*
|
||||
|
||||
mdeliver inbox/ <./tmp.3
|
||||
check 'message 3 gets a newline via stdin' 'cmp ./tmp.3 ./inbox/new/*:2,'
|
||||
rm -f ./inbox/new/*
|
||||
|
||||
mdeliver inbox/ <./tmp.4
|
||||
check 'message 4 is delivered verbatim via stdin' 'cmp ./tmp.4 ./inbox/new/*:2,'
|
||||
rm -f ./inbox/new/*
|
||||
|
||||
|
||||
cat <<EOF >tmp.mbox
|
||||
From nobody Thu Jan 1 00:59:59 1970
|
||||
Subject: message 1
|
||||
|
||||
This is message 1.
|
||||
From nobody Thu Jan 1 00:59:59 1970
|
||||
Subject: message 2
|
||||
|
||||
This is message 2.
|
||||
|
||||
EOF
|
||||
|
||||
mdeliver -M inbox/ <./tmp.mbox
|
||||
check 'mdeliver -M is tolerant with missing empty lines' 'ls inbox/new | wc -l | grep 2'
|
@ -0,0 +1,166 @@
|
||||
#!/bin/sh -e
|
||||
cd ${0%/*}
|
||||
. ./lib.sh
|
||||
plan 12
|
||||
|
||||
rm -rf test.dir
|
||||
mkdir test.dir
|
||||
(
|
||||
cd test.dir
|
||||
|
||||
export PIPE_CONTENTTYPE='text/plain; format=flowed'
|
||||
export COLUMNS=80
|
||||
|
||||
cat <<! >a
|
||||
this
|
||||
is
|
||||
flowed.
|
||||
!
|
||||
cat <<! >b
|
||||
this is flowed.
|
||||
!
|
||||
check 'simple reflow' 'mflow <a | cmp - b'
|
||||
|
||||
cat <<! >a
|
||||
this
|
||||
is
|
||||
two spaces.
|
||||
!
|
||||
cat <<! >b
|
||||
this is two spaces.
|
||||
!
|
||||
check 'simple space stuffing' 'mflow <a | cmp - b'
|
||||
|
||||
cat <<! >a
|
||||
this
|
||||
is
|
||||
flowed.
|
||||
this is fixed.
|
||||
!
|
||||
cat <<! >b
|
||||
this is flowed.
|
||||
this is fixed.
|
||||
!
|
||||
check 'simple fixed' 'mflow <a | cmp - b'
|
||||
|
||||
cat <<! >a
|
||||
> this
|
||||
> is
|
||||
> quoted.
|
||||
this
|
||||
is
|
||||
unquoted.
|
||||
!
|
||||
cat <<! >b
|
||||
> this is quoted.
|
||||
this is unquoted.
|
||||
!
|
||||
check 'simple quoted' 'mflow <a | cmp - b'
|
||||
|
||||
(
|
||||
export PIPE_CONTENTTYPE='text/plain; format=flowed; delsp=yes'
|
||||
|
||||
cat <<! >a
|
||||
> this
|
||||
> is
|
||||
> delsp.
|
||||
|
||||
> double
|
||||
> spaced
|
||||
!
|
||||
cat <<! >b
|
||||
> thisisdelsp.
|
||||
|
||||
> double spaced
|
||||
!
|
||||
check 'simple delsp' 'mflow <a | cmp - b'
|
||||
)
|
||||
|
||||
cat <<! >a
|
||||
this
|
||||
is
|
||||
way more than eighty chars which is the terminal width to flow.
|
||||
this
|
||||
is
|
||||
way more than eighty chars which is the terminal width to flow.
|
||||
!
|
||||
cat <<! >b
|
||||
this is way more than eighty chars which is the terminal width to flow. this is
|
||||
way more than eighty chars which is the terminal width to flow.
|
||||
!
|
||||
check 'simple wrap' 'mflow <a | cmp - b'
|
||||
|
||||
cat <<! >a
|
||||
this
|
||||
is
|
||||
way more than eighty chars which is the terminal width to flow.
|
||||
averylongwordcomeshere.
|
||||
this
|
||||
is
|
||||
way more than eighty chars which is the terminal width to flow.
|
||||
!
|
||||
cat <<! >b
|
||||
this is way more than eighty chars which is the terminal width to flow.
|
||||
averylongwordcomeshere. this is way more than eighty chars which is the
|
||||
terminal width to flow.
|
||||
!
|
||||
check 'more complex wrap' 'mflow <a | cmp - b'
|
||||
|
||||
cat <<! >a
|
||||
foo
|
||||
bar.
|
||||
|
||||
quux.
|
||||
!
|
||||
cat <<! >b
|
||||
foo bar.
|
||||
|
||||
quux.
|
||||
!
|
||||
check 'space before empty line' 'mflow <a | cmp - b'
|
||||
|
||||
cat <<! >a
|
||||
Aaaaa bbbbb ccccc ddddd eeeee aaaaa bbbbb ccccc ddddd eeeee
|
||||
aaaaa bbbbb ccccc ddddd eeeee aaaaa bbbbb ccccc ddddd eeeee
|
||||
aaaaa bbbbb ccccc
|
||||
ffffff gggggg hhhhhh iiiiii.
|
||||
!
|
||||
cat <<! >b
|
||||
Aaaaa bbbbb ccccc ddddd eeeee aaaaa bbbbb ccccc ddddd eeeee aaaaa bbbbb ccccc
|
||||
ddddd eeeee aaaaa bbbbb ccccc ddddd eeeee aaaaa bbbbb ccccc ffffff gggggg
|
||||
hhhhhh iiiiii.
|
||||
!
|
||||
check 'fixed lines are wrapped too' 'mflow <a | cmp - b'
|
||||
|
||||
cat <<! >a
|
||||
some
|
||||
wrapped.
|
||||
--
|
||||
signature
|
||||
!
|
||||
cat <<! >b
|
||||
some wrapped.
|
||||
--
|
||||
signature
|
||||
!
|
||||
check 'passes usenet signature marker as is' 'mflow <a | cmp - b'
|
||||
|
||||
cat <<! >a
|
||||
some regular text being force wrapped because the line is way too long oh no who writes so long lines.
|
||||
!
|
||||
cat <<! >b
|
||||
some regular text being force wrapped because the line is way too long oh no
|
||||
who writes so long lines.
|
||||
!
|
||||
check 'force wrapping' 'mflow -f <a | cmp - b'
|
||||
|
||||
cat <<! >a
|
||||
> some regular text being force wrapped because the line is way too long oh no who writes so long lines.
|
||||
!
|
||||
cat <<! >b
|
||||
> some regular text being force wrapped because the line is way too long oh no
|
||||
> who writes so long lines.
|
||||
!
|
||||
check 'force wrapping of quoted text' 'mflow -f <a | cmp - b'
|
||||
|
||||
)
|
Loading…
Reference in New Issue