Change option -p to accept lists of headers and parameters:
-p h1,h2,h3,..:p1,p2,p3,..
- Allow * and exceptions for -p in the headers list:
+ Allow * and exceptions for -p in the headers and parameters lists:
-p *,-h1,-h2,-h3:p1,p2,p3
+-p h1,h2,h3:*,-p1,-p2,-p3
+-p *,-h1,-h2,-h3:*,-p1,-p2,-p3
Add ChangeLog.
-Allow * and exceptions for -p:
--p h1,h2,h3:*,-p1,-p2,-p3
--p *,-h1,-h2,-h3:p1,p2,p3
--p *,-h1,-h2,-h3:*,-p1,-p2,-p3
-
-
-Publish docs in html format.
-
-
-Release 2.4.0.
-
-
Change option -r to accept a list of headers: -r h1,h2,h3,...
Remove option --remove-params.
-Release 2.5.0.
+Publish docs in html format.
+
+
+Release 2.4.0.
Add option -s to save decoded headers/bodies/messages of parts to files.
as base64 or such).
-Release 2.6.0.
+Release 2.5.0.
Allow -d and -p accept shell-like patterns and/or regular expressions:
Never touch multipart/encrypted and multipart/signed.
-Release 2.7.0.
+Release 2.6.0.
Extend options -eIi to multipart subparts.
Add an option to convert dates to the current locate and timezone.
-Release 2.8.0.
+Release 2.7.0.
<arg choice="opt">
<option>-p header1[,header2,header3,...]:param1[,param2,param3,...]</option>
</arg>
+ <arg choice="opt">
+ <option>-p *[,-header1,-header2,-header3,...]:param1[,param2,param3,...]</option>
+ <option>-p header1[,header2,header3,...]:*[,-param1,-param2,-param3,...]</option>
+ <option>-p *[,-header1,-header2,-header3,...]:*[,-param1,-param2,-param3,...]</option>
+ </arg>
<arg choice="opt">
<option>-r header</option>
</arg>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term>-p header1[,header2,header3,...]:*[,-param1,-param2,-param3,...]</term>
+ <listitem>
+ <para>
+ Decode all parameters except listed for the given list of headers.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>-p *[,-header1,-header2,-header3,...]:*[,-param1,-param2,-param3,...]</term>
+ <listitem>
+ <para>
+ Decode all parameters except listed for all headers (except listed).
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term>-P</term>
<listitem>
for header_list, param_list in gopts.decode_header_params:
header_list = header_list.split(',')
param_list = param_list.split(',')
+ decode_all_params = param_list[0] == '*' # Decode all params except listed
+ if decode_all_params:
+ param_list = _get_exceptions(param_list)
if header_list[0] == '*': # Decode for all headers except listed
header_list = _get_exceptions(header_list)
for header in msg.keys():
if header.lower() not in header_list:
- for param in param_list:
- decode_header_param(msg, header, param)
+ if decode_all_params:
+ params = msg.get_params(header=header)
+ if params:
+ for param, value in params:
+ if param not in param_list:
+ decode_header_param(msg, header, param)
+ else:
+ for param in param_list:
+ decode_header_param(msg, header, param)
else: # Decode for listed headers
for header in header_list:
- for param in param_list:
- decode_header_param(msg, header, param)
+ if decode_all_params:
+ params = msg.get_params(header=header)
+ if params:
+ for param, value in params:
+ if param not in param_list:
+ decode_header_param(msg, header, param)
+ else:
+ for param in param_list:
+ decode_header_param(msg, header, param)
def set_header(msg, header, value):
test_file msg_18.txt msg_18-1.txt --remove-params=X-Foobar-Spoink-Defrobnit
test_file msg_22.txt msg_22.txt -P -p Content-Type,Content-Disposition:name,filename
test_file msg_22.txt msg_22.txt -P -p \*:name,filename
+test_file msg_22.txt msg_22.txt -P -p Content-Type,Content-Disposition:\*
+test_file msg_22.txt msg_22.txt -P -p '*,-Content-Id:*,-x-mac-type'
if [ "$RC" -eq 0 ]; then
echo "All tests passed!"