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

Invalid value separators in notification email headers #22815

Open
hg opened this issue Feb 8, 2023 · 4 comments
Open

Invalid value separators in notification email headers #22815

hg opened this issue Feb 8, 2023 · 4 comments
Labels

Comments

@hg
Copy link

hg commented Feb 8, 2023

Description

Hi,

I've been trying out email replies merged in #22056.

They are breaking aerc (the email client) with this message:

worker.go:536: could not get message info: mail: missing '<' in msg-id

https://github.com/emersion/go-message/blob/master/mail/header.go#L174-L181

Naturally, I thought the issue was with the client, but after digging for a while found out that gitea joins email header values (References, List-Unsubscribe, probably others) using commas as separators.

References: <xxx/yyy/issues/42@git.example.com>,
 <reply-xxxxxxxxyyyyyyyyyyyyyyyzzzzzzzzzzzz@git.example.com>

List-Unsubscribe: <https://git.example.com/xxx/yyy/issues/42>,
  <mailto:git+qwertyuiopasdfghjzxcvbn@example.com>

I don't think this is valid email. RFC5322 requires CFWS to separate header values (which is either comments or whitespace), and does not allow commas.

Could you please confirm if this is a bug?

Gitea Version

1.19.0+dev-444-g2c6cc0b8c

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

docker, gitea/gitea:dev

Database

PostgreSQL

@hg hg added the type/bug label Feb 8, 2023
@KN4CK3R
Copy link
Member

KN4CK3R commented Feb 8, 2023

@wxiaoguang
Copy link
Contributor

One more issue of the unmaintained gomail package?

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Feb 8, 2023

This comment seems to be not related. Hide the content.

I think the problem might not be related to gomail, but somewhat/somehow related to:

fmt.Sprintf("%s/%s/%d%s@%s" doesn't look good to be used as a message-id (even if it's quoted by < by its callers)

And then it's changed to fmt.Sprintf("<%s/%s/%d%s@%s>" in #22056.

I haven't read the standard yet, but it looks related to the error message: "worker.go:536: could not get message info: mail: missing '<' in msg-id"

So, maybe it's time to check some standard documents 😀

@KN4CK3R
Copy link
Member

KN4CK3R commented Feb 8, 2023

The error message is (just a first look) because the parser wants to read a < but gets a ,.

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

No branches or pull requests

3 participants