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

Feature Request: Support for XCLIENT Command in go-smtp #267

Open
zzh-coders opened this issue Jul 15, 2024 · 0 comments
Open

Feature Request: Support for XCLIENT Command in go-smtp #267

zzh-coders opened this issue Jul 15, 2024 · 0 comments

Comments

@zzh-coders
Copy link

Background
I am currently using the Extension method to check if the server supports the XCLIENT extension. However, I would like to know how to issue the XCLIENT command using the go-smtp library.

Request
Please provide support for issuing the XCLIENT command in the go-smtp library. Specifically, it would be helpful to have a clear example or built-in method to facilitate this functionality.

Current Situation
Here is the code snippet I am using to check for the XCLIENT extension:

`client, err := smtp.Dial("smtp.example.com:25")
if err != nil {
log.Fatal(err)
}
defer client.Close()

ok, ext := client.Extension("XCLIENT")
if ok {
fmt.Println("XCLIENT extension is supported:", ext)
} else {
fmt.Println("XCLIENT extension is not supported")
}`

Desired Functionality
I need to issue the XCLIENT command after confirming that the server supports it. Ideally, the solution should handle the following:

Issuing the XCLIENT command.
Specifying parameters such as ADDR, NAME, PORT, etc.
Handling any responses or errors from the server.
Example Implementation
A conceptual example of what I am looking for:

if ok { err := client.XClient("ADDR=192.168.1.1 NAME=myclient") if err != nil { log.Fatal("Error issuing XCLIENT command:", err) } }

Conclusion
Enhancing the go-smtp library to support the XCLIENT command would be highly beneficial for users needing to interact with servers that require this extension. Thank you for considering this feature request.

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

No branches or pull requests

1 participant