-
Notifications
You must be signed in to change notification settings - Fork 219
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
Custom greeting and DATA response #131
Comments
Just don't try customize messages, they aren't shown anywhere to the user. |
How about the first request, easier / clearer SMTP response? |
This also sounds like customization. |
But why doesn't allow developers to customize SMTP response?
Reasonable? :) |
In both of these cases you don't reply 250, right? |
Yes, and 4xx, 5xx smtp code should end the smtp session. |
If you're hitting an error, returning an |
We return 4xx/5xx on purpose. For example:
For first case, it's not an "error" like "disk is full", but we still need to reject the session. My suggestion is: Add a new struct |
|
Methods of
Session
interface have to returnsmtp.SMTPError{...}
to customize returned smtp code and message. Although it's ok to set smtp code250
for normal exit withSMTPError{...}
, but will the logic of handlingSMTPError
change internally ingo-smtp
someday? Should we separate a normal exit (with custom return message) and error (e.g.SMTPResponse
and existingSMTPError)
? Should we expose something likeconn.WriteResponse()
?No way to customize the greeting text. We'd like to customize it and display our product name. https://github.com/emersion/go-smtp/blob/master/conn.go#L937
How about add a new attribute like
Banner
inServer
struct for this purpose, with default value set to currentfmt.Sprintf("%v ESMTP Service Ready", c.server.Domain)
. PR Add new fieldBanner
inServer
struct for custom smtp greeting text #132 fixes this.Postfix MTA uses parameter
smtpd_banner
for this greeting text, so i thinkBanner
should be fine.The text was updated successfully, but these errors were encountered: