Overview
Yes, SMTP passwords for SMTP users can be customized through either of two methods: the Mailgun Control Panel or the Domains API. For more information regarding passwords and security in general, check out this blog post!
Note: if you're instead seeking to create SMTP credentials with system-generated passwords by way of the Mailgun Control Panel, please take a look at this article.
Using the control panel
We'll show you how to do this below:
- First, log in to the Mailgun Control Panel (if you have not already done so).
- Then, within the left-hand navigation pane, click the Send product and then click the Sending option to expand its list of suboptions.
- Next, click the Domain settings suboption, and then click on the SMTP credentials tab.
- Ensure that the domain for which you wish to create a customized SMTP password is displayed within the Domain drop-down list towards the upper-right portion of the page.
- To customize the password, click the Reset password button.
-
Select Manual in the Password creation method drop-down.
-
Enter your password (between 5 and 32 characters in length), and then save your password by clicking the Reset Password button.
- NOTE: The new SMTP password will be available within a dark-gray notification window that appears in the bottom-right portion of the Control Panel. Save this password in your application and in a secure password manager, as it will not be displayed again.
Using the Domains API
When creating new credentials
For example, the below HTTP POST request to the Domains API creates a new pair of SMTP credentials (customized password included):
# if the domain and its credentials reside in the US region
curl -s --user 'api:YOUR_API_KEY' \
https://api.mailgun.net/v3/domains/YOUR_DOMAIN_NAME/credentials \
-F login='alice@YOUR_DOMAIN_NAME' \
-F password='supaSecret123987@#$butNotTh@t$ecrET'
# if the domain and its credentials reside in the EU region
curl -s --user 'api:YOUR_API_KEY' \
https://api.eu.mailgun.net/v3/domains/YOUR_DOMAIN_NAME/credentials \
-F login='alice@YOUR_DOMAIN_NAME' \
-F password='supaSecret123987@#$butNotTh@t$ecrET'
This endpoint can be found in our API documentation.
When updating existing credentials
But what if you wish to update an existing pair of SMTP credentials rather than create a new pair of SMTP credentials? To update an existing pair of SMTP credentials with a new customized password, an HTTP PUT request will be needed:
# if the domain and its credentials reside in the US region
curl -s --user 'api:YOUR_API_KEY' -X PUT \
https://api.mailgun.net/v3/domains/YOUR_DOMAIN_NAME/credentials/alice \
-F password='abc123'
# if the domain and its credentials reside in the EU region
curl -s --user 'api:YOUR_API_KEY' -X PUT \
https://api.eu.mailgun.net/v3/domains/YOUR_DOMAIN_NAME/credentials/alice \
-F password='abc123'
The above is the 7th example ("Updating the password for a given credential pair") in the aforementioned API documentation.
Potential password errors
If Mailgun considers the password too short, you'll see this API response:
{
"message": "Password is too short."
}
And if Mailgun considers the password insecure, you'll see this API response:
{
"message": "Password is not secure."
}
The solution to either case is to increase the complexity of the password.
Need Support?
Our Support Team here at Sinch Mailgun is happy to help! Reach out to us in the Support page of your Mailgun Control Panel, and we'll be with you shortly!