chatmail / chatmail/async-smtp

Rejects valid emails

Open
#43 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
74
Forks
16
PR merge metrics
No merged PRs in 30d

Description

The `EmailAddress` class uses the `fast_chemail` crate, which rejects emails that are valid according to RFCs 5322 and 6532:

```rust
use async_smtp::EmailAddress;

#[test]
fn accepts_valid_email_addresses() {
assert!(EmailAddress::new(r#""deliver able"@example.crustytoothpaste.net"#.into()).is_ok());
assert!(EmailAddress::new("🔵@example.crustytoothpaste.net".into()).is_ok());
assert!(EmailAddress::new("pingüino@example.crustytoothpaste.net".into()).is_ok());
assert!(EmailAddress::new("sandals@example.crustytoothpaste.net".into()).is_ok());
}
```

All of these addresses are deliverable (to me) if you remove the `example.`. Only the last is accepted.

Moreover, it appears that this library intentionally does not support the full range of valid email addresses:

> A library to validate the email as it is defined in the HTML specification. The RFC 5322 is too lax (allowing comments, whitespace characters, and quoted strings in manners unfamiliar to most users) to be of practical use.

I should point out that the HTML specification is not involved in the sending of email and therefore what it defines as a valid email is totally irrelevant. Moreover, SMTPUTF8 is seeing increasing adoption, and the HTML specification rejects all internationalized email addresses, which is unhelpful since most people on the planet don't speak English at all.

A different implementation, supporting the full range of options specified in RFC 6532, should be used instead.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.