Unable to Configure Email Sending Without `WithSSLPort` Using YAML Configuration · Issue #427 · uptrace/uptrace · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having trouble configuring the email sending functionality in Uptrace (from docker) following the documentation at Sending Emails and based on the guidance in Issue #379.
I've written a working Go sample using the go-mail package that successfully sends an email through Gmail. The key to getting it working is not using the mail.WithSSLPort option. Here’s the relevant code that works for my setup:
package main
import (
"fmt""log"
mail "github.com/wneessen/go-mail"
)
funcmain() {
from:="example@gmail.com"options:= []mail.Option{
mail.WithSMTPAuth("PLAIN"),
mail.WithUsername("example@gmail.com"),
mail.WithPassword("password_example"),
mail.WithTLSPortPolicy(mail.TLSMandatory),
// mail.WithSSLPort(false), // Error: dial failed: tls: first record does not look like a TLS handshake// mail.WithSSLPort(true), // Error: dial failed: tls: first record does not look like a TLS handshake// <no WithSSLPort>, // Successmail.WithPort(587),
}
// Create a new mailer instanceclient, err:=mail.NewClient("smtp.gmail.com", options...)
iferr!=nil {
fmt.Println(err)
return
}
// Create a new messagemsg:=mail.NewMsg()
msg.Subject("test")
msg.SetBodyString(mail.TypeTextHTML, "test")
iferr:=msg.FromFormat(from, from); err!=nil {
fmt.Println(err)
return
}
iferr:=msg.To(from); err!=nil {
fmt.Println(err)
return
}
// Send the emailiferr:=client.DialAndSend(msg); err!=nil {
log.Fatal(err)
}
log.Println("Email sent successfully!")
}
The key point is that the email is sent only when mail.WithSSLPort is not called. However, I can't figure out how to replicate this behavior using the YAML configuration in Uptrace.
The current Go code in pkg/bunapp/app.go always calls mail.WithSSLPort due to the switch logic, making it difficult to bypass this option. Here is the relevant code:
Uh oh!
There was an error while loading. Please reload this page.
I'm having trouble configuring the email sending functionality in Uptrace (from docker) following the documentation at Sending Emails and based on the guidance in Issue #379.
I've written a working Go sample using the
go-mail
package that successfully sends an email through Gmail. The key to getting it working is not using themail.WithSSLPort
option. Here’s the relevant code that works for my setup:The key point is that the email is sent only when
mail.WithSSLPort
is not called. However, I can't figure out how to replicate this behavior using the YAML configuration in Uptrace.The current Go code in
pkg/bunapp/app.go
always callsmail.WithSSLPort
due to theswitch
logic, making it difficult to bypass this option. Here is the relevant code:My question is: how can I configure the YAML to avoid using
mail.WithSSLPort
and successfully send emails, just like in the working Go sample?Any guidance on how to bypass or modify the switch logic in
app.go
or structure the configuration to disableWithSSLPort
would be greatly appreciated.The text was updated successfully, but these errors were encountered: