pop3mail v0.1.6 Pop3mail.Multipart
Parser for: RFC 2045 Multipart content type (previously RFC 1341).
It works recursive because a multipart content can contain other multiparts. The returned sequential list of Pop3mail.Path structs is flattened. The Part.path field shows where it is in the hierarchy. This module can also be useful to parse RFC 7578 multipart/form-data (previously RFC 2388).
Summary
Functions
Return decoded text as binary
Return decoded text as binary
Return decoded lines as binary
Extract (file-)name from Content-Disposition value or Content-Type value. Returns Pop3mail.Part with filled-in filename and filename_charset
Get parameter number of key_value. key_value
- format must be: key=value or key
Get value of key_value. key_value
- format must be: key=value or key
Is this part a multipart? Looks if the media_type starts with multipart/
A multipart header line can continue on the next line. When next line starts with a tab-character or when there is a opening double quote not closed yet
Parse multipart content. Returns a flattened list of Pop3mail.Part’s
Parse multipart Content-Type header line. It can contain media_type, charset, (file-)name and boundary. Returns a Pop3mail.Part
Parse value of content-type header line. It can contain media_type, charset, (file-)name and boundary. Returns a Pop3mail.Part
Parse multipart Content-Disposition header line. This is either inline or attachment, and it can contain a filename. Returns a Pop3mail.Part
Parse value of Content-Disposition header line. This is either inline or attachment, and it can contain a filename. Returns a Pop3mail.Part
Parse the boundary in the multipart content
Parse a part of the multipart content
Parse multipart Content-ID header line. Returns a Pop3mail.Part
Parse multipart Content-Type header line. It can contain media_type, charset, (file-)name and boundary. Returns a Pop3mail.Part
Decode lines and add them as content in the multipart part. Returns a Pop3mail.Part
Parse multipart Content-Disposition header line. Returns a Pop3mail.Part
Finish parsing multipart header lines and start decode of the part content. Returns a Pop3mail.Part
Parse multipart header lines. Returns a Pop3mail.Part
Ignore a multipart header line. Returns a Pop3mail.Part
Parse multipart Content-Transfer-Encoding header line. Returns a Pop3mail.Part
Skip an unknown multipart header line. Logs a warning. Returns a Pop3mail.Part
Functions
Return decoded text as binary.
encoding
- For example: base64, quoted-printable, 7bit, 8bit, etc.
Return decoded lines as binary.
encoding
- For example: base64, quoted-printable, 7bit, 8bit, etc.
Extract (file-)name from Content-Disposition value or Content-Type value. Returns Pop3mail.Part with filled-in filename and filename_charset.
Example of Content-Disposition header line:
Content-Disposition: attachment; filename=abc.pdf
RFC 2231 example:
filename0=us-ascii’en’This%20is%20even%20more%20 filename1=%2A%2A%2Afun%2A%2A%2A%20 filename*2=”isn’t it!”
Get parameter number of key_value. key_value
- format must be: key=value or key
Get value of key_value. key_value
- format must be: key=value or key
Is this part a multipart? Looks if the media_type starts with multipart/.
It could be multipart/alternative, multipart/relative or multipart/mixed.
multipart_part
- Pop3mail.Part
A multipart header line can continue on the next line. When next line starts with a tab-character or when there is a opening double quote not closed yet.
Parse multipart content. Returns a flattened list of Pop3mail.Part’s
This is recursively called for each multipart part, e.g. parse_content calls itself
multipart_part
- Pop3mail.Part input.
Parse multipart Content-Type header line. It can contain media_type, charset, (file-)name and boundary. Returns a Pop3mail.Part
multipart_part
- Pop3mail.Part input
Parse value of content-type header line. It can contain media_type, charset, (file-)name and boundary. Returns a Pop3mail.Part
multipart_part
- Pop3mail.Part input
content_type_parameters
- list of parameters in the format key=value
Parse multipart Content-Disposition header line. This is either inline or attachment, and it can contain a filename. Returns a Pop3mail.Part
multipart_part
- Pop3mail.Part input
Parse value of Content-Disposition header line. This is either inline or attachment, and it can contain a filename. Returns a Pop3mail.Part
multipart_part
- Pop3mail.Part input
disposition_parameters
- list of parameters in the format key=value
Parse the boundary in the multipart content.
raw_content
- multipart content
boundary_name
- multipart boundary to search for
path
- path in the multipart hierarchy. For example: relative/alternative
Parse a part of the multipart content.
{part, index}
- Numbered Pop3mail.Part. Index starts at 1 for part 1 in a multipart.
boundary_name
- multipart boundary name
path
- path in the multipart hierarchy. For example: relative/alternative
Parse multipart Content-ID header line. Returns a Pop3mail.Part
multipart_part
- Pop3mail.Part input
encoding
- For example: base64, quoted-printable, 7bit, 8bit, etc.
list
- lines
Parse multipart Content-Type header line. It can contain media_type, charset, (file-)name and boundary. Returns a Pop3mail.Part
multipart_part
- Pop3mail.Part input
encoding
- For example: base64, quoted-printable, 7bit, 8bit, etc.
list
- lines
Decode lines and add them as content in the multipart part. Returns a Pop3mail.Part
Is called after all multipart header lines are parsed.
multipart_part
- Pop3mail.Part input
encoding
- For example: base64, quoted-printable, 7bit, 8bit, etc.
lines
- part content splitted in lines
Parse multipart Content-Disposition header line. Returns a Pop3mail.Part
multipart_part
- Pop3mail.Part input
encoding
- For example: base64, quoted-printable, 7bit, 8bit, etc.
list
- lines
Finish parsing multipart header lines and start decode of the part content. Returns a Pop3mail.Part
multipart_part
- Pop3mail.Part input
encoding
- For example: base64, quoted-printable, 7bit, 8bit, etc.
list
- lines
Parse multipart header lines. Returns a Pop3mail.Part
multipart_part
- Pop3mail.Part input
encoding
- For example: base64, quoted-printable, 7bit, 8bit, etc.
list
- lines
Ignore a multipart header line. Returns a Pop3mail.Part
multipart_part
- Pop3mail.Part input
encoding
- For example: base64, quoted-printable, 7bit, 8bit, etc.
list
- lines
Parse multipart Content-Transfer-Encoding header line. Returns a Pop3mail.Part
multipart_part
- Pop3mail.Part input
encoding
- For example: base64, quoted-printable, 7bit, 8bit, etc.
list
- lines