We're experiencing difficulty. Our engineers are on it. Please check status.mailgun.com for real-time updates.

Can I Customize My SMTP Credentials?

Table Of Contents
Quick Overview
The Full Details
    When Creating New Credentials
    When Updating Existing Credentials
    Potential Password Errors
Got Questions?

Quick Overview

In a word: yes. However, the use of the Domains API is required for this task as the credentials cannot be customized either through the Mailgun Control Panel or by any member of our Support Team. 

As such, if unfamiliar with using a programming language and APIs, it's best to reach out to your IT Help Desk or Development Team for assistance in customizing the password.

(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).

The Full Details

While it's not possible to shorten or customize the SMTP password within the Mailgun Control Panel, it is possible by 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 example (available in multiple programming languages) can be found in our API documentation (the 6th example "Creating new SMTP credentials").

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. For more about passwords and security, check out this blog post!

Got Questions?

Mailgun by Sinch has answers! If you have any concerns or questions, please send us a Support ticket using the Support page within your Mailgun Control Panel.  Our Support Team will be happy to assist!