1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303
|
# This file is part of GNU Mailutils. -*- Autotest -*-
# Copyright (C) 2011-2025 Free Software Foundation, Inc.
#
# GNU Mailutils is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3, or (at
# your option) any later version.
#
# GNU Mailutils is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
# Warning: This text contains 8-bit UTF-8
AT_BANNER(RFC 2231 header fields)
dnl ---------------------------------------------------------------------
dnl MIMEHDR([NAME], [KW], [OPT], [INPUT], [STDOUT = `'], [STDERR = `'])
dnl
m4_pushdef([MIMEHDR],[
m4_pushdef([MU_TEST_GROUP],[mimehdr])
m4_pushdef([MU_TEST_KEYWORDS],[mimehdr rfc2231])
m4_pushdef([MU_TEST_COMMAND],[mimehdr $3])
MU_GENERIC_TEST([$1],[$2],[$4],[],[$5],[$6])
m4_popdef([MU_TEST_COMMAND])
m4_popdef([MU_TEST_KEYWORDS])
m4_popdef([MU_TEST_GROUP])
])
m4_pushdef([MIMEHDR_FAIL],[
m4_pushdef([MU_TEST_GROUP],[mimehdr])
m4_pushdef([MU_TEST_KEYWORDS],[mimehdr rfc2231])
m4_pushdef([MU_TEST_COMMAND],[mimehdr $3])
MU_GENERIC_TEST([$1],[$2],[$4],[2],[$5],[$6])
m4_popdef([MU_TEST_COMMAND])
m4_popdef([MU_TEST_KEYWORDS])
m4_popdef([MU_TEST_GROUP])
])
dnl ---------------------------------------------------------------------
MIMEHDR([simple],[mimehdr00 mimehdr-simple],
[],
[message/external-body; access-type=URL;
URL="ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar"
],
[message/external-body
access-type=URL
URL=ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar
])
MIMEHDR([continuation],[mimehdr01 mimehdr-cont mimehdr-cont-00],
[],
[message/external-body; access-type=URL;
URL*0="ftp://";
URL*1="cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar"
],
[message/external-body
access-type=URL
URL=ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar
])
MIMEHDR([charset (2047)],[mimehdr02 mimehdr-charset-rfc2047 mimehdr-charset-00],
[],
[attachment; charset=utf-8;
filename==?UTF-8?B?zrHPgc+HzrXOr86/IM6zzrnOsSDPhM63zr0gzrTOv866zrnOvM6xz4POr86x==?=
],
[attachment
charset=utf-8
filename=αρχείο για την δοκιμασία
])
MIMEHDR([charset with language (2047)],[mimehdr03 mimehdr-charset-rfc2047 mimehdr-charset-01],
[],
[attachment; charset=utf-8;
filename==?UTF-8*el?B?zrHPgc+HzrXOr86/IM6zzrnOsSDPhM63zr0gzrTOv866zrnOvM6xz4POr86x==?=
],
[attachment
charset=utf-8
filename(lang:el/UTF-8)=αρχείο για την δοκιμασία
])
MIMEHDR([no charset (2231)],[mimehdr04 mimehdr-no-charset-rfc2231 mimehdr-nocharset-00],
[],
[attachment; charset=utf-8;
filename*=%CE%B1%CF%81%CF%87%CE%B5%CE%AF%CE%BF%20%CE%B3%CE%B9%CE%B1%20%CF%84%CE%B7%CE%BD%20%CE%B4%CE%BF%CE%BA%CE%B9%CE%BC%CE%B1%CF%83%CE%AF%CE%B1
],
[attachment
charset=utf-8
filename=αρχείο για την δοκιμασία
])
MIMEHDR([charset (2231)],[mimehdr05 mimehdr-charset-rfc2231 mimehdr-charset-rfc2231-00 mimehdr-charset-03],
[],
[attachment; charset=utf-8;
filename*=UTF-8''%CE%B1%CF%81%CF%87%CE%B5%CE%AF%CE%BF%20%CE%B3%CE%B9%CE%B1%20%CF%84%CE%B7%CE%BD%20%CE%B4%CE%BF%CE%BA%CE%B9%CE%BC%CE%B1%CF%83%CE%AF%CE%B1
],
[attachment
charset=utf-8
filename(lang:/UTF-8)=αρχείο για την δοκιμασία
])
MIMEHDR([charset with language (2231)],[mimehdr06 mimehdr-charset-rfc2231 mimehdr-charset-rfc2231-01 mimehdr-charset-04],
[],
[attachment; charset=utf-8;
filename*=UTF-8'el_GR'%CE%B1%CF%81%CF%87%CE%B5%CE%AF%CE%BF%20%CE%B3%CE%B9%CE%B1%20%CF%84%CE%B7%CE%BD%20%CE%B4%CE%BF%CE%BA%CE%B9%CE%BC%CE%B1%CF%83%CE%AF%CE%B1
],
[attachment
charset=utf-8
filename(lang:el_GR/UTF-8)=αρχείο για την δοκιμασία
])
MIMEHDR([charset with language and continuation (2231)],[mimehdr07 mimehdr-charset-rfc2231 mimehdr-charset-rfc2231-02 mimehdr-charset-05],
[],
[attachment; charset=utf-8;
filename*00*=UTF-8'el_GR'%CE%B1%CF%81%CF%87%CE%B5;
filename*01*=%CE%AF%CE%BF%20%CE%B3%CE;
filename*02*=%B9%CE%B1%20%CF%84%CE%B7;
filename*03*=%CE%BD%20%CE%B4%CE%BF%CE;
filename*04*=%BA%CE%B9%CE%BC%CE%B1%CF%83%CE%AF%CE%B1
],
[attachment
charset=utf-8
filename(lang:el_GR/UTF-8)=αρχείο για την δοκιμασία
])
MIMEHDR([combined charset, lang and cset],[mimehdr08 mimehdr-comb mimehdr-charset-rfc2231],
[],
[application/x-stuff;
title*0*=us-ascii'en'This%20is%20even%20more%20;
title*1*=%2A%2A%2Afun%2A%2A%2A%20;
title*2="isn't it!"
],
[application/x-stuff
title(lang:en/us-ascii)=This is even more ***fun*** isn't it!
])
MIMEHDR([format: simple],[mimehdr09],
[-header=X-MIME-Test-Header -width=26],
[application/x-stuff; charset=ascii; title=foobar],
[X-MIME-Test-Header: application/x-stuff;
charset=ascii;
title=foobar
])
MIMEHDR([format: split],[mimehdr10],
[-header=X-MIME-Test-Header -width=76],
[attachment; title="unusually long filename created by gray expressly for testing purposes and not meant for any other purpose but testing the formatting of very long MIME headers"],
[X-MIME-Test-Header: attachment;
title*0="unusually long filename created by gray expressly for testing pu";
title*1="rposes and not meant for any other purpose but testing the forma";
title*2="tting of very long MIME headers"
])
MIMEHDR([format: split 2],[mimehdr11],
[-header=X-MIME-Test-Header -width=26],
[attachment; title="unusually long filename created by gray expressly for testing purposes and not meant for any other purpose but testing the formatting of very long MIME headers"],
[X-MIME-Test-Header: attachment;
title*0="unusually long";
title*1=" filename crea";
title*2="ted by gray ex";
title*3="pressly for te";
title*4="sting purposes";
title*5=" and not meant";
title*6=" for any other";
title*7=" purpose but t";
title*8="esting the for";
title*9="matting of ver";
title*10="y long MIME h";
title*11="eaders"
])
# This test is split into 5 subtests to make sure encoded character
# representation is not split between subsequent numbered parameters.
MIMEHDR([format: language info 1],[mimehdr12 mimehdr12a],
[-header=X-MIME-Test-Header -width=27],
[application/x-stuff;
title*0*=us-ascii'en'This%20is%20even%20more%20;
title*1*=%2A%2A%2Afun%2A%2A%2A%20;
title*2="isn't it!"
],
[X-MIME-Test-Header: application/x-stuff;
title*0*=en'us-ascii'This;
title*1*=%20is%20even%20m;
title*2*=ore%20***fun***;
title*3*=%20isn't%20it!
])
MIMEHDR([format: language info 2],[mimehdr12 mimehdr12b],
[-header=X-MIME-Test-Header -width=28],
[application/x-stuff;
title*0*=us-ascii'en'This%20is%20even%20more%20;
title*1*=%2A%2A%2Afun%2A%2A%2A%20;
title*2="isn't it!"
],
[X-MIME-Test-Header: application/x-stuff;
title*0*=en'us-ascii'This;
title*1*=%20is%20even%20mo;
title*2*=re%20***fun***;
title*3*=%20isn't%20it!
])
MIMEHDR([format: language info 3],[mimehdr12 mimehdr12c],
[-header=X-MIME-Test-Header -width=29],
[application/x-stuff;
title*0*=us-ascii'en'This%20is%20even%20more%20;
title*1*=%2A%2A%2Afun%2A%2A%2A%20;
title*2="isn't it!"
],
[X-MIME-Test-Header: application/x-stuff;
title*0*=en'us-ascii'This;
title*1*=%20is%20even%20mor;
title*2*=e%20***fun***%20is;
title*3*=n't%20it!
])
MIMEHDR([format: language info 4],[mimehdr12 mimehdr12d],
[-header=X-MIME-Test-Header -width=30],
[application/x-stuff;
title*0*=us-ascii'en'This%20is%20even%20more%20;
title*1*=%2A%2A%2Afun%2A%2A%2A%20;
title*2="isn't it!"
],
[X-MIME-Test-Header: application/x-stuff;
title*0*=en'us-ascii'This;
title*1*=%20is%20even%20more;
title*2*=%20***fun***%20isn';
title*3*=t%20it!
])
MIMEHDR([format: language info 5],[mimehdr12 mimehdr12e],
[-header=X-MIME-Test-Header -width=31],
[application/x-stuff;
title*0*=us-ascii'en'This%20is%20even%20more%20;
title*1*=%2A%2A%2Afun%2A%2A%2A%20;
title*2="isn't it!"
],
[X-MIME-Test-Header: application/x-stuff;
title*0*=en'us-ascii'This%20i;
title*1*=s%20even%20more%20**;
title*2*=*fun***%20isn't%20it;
title*3*=!
])
MIMEHDR([missing parameters],[mimehdr13],
[],
[message],
[message
])
MIMEHDR([surrounding whitespace],[mimehdr14],
[],
[text/plain ; charset = utf-8; param=foo ; p1 =bar ; p2= baz
],
[text/plain
charset=utf-8
p1=bar
p2=baz
param=foo
])
MIMEHDR_FAIL([empty input],[mimehdr15],
[],
[],
[],
[mimehdr: mu_mime_header_parse() failed: Parse error
])
MIMEHDR([missing semicolon after type],[mimehdr16],
[],
[message name="foo"],
[message name="foo"
])
MIMEHDR([whitespace in type],[mimehdr17],
[],
[TeX file/plain; name=foo],
[TeX file/plain
name=foo
])
MIMEHDR([error tolerance],[mimehdr18],
[],
[application/x-stuff;name="one";title some text ; charset= utf8;
output = foo bar],
[application/x-stuff
charset=utf8
name=one
])
m4_popdef([MIMEHDR])
m4_popdef([MIMEHDR_FAIL])
|