Skip to content

Add support for generating SMTP credentials for aliases#13

Open
mattwebbio wants to merge 1 commit intoabagayev:mainfrom
mattwebbio:add-generate-alias-password
Open

Add support for generating SMTP credentials for aliases#13
mattwebbio wants to merge 1 commit intoabagayev:mainfrom
mattwebbio:add-generate-alias-password

Conversation

@mattwebbio
Copy link

@mattwebbio mattwebbio commented Dec 31, 2025

This PR adds support for the generate-password API endpoint, which allows generating SMTP credentials for an alias so it can send outbound email.

Depended on by abagayev/terraform-provider-forwardemail#14

Changes

  • New GeneratePasswordParameters struct for request options
  • New GeneratedPassword struct for the response
  • New GenerateAliasPassword(domain, alias, params) method on the client

Why

I'm working on adding SMTP credential management to the Terraform provider, and needed this method in the client library first. I will be submitting that PR shortly.

Example usage

params := forwardemail.GeneratePasswordParameters{
    IsOverride: &true,
}
creds, err := client.GenerateAliasPassword("example.com", "contact", params)
// creds.Username = "contact@example.com"
// creds.Password = "generated-password"

Thanks for considering my PR :)

This adds support for the generate-password API endpoint, which allows
generating SMTP credentials for an alias. The credentials enable the
alias to send outbound email via SMTP.

API documentation:
https://forwardemail.net/en/email-api

New types:
- GeneratePasswordParameters: input options including custom password,
  override flag, and email instructions recipient
- GeneratedPassword: response containing username and password

This change is needed to support a new `forwardemail_alias_smtp_credentials`
resource in the Terraform provider, enabling users to manage SMTP credentials
for their aliases as infrastructure-as-code.

The implementation follows the existing patterns used for other alias
operations in this library.
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

Successfully merging this pull request may close these issues.

1 participant

Comments