mirror of https://github.com/leahneukirchen/mblaze
Compare commits
360 Commits
Author | SHA1 | Date |
---|---|---|
|
6adf988980 | 21 hours ago |
|
b078f8c19e | 22 hours 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 | 12 months 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 |
|
2c8acab338 | 4 years ago |
|
07ee45cf31 | 4 years ago |
|
ccceb10908 | 4 years ago |
|
4763032430 | 4 years ago |
|
6bd687bfdc | 4 years ago |
|
1e9f6cd06b | 4 years ago |
|
6649576fda | 4 years ago |
|
74857db199 | 4 years ago |
|
32b5837bfd | 4 years ago |
|
b41d2efa40 | 4 years ago |
|
92bb41fa73 | 4 years ago |
|
b2a6e3dcc0 | 4 years ago |
|
3f61249c05 | 4 years ago |
|
04ed2d439a | 4 years ago |
|
a02c7e451b | 4 years ago |
|
bb8054c2ff | 4 years ago |
|
fec4e06671 | 4 years ago |
|
7e9e75bd88 | 4 years ago |
|
957c09909d | 4 years ago |
|
d9c3914924 | 4 years ago |
|
96c506085f | 4 years ago |
|
30f3054bac | 4 years ago |
|
b063294daf | 4 years ago |
|
e7442fcc72 | 4 years ago |
|
54283ebeee | 4 years ago |
|
db7b58f24a | 4 years ago |
|
e5206792df | 4 years ago |
|
282de65079 | 4 years ago |
|
3ea0c9c355 | 4 years ago |
|
17fe13a95f | 4 years ago |
|
41a9a6b40d | 4 years ago |
|
d777d370dd | 4 years ago |
|
fb77179bbd | 4 years ago |
|
7cd43f4203 | 4 years ago |
|
b79e38b686 | 4 years ago |
|
0645634733 | 4 years ago |
|
95a9c0837b | 4 years ago |
|
331d0e4680 | 4 years ago |
|
d45d1c4ff5 | 4 years ago |
|
d93c1e2fe4 | 4 years ago |
|
aa2868822b | 4 years ago |
|
8ae4801dd4 | 4 years ago |
|
32f0fcbc0d | 4 years ago |
|
d5afda072b | 4 years ago |
|
4baa330b63 | 4 years ago |
|
d235a3e64c | 4 years ago |
|
482bbffd2c | 4 years ago |
|
1010ae06bf | 4 years ago |
|
b8cf02825a | 4 years ago |
|
28d0d51e34 | 4 years ago |
|
8f0b6e2117 | 4 years ago |
|
3968f2ef03 | 4 years ago |
|
401aa88752 | 4 years ago |
|
eec6a4ebfd | 4 years ago |
|
41c8fefb73 | 4 years ago |
|
61caf5a6a3 | 4 years ago |
|
4927d44d55 | 4 years ago |
|
62da7c59ea | 4 years ago |
|
a5c77c71bc | 4 years ago |
|
e4e15bb4f0 | 4 years ago |
|
d83860c34e | 4 years ago |
|
3663d7365b | 4 years ago |
|
99b7d47a10 | 4 years ago |
|
e56f8ad294 | 4 years ago |
|
3370fd5f70 | 4 years ago |
|
8c8a4bd422 | 4 years ago |
|
d50bb5772a | 4 years ago |
|
eabdda4405 | 4 years ago |
|
604afb5011 | 4 years ago |
|
7e6b1c97e6 | 4 years ago |
|
5885bbe69f | 4 years ago |
|
8c9e0aae05 | 4 years ago |
|
079e423438 | 4 years ago |
|
8d611a8a3d | 4 years ago |
|
dfc18e0040 | 4 years ago |
|
48b490f379 | 4 years ago |
|
6dd0799aab | 4 years ago |
|
582256618a | 4 years ago |
|
83f9794bb0 | 4 years ago |
|
dc15a75b63 | 4 years ago |
|
2636f5127d | 4 years ago |
|
92dd0f7be5 | 4 years ago |
|
113ac5a24d | 4 years ago |
|
1755fa6279 | 4 years ago |
|
da457c51ee | 4 years ago |
|
e0733f187b | 4 years ago |
|
513ac7d002 | 4 years ago |
|
55035ad8b2 | 4 years ago |
|
6705b3ee29 | 5 years ago |
|
3da5f0e391 | 5 years ago |
|
9e91eb6e8b | 5 years ago |
|
dbf118f6c9 | 5 years ago |
|
1ed8a0ac76 | 5 years ago |
|
48285fe722 | 5 years ago |
|
a4b975e731 | 5 years ago |
|
71e2318c81 | 5 years ago |
|
5ee756f6a5 | 5 years ago |
|
68272afcba | 5 years ago |
|
a60e705e51 | 5 years ago |
|
5fa9a7a706 | 5 years ago |
|
5b0755ca68 | 5 years ago |
|
fd675ef159 | 5 years ago |
|
8a095775d0 | 5 years ago |
|
53151f4f89 | 5 years ago |
|
0d73424edf | 5 years ago |
|
b052723eac | 5 years ago |
|
023c26f943 | 5 years ago |
|
081a9404cd | 5 years ago |
|
bb80642b70 | 5 years ago |
|
58365527e4 | 5 years ago |
|
c8ce6d220c | 5 years ago |
|
74d8393fdf | 5 years ago |
|
11ae5504fd | 5 years ago |
|
9dfbf48be4 | 5 years ago |
|
3a97df9990 | 5 years ago |
|
01b2f1abc6 | 5 years ago |
|
5a8bb16289 | 5 years ago |
|
5fc3115c3f | 5 years ago |
|
3d3fffd7e8 | 5 years ago |
|
3f2c714b42 | 5 years ago |
|
f8fa6a1e0e | 5 years ago |
|
085138d6a2 | 5 years ago |
|
cb0ffbf6ad | 5 years ago |
|
6ea32480f1 | 5 years ago |
|
4198cd42fa | 5 years ago |
|
4e9237f921 | 5 years ago |
|
65ddebc87c | 5 years ago |
|
bccacce816 | 5 years ago |
|
8d09a5339e | 5 years ago |
|
b85c56f30c | 5 years ago |
|
2c14e800cd | 5 years ago |
|
cfba3e1c3b | 5 years ago |
|
820c07b7e4 | 5 years ago |
|
33a6c48fb6 | 5 years ago |
|
d164496e09 | 5 years ago |
|
1aa4977f71 | 5 years ago |
|
9d280aa8a3 | 5 years ago |
|
5bd1ef9cff | 5 years ago |
|
1dd3415085 | 5 years ago |
|
d68287aae5 | 5 years ago |
|
237ad8a2f3 | 5 years ago |
|
adb5850983 | 5 years ago |
|
6645e80324 | 5 years ago |
|
5a2c6747b6 | 5 years ago |
|
79434e45db | 5 years ago |
|
763be1967c | 5 years ago |
|
8e4ed10b6c | 5 years ago |
|
a6f48fe371 | 5 years ago |
|
6b3cca21fb | 6 years ago |
|
3c6f5c3cee | 6 years ago |
|
577b4497e4 | 6 years ago |
|
30fba2bcfd | 6 years ago |
|
d6c2470ad1 | 6 years ago |
|
8427990730 | 6 years ago |
|
d2f4294d95 | 6 years ago |
|
db4c4a118c | 6 years ago |
|
e9fb9ca796 | 6 years ago |
|
75980790a6 | 6 years ago |
|
c5cd4df026 | 6 years ago |
|
518ff4c148 | 6 years ago |
|
08a46e6848 | 6 years ago |
|
d9aaac6903 | 6 years ago |
|
87e5a1b2c3 | 6 years ago |
|
62706de483 | 6 years ago |
|
55c188a0c8 | 6 years ago |
|
1349f617de | 6 years ago |
|
ae720c51e0 | 6 years ago |
|
5280abfa10 | 6 years ago |
|
3cc1944877 | 6 years ago |
|
0da4342b22 | 6 years ago |
|
ab80765c24 | 6 years ago |
|
c2e0dcec3c | 6 years ago |
|
9d28d930e4 | 6 years ago |
|
cf15239377 | 6 years ago |
|
4235c384ab | 6 years ago |
|
188aeac3e1 | 6 years ago |
|
2069a0e913 | 6 years ago |
|
41098c3851 | 6 years ago |
|
7ea96a6dea | 6 years ago |
|
d2dfe8bd30 | 6 years ago |
|
c04d2edd08 | 6 years ago |
|
67e0beb56b | 6 years ago |
|
fbb797253d | 6 years ago |
|
9d793b3662 | 6 years ago |
|
d09efa6aa9 | 6 years ago |
|
d5714df6c9 | 6 years ago |
|
ddd7e54fbb | 6 years ago |
|
82faec5cfe | 6 years ago |
|
1336ea5512 | 6 years ago |
|
c818ab8645 | 6 years ago |
|
8274295d90 | 6 years ago |
|
5dbed68b6a | 6 years ago |
|
562fec2614 | 6 years ago |
|
704c9cec62 | 6 years ago |
|
0afe5e3638 | 6 years ago |
|
e7c3c08da3 | 6 years ago |
|
5495fdd0c4 | 6 years ago |
|
147301d16c | 6 years ago |
|
0b6080219b | 6 years ago |
|
1288ade9ed | 6 years ago |
|
d82e7d4555 | 6 years ago |
|
9f10db393e | 6 years ago |
|
86bddb5527 | 6 years ago |
|
ca75530061 | 6 years ago |
|
6ec116f764 | 6 years ago |
|
718caa9b59 | 6 years ago |
|
5294c374df | 6 years ago |
|
eca1ff8087 | 6 years ago |
|
ebaf9e2df2 | 6 years ago |
|
0d397f6790 | 6 years ago |
|
98918783aa | 6 years ago |
|
817a111909 | 6 years ago |
|
ece2717771 | 6 years ago |
|
6eebeaf68f | 6 years ago |
|
e356ae5e5c | 6 years ago |
|
2e742622ab | 6 years ago |
|
bcd258a8c8 | 6 years ago |
|
b4df5b006b | 6 years ago |
|
593b1950d6 | 6 years ago |
|
4b4fed9b8a | 6 years ago |
|
469c0af68a | 6 years ago |
|
2f46bd718e | 6 years ago |
|
d261b0cdcf | 6 years ago |
|
5d43ad2404 | 6 years ago |
|
5f250330cb | 6 years ago |
|
14a2c978db | 6 years ago |
|
33ce21af6e | 6 years ago |
|
afefda9844 | 6 years ago |
|
5004b4b3e6 | 6 years ago |
|
64da4ff0fa | 6 years ago |
|
d1a1245742 | 6 years ago |
|
f83a6fea9a | 6 years ago |
|
35c11688eb | 6 years ago |
|
372450cd70 | 6 years ago |
|
c49c0b4a56 | 6 years ago |
|
4b9e7f5952 | 6 years ago |
|
c12fd15d3f | 6 years ago |
|
80dafa1887 | 6 years ago |
|
205a4a0545 | 6 years ago |
|
bbd8165f46 | 6 years ago |
|
2cd67e3fe1 | 6 years ago |
|
ecb5286e5a | 6 years ago |
|
501b301ed4 | 6 years ago |
|
6c6055b78b | 6 years ago |
|
32144a2eaa | 6 years ago |
|
4be7153f5f | 6 years ago |
|
b4dad686d2 | 6 years ago |
|
a325acb889 | 6 years ago |
|
dc1531a7bb | 6 years ago |
|
1377f5ac0a | 6 years ago |
|
080ea4317f | 6 years ago |
|
80a74ddc98 | 6 years ago |
|
e87140e226 | 6 years ago |
|
6b21f1dbe0 | 6 years ago |
|
e7344c41d6 | 6 years ago |
|
30c2563ffc | 6 years ago |
|
8a2a64601c | 6 years ago |
|
268fa4898b | 6 years ago |
|
38c0860189 | 6 years ago |
|
9513ec97fd | 6 years ago |
|
4bd136883c | 6 years ago |
|
be0297bd56 | 6 years ago |
|
36b4b914e2 | 6 years ago |
|
86cc56f293 | 6 years ago |
|
ef68f21ad6 | 6 years ago |
|
1cd323ef22 | 6 years ago |
|
1082f7581b | 6 years ago |
|
2eb1ac7c10 | 6 years ago |
|
ef51e4c000 | 6 years ago |
@ -0,0 +1,402 @@
|
||||
#compdef maddr magrep mbnc mcom mdeliver mdirs mexport mflag mflow mfwd mgenmid mhdr minc mless mlist mmime mmkdir mpick mrep mscan msed mseq mshow msort mthread
|
||||
|
||||
_mblaze_colon_separated_headers() {
|
||||
_message 'headers (colon separated)'
|
||||
}
|
||||
|
||||
_mblaze_message() {
|
||||
local ret=1 expl tmp curmsg
|
||||
local -a mseq mseqnums mshortcuts mshortcutdescrs
|
||||
setopt localoptions extendedglob
|
||||
|
||||
if [[ -prefix './' ]]; then
|
||||
_description files expl 'message file'
|
||||
_files "$expl[@]" && ret=0
|
||||
fi
|
||||
|
||||
curmsg=$(mseq . 2>/dev/null)
|
||||
if [[ -z $curmsg || ! -f $curmsg ]]; then
|
||||
_message 'no current sequence'
|
||||
return $ret
|
||||
fi
|
||||
|
||||
mseq=( ${(f)"$(mscan -f '%3n %c%u%r %10d %17f %t %2i%s' : 2>/dev/null)"} )
|
||||
mseq=( ${(M)mseq:# #<->*} )
|
||||
mseqnums=( ${(M)${mseq## #}##<->} )
|
||||
mseq=( ${mseq//:/\\:} )
|
||||
_describe -V -t mseq 'seq messages' mseq mseqnums && ret=0
|
||||
|
||||
mshortcuts=( '.' '+' '$' '^' '=' '_' )
|
||||
mshortcutdescrs=(
|
||||
' . current message'
|
||||
' + next message'
|
||||
# ' - previous message'
|
||||
' $ last message'
|
||||
' ^ parent message'
|
||||
' = current thread'
|
||||
' _ current subthread'
|
||||
)
|
||||
|
||||
_describe -t mshortcuts 'shortcuts' mshortcutdescrs mshortcuts -S '' && ret=0
|
||||
|
||||
return $ret
|
||||
}
|
||||
|
||||
_mblaze_message_part() {
|
||||
setopt localoptions noksharrays extendedglob
|
||||
local ret=1 expl tmp msgarg parts partnums
|
||||
tmp=$words[(i)(-O|-x)]
|
||||
if (( tmp >= $#words )); then
|
||||
_message -e mparts 'message parts (parse error)'
|
||||
return 1
|
||||
fi
|
||||
|
||||
msgarg=$words[$tmp+1]
|
||||
parts=( ${(f)"$(mshow -t $msgarg)"} )
|
||||
parts=( ${(M)parts:# ##<->:*} )
|
||||
if [[ -n $parts ]]; then
|
||||
partnums=( ${${parts## #}%%:*} )
|
||||
parts=( ${parts//:/\\:} )
|
||||
_describe -V -t mparts 'message parts' parts partnums -l && ret=0
|
||||
else
|
||||
_message -e mparts 'message parts (none found)'
|
||||
fi
|
||||
|
||||
return $ret
|
||||
}
|
||||
|
||||
_mblaze_dirs() {
|
||||
local ret=1 expl countnew countcur
|
||||
local -a mailboxes mailbox_descriptions
|
||||
setopt localoptions extendedglob
|
||||
|
||||
mailboxes=( */cur(:h) )
|
||||
mailbox_descriptions=( ${(f)"$(mlist -i $mailboxes)"} )
|
||||
_describe -t mailboxes "mailboxes" mailbox_descriptions mailboxes && ret=0
|
||||
|
||||
_description files expl 'directories'
|
||||
_path_files "$expl[@]" -g "^(${(j:|:)mailboxes})(/)" && ret=0
|
||||
}
|
||||
|
||||
_mblaze_header_regex() {
|
||||
_message header\ regex
|
||||
}
|
||||
|
||||
_mblaze_flags() {
|
||||
_message flags
|
||||
}
|
||||
|
||||
|
||||
_maddr() {
|
||||
local context state line expl
|
||||
local -A opt_args
|
||||
|
||||
_arguments \
|
||||
'-a[print addr-spec address without display name]' \
|
||||
'-h[search only given headers]:header list:_mblaze_colon_separated_headers' \
|
||||
'*:message:_mblaze_message'
|
||||
}
|
||||
|
||||
_magrep() {
|
||||
local context state line expl
|
||||
local -A opt_args
|
||||
|
||||
_arguments \
|
||||
'-a[search for regex in RFC 2822 address header parts only]' \
|
||||
'-c[only print a count of matching messages]' \
|
||||
'-d[decode the header according to RFC 2047 prior to searching]' \
|
||||
'-i[match regex case insensitively]' \
|
||||
'-m[do not show more than max matches]:max: ' \
|
||||
'(-c -q -v)-o[print matches only]' \
|
||||
'(-c -q -v)-p[print filename, header and matching]' \
|
||||
'-q[quiet mode: do not print anything]' \
|
||||
'-v[invert match]' \
|
||||
'*:message:_mblaze_header_regex'
|
||||
}
|
||||
|
||||
_mbnc() {
|
||||
local context state line expl
|
||||
local -A opt_args
|
||||
|
||||
_arguments \
|
||||
':message:_mblaze_message'
|
||||
}
|
||||
|
||||
_mcom() {
|
||||
local context state line expl
|
||||
local -A opt_args
|
||||
|
||||
_arguments \
|
||||
- resume \
|
||||
'-r[resume editing]:draft: ' \
|
||||
- recip \
|
||||
'*:recipients: '
|
||||
}
|
||||
|
||||
_mdeliver() {
|
||||
local context state line expl
|
||||
local -A opt_args
|
||||
|
||||
_arguments \
|
||||
'-c[deliver into cur/ instead of new/]' \
|
||||
'-v[print message filename after delivery]' \
|
||||
'-X[override flags]:flags:_mblaze_flags' \
|
||||
'-M[deliver messages from mbox]' \
|
||||
':dir:_mblaze_dirs'
|
||||
}
|
||||
|
||||
_mdirs() {
|
||||
_mblaze_dirs
|
||||
}
|
||||
|
||||
_mexport() {
|
||||
local context state line expl
|
||||
local -A opt_args
|
||||
|
||||
_arguments \
|
||||
'-S[add Status and X-Status headers according to flags]' \
|
||||
'*:messages:_mblaze_message'
|
||||
}
|
||||
|
||||
_mflag() {
|
||||
local context state line expl
|
||||
local -A opt_args
|
||||
|
||||
_arguments \
|
||||
'(-d)-D[mark as draft]' \
|
||||
'(-f)-F[mark as flagged]' \
|
||||
'(-p)-P[mark as passed (resent/forwarded/bounced)]' \
|
||||
'(-r)-R[mark as replied-to]' \
|
||||
'(-s)-S[mark as seen]' \
|
||||
'(-t)-T[mark as trashed]' \
|
||||
'-X[mark with characters]:marking characters: ' \
|
||||
'(-D)-d[unmark as draft]' \
|
||||
'(-F)-f[unmark as flagged]' \
|
||||
'(-P)-p[unmark as passed (resent/forwarded/bounced)]' \
|
||||
'(-R)-r[unmark as replied-to]' \
|
||||
'(-S)-s[unmark as seen]' \
|
||||
'(-T)-t[unmark as trashed]' \
|
||||
'-x[unmark with characters]:marked chacaters: ' \
|
||||
'-v[read messages from standard input or current sequence]' \
|
||||
'*:messages:_mblaze_message'
|
||||
}
|
||||
|
||||
_mflow() {
|
||||
local context state line expl
|
||||
local -A opt_args
|
||||
|
||||
_arguments \
|
||||
'-f[force wrapping of long lines]' \
|
||||
'*-q[prefix lines with >]' \
|
||||
'-w[set maximum line length]:width: ' \
|
||||
'*:dirs:_mblaze_dirs'
|
||||
}
|
||||
|
||||
_mfwd() {
|
||||
local context state line expl
|
||||
local -A opt_args
|
||||
|
||||
_arguments \
|
||||
'-r[forward as plain text]' \
|
||||
':*:message:_mblaze_message'
|
||||
}
|
||||
|
||||
_mgenmid() {
|
||||
_message 'no arguments'
|
||||
}
|
||||
|
||||
_mhdr() {
|
||||
local context state line expl
|
||||
local -A opt_args
|
||||
|
||||
_arguments \
|
||||
'-h[print specific headers only]:headers: ' \
|
||||
'-p[print specific parameter from header only]:parameter: ' \
|
||||
'-d[print headers decoded]' \
|
||||
'-H[prefix output with filename]' \
|
||||
'-M[print all occurrences, not only the first]' \
|
||||
'(-D)-A[print addresses from headers]' \
|
||||
'(-A)-D[print date as unix timestamp]' \
|
||||
'*:message:_mblaze_message'
|
||||
}
|
||||
|
||||
_minc() {
|
||||
local context state line expl
|
||||
local -A opt_args
|
||||
|
||||
_arguments \
|
||||
'-q[quiet mode: don'\''t print filenames]' \
|
||||
'*:dirs:_mblaze_dirs'
|
||||
}
|
||||
|
||||
_mless() {
|
||||
local context state line expl
|
||||
local -A opt_args
|
||||
|
||||
_arguments \
|
||||
':message:_mblaze_message'
|
||||
}
|
||||
|
||||
_mlist() {
|
||||
local context state line expl
|
||||
local -A opt_args
|
||||
|
||||
_arguments \
|
||||
'(-d)-D[only list messages marked as draft]' \
|
||||
'(-f)-F[only list messages marked as flagged]' \
|
||||
'(-p)-P[only list messages marked as passed (resent/forwarded/bounced)]' \
|
||||
'(-r)-R[only list messages marked as replied-to]' \
|
||||
'(-s)-S[only list messages marked as seen]' \
|
||||
'(-t)-T[only list messages marked as trashed]' \
|
||||
'-X[only list messages marked with characters]:marked characters: ' \
|
||||
'(-D)-d[don'\''t list messages marked as draft]' \
|
||||
'(-F)-f[don'\''t list messages marked as flagged]' \
|
||||
'(-P)-p[don'\''t list messages marked as passed (resent/forwarded/bounced)]' \
|
||||
'(-R)-r[don'\''t list messages marked as replied-to]' \
|
||||
'(-S)-s[don'\''t list messages marked as seen]' \
|
||||
'(-T)-t[don'\''t list messages marked as trashed]' \
|
||||
'-x[don'\''t list messages marked with characters]:marked chacaters: ' \
|
||||
'(-c -N)-C[only list messages in cur]' \
|
||||
'(-n -C)-N[only list messages in new]' \
|
||||
'(-C -N)-c[don'\''t list messages in cur]' \
|
||||
'(-N -C)-n[don'\''t list messages in new]' \
|
||||
'-i[print summaries instead of folder names]' \
|
||||
'*:dirs:_mblaze_dirs'
|
||||
}
|
||||
|
||||
_mmkdir() {
|
||||
local context state line expl
|
||||
local -A opt_args
|
||||
|
||||
_arguments \
|
||||
'*:directory name: '
|
||||
}
|
||||
|
||||
_mmime() {
|
||||
local context state line expl
|
||||
local -A opt_args
|
||||
|
||||
_arguments \
|
||||
'(-r)-c[check mode (don'\''t output anything)]' \
|
||||
'(-c)-r[raw mode (generate text/plain)]' \
|
||||
'-t[override Content-Type of toplevel part]:Content-Type: '
|
||||
}
|
||||
|
||||
_mpick() {
|
||||
local context state line expl
|
||||
local -A opt_args
|
||||
|
||||
_arguments \
|
||||
'-T[include whole thread]' \
|
||||
'-t[limit messages to test]:test: ' \
|
||||
'*:message:_mblaze_message'
|
||||
}
|
||||
|
||||
_mrep() {
|
||||
local context state line expl
|
||||
local -A opt_args
|
||||
|
||||
_arguments \
|
||||
':message:_mblaze_message'
|
||||
}
|
||||
|
||||
_mscan() {
|
||||
local context state line expl
|
||||
local -A opt_args
|
||||
|
||||
_arguments \
|
||||
'-n[only print message numbers]' \
|
||||
'-I[force ISO date output]' \
|
||||
'-f[specify output format]:format: ' \
|
||||
'*:messages:_mblaze_message'
|
||||
}
|
||||
|
||||
_msed() {
|
||||
local context state line expl
|
||||
local -A opt_args
|
||||
|
||||
_arguments \
|
||||
':sed script: ' \
|
||||
'*:messages:_mblaze_message'
|
||||
}
|
||||
|
||||
_mseq() {
|
||||
local context state line expl
|
||||
local -A opt_args
|
||||
|
||||
_arguments \
|
||||
'(Cmode)-f[fix non-existing filenames]' \
|
||||
'(Cmode)-r[remove leading indentation from filenames]' \
|
||||
- argmode \
|
||||
'-c[use current message]:message:_mblaze_message' \
|
||||
'*:messages:_mblaze_message' \
|
||||
- Smode \
|
||||
'-S[set message sequence from stdin]' \
|
||||
- Amode \
|
||||
'-A[append message sequence from stdin]' \
|
||||
- Cmode \
|
||||
'-C[set current message]:message:_mblaze_message'
|
||||
}
|
||||
|
||||
_mshow() {
|
||||
local context state line expl
|
||||
local -A opt_args
|
||||
|
||||
_arguments \
|
||||
- regular \
|
||||
'-n[only print message numbers]' \
|
||||
'-h[display only given headers]:header list:_mblaze_colon_separated_headers' \
|
||||
'-A[multipart/alternative preference]:mime type: ' \
|
||||
'-n[don'\''t update current message link]' \
|
||||
'(-r)-q[print only header]' \
|
||||
'(-q)-r[print body raw]' \
|
||||
'(-q)-F[don'\''t apply MIME filters]' \
|
||||
'-H[print headers raw]' \
|
||||
'-L[don'\''t filter headers]' \
|
||||
'(-q)-N[don'\''t show MIME structure markers]' \
|
||||
'*:messages:_mblaze_message' \
|
||||
- xmode \
|
||||
'-x[extraction mode]:message:_mblaze_message:*:part:_mblaze_message_part' \
|
||||
- Omode \
|
||||
'-O[extraction mode to standard output]:message:_mblaze_message:*:part:_mblaze_message_part' \
|
||||
- tmode \
|
||||
'-t[list mode]:*:message:_mblaze_message' \
|
||||
- Rmode \
|
||||
'-R[render text parts]:message:_mblaze_message'
|
||||
}
|
||||
|
||||
_msort() {
|
||||
local context state line expl
|
||||
local -A opt_args
|
||||
|
||||
_arguments \
|
||||
'-r[reverse order]' \
|
||||
'*:message:_mblaze_message' \
|
||||
+ '(order)' \
|
||||
'-f[sort by From]' \
|
||||
'-d[sort by Date]' \
|
||||
'-s[sort by Subject]' \
|
||||
'-F[sort by filename]' \
|
||||
'-M[sort by file modification time]' \
|
||||
'-S[sort by file size]' \
|
||||
'-U[sort unread messages after read messages]' \
|
||||
'-I[sort flagged messages before unflagged messages]'
|
||||
}
|
||||
|
||||
_mthread() {
|
||||
local context state line expl
|
||||
local -A opt_args
|
||||
|
||||
_arguments \
|
||||
'-a[don'\''t prune unresolved Message-IDs]' \
|
||||
'-S[treat as optional messages]:optional message:_mblaze_message' \
|
||||
'*:message:_mblaze_message'
|
||||
}
|
||||
|
||||
_mblaze() {
|
||||
local ret=1
|
||||
_call_function ret _$service
|
||||
return ret
|
||||
}
|
||||
|
||||
_mblaze "$@"
|
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
# mcount - count mails from sequence on stdin
|
||||
|
||||
[ -t 1 ] && stdout=1
|
||||
|
||||
awk -v stdout=$stdout '
|
||||
!/^ *</ { n++ }
|
||||
!stdout { print }
|
||||
END { fflush(); print n " mails processed" > "/dev/stderr" }
|
||||
'
|
@ -1,14 +1,17 @@
|
||||
#!/bin/sh -e
|
||||
# menter [MSG] - run subshell in temporary directory with MSG extracted
|
||||
|
||||
[ "$#" -eq 0 ] && set -- :
|
||||
[ "$#" -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 -x "$1" 2>/dev/null
|
||||
ls -l
|
||||
ln -s "$(mseq "$1")" msg
|
||||
ln -s "$f" msg
|
||||
"${SHELL:-/bin/sh}" || true
|
||||
echo rm -r "$dir"
|
||||
rm -r "$dir"
|
||||
|
@ -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])
|
||||
}
|
||||
}
|
||||
'
|
||||
)
|
@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
# mmairix QUERY - mblaze wrapper around mairix
|
||||
|
||||
mairix -r "$@" | sed 's,//*,/,g' | mless
|
||||
mairix -r "$@" | sed 's,//*,/,g' | msort -rd | mless
|
||||
|
@ -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,15 @@
|
||||
#!/bin/sh
|
||||
# mp7m - decode S/MIME .p7m format
|
||||
|
||||
tmp=$(mktemp -t mp7m.XXXXXX)
|
||||
trap "rm -f '$tmp'" INT TERM EXIT
|
||||
|
||||
cat >"$tmp"
|
||||
|
||||
if openssl pkcs7 -print_certs <"$tmp" |
|
||||
openssl smime -verify -in "$tmp" -inform DER -noverify -signer /dev/stdin
|
||||
then
|
||||
exit 64
|
||||
else
|
||||
exit 63
|
||||
fi
|
@ -1,8 +1,8 @@
|
||||
#!/bin/sh
|
||||
# mrecode - recode stdin respecting PIPE_CHARSET into UTF-8
|
||||
|
||||
if [ -n "$PIPE_CHARSET" ]; then
|
||||
exec iconv -f "$PIPE_CHARSET" -t UTF-8
|
||||
else
|
||||
exec cat
|
||||
fi
|
||||
case "$PIPE_CHARSET" in
|
||||
''|*[Uu][Nn][Kk][Nn][Oo][Ww][Nn]*) exec cat;;
|
||||
*) exec iconv -f "$PIPE_CHARSET" -t UTF-8;;
|
||||
esac
|
||||
|
||||
|
@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
|
||||
MBLAZE=${MBLAZE:-$HOME/.mblaze}
|
||||
engine=$(mhdr -h search-engine "$MBLAZE/profile")
|
||||
|
||||
while getopts nmx opt; do
|
||||
case $opt in
|
||||
n)
|
||||
engine=notmuch
|
||||
;;
|
||||
m)
|
||||
engine=mu
|
||||
;;
|
||||
x)
|
||||
engine=mairix
|
||||
;;
|
||||
'?')
|
||||
printf "Usage: %s: [-n | -m | -x] query\n" "$0" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $(($OPTIND - 1))
|
||||
|
||||
[ -z "$engine" ] && engine=notmuch
|
||||
|
||||
case $engine in
|
||||
notmuch)
|
||||
exec notmuch search --output=files "$@"
|
||||
;;
|
||||
mu)
|
||||
exec mu find --fields l "$@"
|
||||
;;
|
||||
mairix)
|
||||
if [ "$#" -eq 0 ]; then
|
||||
printf "Usage: %s -x query\n" "$0" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
exec mairix -r "$@"
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported search engine: $engine"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
@ -0,0 +1,75 @@
|
||||
.Dd September 27, 2018
|
||||
.Dt MSEARCH 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm msearch
|
||||
.Nd search messages
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl n | Fl m | Fl x
|
||||
.Op Fl -
|
||||
.Op Ar query
|
||||
.Sh DESCRIPTION
|
||||
.Nm
|
||||
searches for messages matching
|
||||
.Ar query ,
|
||||
using an external search engine, and prints file names separated by newlines.
|
||||
.Pp
|
||||
The options are as follows:
|
||||
.Bl -tag -width Ds
|
||||
.It Fl n
|
||||
Search using
|
||||
.Xr notmuch-search 1 .
|
||||
.It Fl m
|
||||
Search using
|
||||
.Xr mu-find 1 .
|
||||
.It Fl x
|
||||
Search using
|
||||
.Xr mairix 1 .
|
||||
.It Fl -
|
||||
Stop scanning for arguments.
|
||||
.It Ar query
|
||||
The search query, whose interpretation is up to the search engine.
|
||||
This can also contain additional arguments for them
|
||||
.El
|
||||
.Pp
|
||||
If no search engine is specified as an argument,
|
||||
.Sq Li Search-Engine\&:
|
||||
from
|
||||
.Pa "${MBLAZE:-$HOME/.mblaze}/profile"
|
||||
is used.
|
||||
Valid values for this setting are
|
||||
.Sq notmuch ,
|
||||
.Sq mairix ,
|
||||
and
|
||||
.Sq mu .
|
||||
If that is unset,
|
||||
.Xr notmuch-search 1
|
||||
is used.
|
||||
.Sh ENVIRONMENT
|
||||
.Bl -tag -width Ds
|
||||
.It Ev MBLAZE
|
||||
Directory containing mblaze configuration files.
|
||||
(Default:
|
||||
.Pa $HOME/.mblaze )
|
||||
.El
|
||||
.Sh EXIT STATUS
|
||||
.Ex -std
|
||||
Note that the called programs may have their own exit values.
|
||||
.Sh SEE ALSO
|
||||
.Xr mairix 1 ,
|
||||
.Xr mu-find 1 ,
|
||||
.Xr notmuch-search 1 ,
|
||||
.Xr mblaze-profile 5
|
||||
.Sh AUTHORS
|
||||
.An Thomas Schneider Aq Mt qsx@chaotikum.eu
|
||||
.Sh LICENSE
|
||||
.Nm
|
||||
is in the public domain.
|
||||
.Pp
|
||||
To the extent possible under law,
|
||||
the creator of this work
|
||||
has waived all copyright and related or
|
||||
neighboring rights to this work.
|
||||
.Pp
|
||||
.Lk http://creativecommons.org/publicdomain/zero/1.0/
|
@ -0,0 +1,55 @@
|
||||
.Dd April 19, 2018
|
||||
.Dt MREFILE 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm mrefile
|
||||
.Nd move or copy messages between maildir folders
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl k
|
||||
.Op Fl v
|
||||
.Op Ar msgs\ ...
|
||||
.Ar dir
|
||||
.Sh DESCRIPTION
|
||||
.Nm
|
||||
moves the
|
||||
.Ar msgs
|
||||
given on the command line
|
||||
.Pq or the standard input
|
||||
into the maildir
|
||||
.Ar dir ,
|
||||
assigning new filenames but keeping any message flags.
|
||||
Messages are moved directly into the
|
||||
.Pa cur/
|
||||
directory.
|
||||
.Po
|
||||
See
|
||||
.Xr mmsg 7
|
||||
for the message argument syntax.
|
||||
.Pc
|
||||
.Pp
|
||||
The options are as follows:
|
||||
.Bl -tag -width Ds
|
||||
.It Fl k
|
||||
keep the messages in their respective folders,
|
||||
i.e. copy into
|
||||
.Ar dir .
|
||||
.It Fl v
|
||||
Print each resulting message filename.
|
||||
.El
|
||||
.Sh EXIT STATUS
|
||||
.Ex -std
|
||||
.Sh SEE ALSO
|
||||
.Xr mdeliver 1
|
||||
.Sh AUTHORS
|
||||
.An Leah Neukirchen Aq Mt leah@vuxu.org
|
||||
.Sh LICENSE
|
||||
.Nm
|
||||
is in the public domain.
|
||||
.Pp
|
||||
To the extent possible under law,
|
||||
the creator of this work
|
||||
has waived all copyright and related or
|
||||
neighboring rights to this work.
|
||||
.Pp
|
||||
.Lk http://creativecommons.org/publicdomain/zero/1.0/
|
@ -1,9 +1,11 @@
|
||||
#!/bin/sh
|
||||
# mmkdir DIRS... - create new maildirs
|
||||
|
||||
umask 077
|
||||
|
||||
r=0
|
||||
for dir; do
|
||||
mkdir -p -m 0700 $dir/cur $dir/new $dir/tmp || r=1
|
||||
mkdir -p "$dir"/tmp "$dir"/new "$dir"/cur || r=1
|
||||
done
|
||||
|
||||
exit $r
|
||||
|
@ -1,86 +1,28 @@
|
||||
#include <time.h>
|
||||
|
||||
// from musl@1cc81f5cb, slightly tweaked
|
||||
|
||||
static long long
|
||||
__year_to_secs(long long year, int *is_leap)
|
||||
time_t
|
||||
mytimegm(struct tm *tm)
|
||||
{
|
||||
if (year-2ULL <= 136) {
|
||||
int y = year;
|
||||
int leaps = (y-68)>>2;
|
||||
if (!((y-68)&3)) {
|
||||
leaps--;
|
||||
if (is_leap) *is_leap = 1;
|
||||
} else if (is_leap) *is_leap = 0;
|
||||
return 31536000*(y-70) + 86400*leaps;
|
||||
}
|
||||
|
||||
int cycles, centuries, leaps, rem;
|
||||
|
||||
cycles = (year-100) / 400;
|
||||
rem = (year-100) % 400;
|
||||
if (rem < 0) {
|
||||
cycles--;
|
||||
rem += 400;
|
||||
}
|
||||
if (!rem) {
|
||||
*is_leap = 1;
|
||||
centuries = 0;
|
||||
leaps = 0;
|
||||
} else {
|
||||
if (rem >= 200) {
|
||||
if (rem >= 300) centuries = 3, rem -= 300;
|
||||
else centuries = 2, rem -= 200;
|
||||
} else {
|
||||
if (rem >= 100) centuries = 1, rem -= 100;
|
||||
else centuries = 0;
|
||||
}
|
||||
if (!rem) {
|
||||
*is_leap = 0;
|
||||
leaps = 0;
|
||||
} else {
|
||||
leaps = rem / 4U;
|
||||
rem %= 4U;
|
||||
*is_leap = !rem;
|
||||
}
|
||||
}
|
||||
|
||||
leaps += 97*cycles + 24*centuries - *is_leap;
|
||||
int mon = tm->tm_mon + 1 - 2; /* put March first, Feb last */
|
||||
long long year = tm->tm_year + 1900;
|
||||
|
||||
return (year-100) * 31536000LL + leaps * 86400LL + 946684800 + 86400;
|
||||
}
|
||||
|
||||
static int
|
||||
__month_to_secs(int month, int is_leap)
|
||||
{
|
||||
static const int secs_through_month[] = {
|
||||
0, 31*86400, 59*86400, 90*86400,
|
||||
120*86400, 151*86400, 181*86400, 212*86400,
|
||||
243*86400, 273*86400, 304*86400, 334*86400 };
|
||||
int t = secs_through_month[month];
|
||||
if (is_leap && month >= 2) t+=86400;
|
||||
return t;
|
||||
}
|
||||
|
||||
time_t tm_to_secs(const struct tm *tm)
|
||||
{
|
||||
int is_leap;
|
||||
long long year = tm->tm_year;
|
||||
int month = tm->tm_mon;
|
||||
if (month >= 12 || month < 0) {
|
||||
int adj = month / 12;
|
||||
month %= 12;
|
||||
if (month < 0) {
|
||||
if (mon <= 0 || mon >= 12) {
|
||||
int adj = mon / 12;
|
||||
mon %= 12;
|
||||
if (mon <= 0) {
|
||||
adj--;
|
||||
month += 12;
|
||||
mon += 12;
|
||||
}
|
||||
year += adj;
|
||||
}
|
||||
long long t = __year_to_secs(year, &is_leap);
|
||||
t += __month_to_secs(month, is_leap);
|
||||
t += 86400LL * (tm->tm_mday-1);
|
||||
t += 3600LL * tm->tm_hour;
|
||||
t += 60LL * tm->tm_min;
|
||||
t += tm->tm_sec;
|
||||
|
||||
time_t t = 0;
|
||||
t += tm->tm_sec;
|
||||
t += 60 * tm->tm_min;
|
||||
t += 60*60 * tm->tm_hour;
|
||||
t += 24*60*60 * (tm->tm_mday - 1);
|
||||
t += 24*60*60 * (367*mon/12);
|
||||
t += 24*60*60 * (year/4 - year/100 + year/400);
|
||||
t += 24*60*60 * (365*year - 719498L);
|
||||
return t;
|
||||
}
|
||||
|
@ -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'
|
||||
|
||||
)
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue