mail-parser 0.6.1

Fast and robust e-mail parsing library for Rust
Documentation
{
  "html_body": [
    3
  ],
  "text_body": [
    3
  ],
  "attachments": [
    1,
    2
  ],
  "parts": [
    {
      "headers": [
        {
          "name": {
            "Other": "From user@domain  Fri Feb 22 17"
          },
          "value": {
            "Text": "06:23 2008\n"
          },
          "offset_start": 32,
          "offset_end": 43
        },
        {
          "name": {
            "Rfc": "from"
          },
          "value": {
            "Address": {
              "name": null,
              "address": "user@domain.org"
            }
          },
          "offset_start": 48,
          "offset_end": 65
        },
        {
          "name": {
            "Rfc": "date"
          },
          "value": {
            "DateTime": {
              "year": 2007,
              "month": 3,
              "day": 24,
              "hour": 23,
              "minute": 0,
              "second": 0,
              "tz_before_gmt": false,
              "tz_hour": 2,
              "tz_minute": 0
            }
          },
          "offset_start": 70,
          "offset_end": 103
        },
        {
          "name": {
            "Rfc": "mime_version"
          },
          "value": {
            "Text": "1.0"
          },
          "offset_start": 116,
          "offset_end": 121
        },
        {
          "name": {
            "Rfc": "content_type"
          },
          "value": {
            "ContentType": {
              "c_type": "multipart",
              "c_subtype": "mixed",
              "attributes": [
                [
                  "boundary",
                  "foo bar"
                ]
              ]
            }
          },
          "offset_start": 134,
          "offset_end": 171
        }
      ],
      "is_encoding_problem": false,
      "body": {
        "Multipart": [
          1,
          2,
          3
        ]
      },
      "offset_header": 0,
      "offset_body": 172,
      "offset_end": 810
    },
    {
      "headers": [
        {
          "name": {
            "Rfc": "content_type"
          },
          "value": {
            "ContentType": {
              "c_type": "text",
              "c_subtype": "x-myown",
              "attributes": [
                [
                  "charset",
                  "us-ascii"
                ]
              ]
            }
          },
          "offset_start": 215,
          "offset_end": 247
        }
      ],
      "is_encoding_problem": false,
      "body": {
        "Text": "hello\n"
      },
      "offset_header": 202,
      "offset_body": 248,
      "offset_end": 254
    },
    {
      "headers": [
        {
          "name": {
            "Rfc": "content_type"
          },
          "value": {
            "ContentType": {
              "c_type": "message",
              "c_subtype": "rfc822",
              "attributes": null
            }
          },
          "offset_start": 278,
          "offset_end": 294
        }
      ],
      "is_encoding_problem": false,
      "body": {
        "Message": {
          "html_body": [
            1,
            5
          ],
          "text_body": [
            4,
            5,
            6
          ],
          "attachments": [],
          "parts": [
            {
              "headers": [
                {
                  "name": {
                    "Rfc": "from"
                  },
                  "value": {
                    "Address": {
                      "name": null,
                      "address": "sub@domain.org"
                    }
                  },
                  "offset_start": 300,
                  "offset_end": 316
                },
                {
                  "name": {
                    "Rfc": "date"
                  },
                  "value": {
                    "DateTime": {
                      "year": 2012,
                      "month": 8,
                      "day": 12,
                      "hour": 12,
                      "minute": 34,
                      "second": 56,
                      "tz_before_gmt": false,
                      "tz_hour": 3,
                      "tz_minute": 0
                    }
                  },
                  "offset_start": 321,
                  "offset_end": 354
                },
                {
                  "name": {
                    "Rfc": "subject"
                  },
                  "value": {
                    "Text": "submsg"
                  },
                  "offset_start": 362,
                  "offset_end": 370
                },
                {
                  "name": {
                    "Rfc": "content_type"
                  },
                  "value": {
                    "ContentType": {
                      "c_type": "multipart",
                      "c_subtype": "alternative",
                      "attributes": [
                        [
                          "boundary",
                          "sub1"
                        ]
                      ]
                    }
                  },
                  "offset_start": 383,
                  "offset_end": 423
                }
              ],
              "is_encoding_problem": false,
              "body": {
                "Multipart": [
                  1,
                  2
                ]
              },
              "offset_header": 295,
              "offset_body": 424,
              "offset_end": 710
            },
            {
              "headers": [
                {
                  "name": {
                    "Rfc": "content_type"
                  },
                  "value": {
                    "ContentType": {
                      "c_type": "text",
                      "c_subtype": "html",
                      "attributes": null
                    }
                  },
                  "offset_start": 462,
                  "offset_end": 473
                }
              ],
              "is_encoding_problem": false,
              "body": {
                "Html": "<p>Hello world</p>\n"
              },
              "offset_header": 449,
              "offset_body": 474,
              "offset_end": 493
            },
            {
              "headers": [
                {
                  "name": {
                    "Rfc": "content_type"
                  },
                  "value": {
                    "ContentType": {
                      "c_type": "multipart",
                      "c_subtype": "alternative",
                      "attributes": [
                        [
                          "boundary",
                          "sub2"
                        ]
                      ]
                    }
                  },
                  "offset_start": 514,
                  "offset_end": 554
                }
              ],
              "is_encoding_problem": false,
              "body": {
                "Multipart": [
                  3,
                  6
                ]
              },
              "offset_header": 501,
              "offset_body": 555,
              "offset_end": 701
            },
            {
              "headers": [
                {
                  "name": {
                    "Rfc": "content_type"
                  },
                  "value": {
                    "ContentType": {
                      "c_type": "multipart",
                      "c_subtype": "alternative",
                      "attributes": [
                        [
                          "boundary",
                          "sub3"
                        ]
                      ]
                    }
                  },
                  "offset_start": 575,
                  "offset_end": 615
                }
              ],
              "is_encoding_problem": false,
              "body": {
                "Multipart": [
                  4,
                  5
                ]
              },
              "offset_header": 562,
              "offset_body": 616,
              "offset_end": 662
            },
            {
              "headers": [],
              "is_encoding_problem": false,
              "body": {
                "Text": "sub3 text"
              },
              "offset_header": 623,
              "offset_body": 624,
              "offset_end": 633
            },
            {
              "headers": [],
              "is_encoding_problem": false,
              "body": {
                "Text": "sub3 text2"
              },
              "offset_header": 641,
              "offset_body": 642,
              "offset_end": 652
            },
            {
              "headers": [],
              "is_encoding_problem": false,
              "body": {
                "Text": "sub2 text2"
              },
              "offset_header": 680,
              "offset_body": 681,
              "offset_end": 691
            }
          ]
        }
      },
      "offset_header": 265,
      "offset_body": 295,
      "offset_end": 728
    },
    {
      "headers": [
        {
          "name": {
            "Rfc": "content_type"
          },
          "value": {
            "ContentType": {
              "c_type": "text",
              "c_subtype": "plain",
              "attributes": null
            }
          },
          "offset_start": 752,
          "offset_end": 764
        }
      ],
      "is_encoding_problem": false,
      "body": {
        "Text": "Another part"
      },
      "offset_header": 739,
      "offset_body": 765,
      "offset_end": 777
    }
  ]
}