-
Notifications
You must be signed in to change notification settings - Fork 69
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
fix: send email with local name via custom client #607
Conversation
actions/email.go
Outdated
@@ -26,6 +27,7 @@ type EmailAction struct { | |||
Port int | |||
Sender string | |||
Recipients []string | |||
LocalName string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is LocalName the right name for this variable? Not DomainName maybe (as derived from fqdn)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that LocalName
isn't a right name. It should be changed.
also DomainName
can be misleading for email settings, isn't it?
maybe something like client-host-name
?
@@ -89,6 +95,58 @@ func (email *EmailAction) Send(content map[string]string) error { | |||
return nil | |||
} | |||
|
|||
func (email EmailAction) sendEmailWithCustomClient(addr string, a smtp.Auth, from string, to []string, msg []byte) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe add some verbosity to this function? var names, logs, errors and docstrings(not necessary), to look feel and stay readable like the previous sendEmail implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, sure. I've added a comment. will think over it more.
Thanks @afdesk ! Left some comments. Please note we may need a cherry-pick into postee-for-enterprise branch, hopefully this isn't a breaking change :) |
oh, thanks for the review. I missed it. |
hey @afdesk ! I was away for a few days - how are we doing on this PR? Ready for review? |
LGTM @afdesk ! let's go ahead and merge, and we will open a cherry-pick into |
There are cases when SMTP server needs fully-qualified client hostname.
so Postee should have a config for it.
it fixes #602