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

Replying wrongly parses comma in name part #75

Closed
The-Compiler opened this issue Sep 16, 2024 · 0 comments
Closed

Replying wrongly parses comma in name part #75

The-Compiler opened this issue Sep 16, 2024 · 0 comments

Comments

@The-Compiler
Copy link
Contributor

With

dodo/dodo/compose.py

Lines 83 to 91 in 503763c

email_sep = re.compile(r'\s*,\s*')
if 'Reply-To' in msg['headers']:
senders.append(msg['headers']['Reply-To'])
elif 'From' in msg['headers']:
senders.append(msg["headers"]["From"])
if 'To' in msg['headers']:
recipients += email_sep.split(msg['headers']['To'])
if 'Cc' in msg['headers']:
recipients += email_sep.split(msg['headers']['Cc'])

a mail with a To: "Lastname, Firstname" <first.last@example.org> causes the reply to have

To: "Lastname
Cc: Firstname" <first.last@example.org>
The-Compiler added a commit to The-Compiler/dodo that referenced this issue Sep 17, 2024
co- Properly split addresses into name and email
- Deal with them as (name, email) tuples
  internally, as a (quoted) name can contain a comma
- Format them properly again when inserting into the message

Fixes akissinger#75
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

1 participant