Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functions to parse List-Id #118

Open
link2xt opened this issue May 16, 2023 · 2 comments
Open

Add functions to parse List-Id #118

link2xt opened this issue May 16, 2023 · 2 comments

Comments

@link2xt
Copy link
Contributor

link2xt commented May 16, 2023

List-Id is defined in RFC 2919.

A header may look like this (two lines, second line starts with a tabulation):

List-Id: "Mailing list for \"Foo Bar\""                                    
    <foo-bar.lists.example.net>  

It should be possible to extract so-called "phrase" part of the header (Mailing list for "Foo bar").
Existing function addrparse_header does not work because it returns MailListAddr. An attempt to extract an address with extract_singe_info fails to parse the field with an error "Invalid address found: must contain a '@' symbol".

So the field cannot be parsed as an address list and a dedicated parser for List-Id is needed.

@staktrace
Copy link
Owner

Hi, sorry for the delay here. I don't think I'll have time in the foreseeable future to implement this but I would take a PR. Can probably reuse most of the code from the existing header parser but have separate types for holding the parsed results and returning them.

@xandkar
Copy link

xandkar commented Jul 31, 2024

@link2xt mail-parser implements RFC 2919 (among others).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants