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

The “header” processor populates “Received:” headers wrongly. #198

Closed
issuefiler opened this issue Nov 22, 2019 · 3 comments
Closed
Labels

Comments

@issuefiler
Copy link

issuefiler commented Nov 22, 2019

RFC 5321

   From-domain    = "FROM" FWS Extended-Domain

   By-domain      = CFWS "BY" FWS Extended-Domain

   Extended-Domain  = Domain /
                    ( Domain FWS "(" TCP-info ")" ) /
                    ( address-literal FWS "(" TCP-info ")" )

   TCP-info       = address-literal / ( Domain FWS address-literal )
                  ; Information derived by server from TCP connection
                  ; not client EHLO.

addHead += "Received: from " + e.Helo + " (" + e.Helo + " [" + e.RemoteIP + "])\n"

A Domain in a TCP-info should not be from the HELO command. Would better omit it as go-guerrilla doesn’t do rDNS lookup.

And replacing from with FROM would better comply with the RFC. (Unsure if case-insensitive.)


addHead += " by " + e.RcptTo[0].Host + " with SMTP id " + hash + "@" + e.RcptTo[0].Host + ";\n"

I can’t say it is wrong for this one, just want to know your opinion on changing with SMTP to WITH ESMTPS, as go-guerrilla supports both EHLO and STARTTLS (which might be a poor reason to back it).

@flashmob
Copy link
Owner

flashmob commented Nov 22, 2019

Hi, thanks for the bug reports - they're excellently written!
Sorry, no time to respond them yet, will soon.

@flashmob
Copy link
Owner

Thanks.

TODO

  • Remove e.Helo from the tcp-info header, only include the source IP in the tcp info
  • Change with SMTP to with ESMTPS' / with ESMTP`, depending on what protocol was used

As for, FROM - in the wild, eg. Postfix, Gmail always leave it all lowercase.

@flashmob
Copy link
Owner

flashmob commented Dec 13, 2019

Implemented in #202

  • Remove e.Helo from the tcp-info header, only include the source IP in the tcp info
  • Change with SMTP to with ESMTPS/ with ESMTP, depending on what protocol was used

@flashmob flashmob added testing and removed todo labels Dec 13, 2019
flashmob added a commit that referenced this issue Dec 27, 2019
@flashmob flashmob added lgtm and removed testing labels Dec 27, 2019
flashmob added a commit that referenced this issue Dec 27, 2019
- Parser captures quoted local-parts without the escape characters
- mail.Address.String() know when to quote local-part, 
- server's `allowsHost` function is ipv6 address aware (addresses specified in the config will get normalized to their ipv6 simplest form, addresses parsed from RCPT and MAIL commands will have ipv6 normalized)
- if `<postmaster>` is used in the RCPT TO (without a host), then new functionality was added to assume that the host is assumed to be the Hostname setting for the Server
- HELO/EHLO argument validation. #200
- The “header” processor populates “Received:” headers wrongly. #198
-  tiny bug in “p_redis.go”. #196
- “MimeHeaderDecode” (envelope.go) returns an incorrectly-spaced string. #195
- go-guerrilla cannot properly handle some valid addresses. #199
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

2 participants