SMTP Setup

Mailclutch is a plain SMTP server. If your stack can send mail, it can send to Mailclutch — starting with the working credentials below.

Your sandbox

Live credentials, filled into every snippet on this page as soon as they arrive.

Host
smtp.mailclutch.com
Port
587
Username
mc_0000000000000000
Password
pw_0000000000000000
  • Ports 25, 465, 587, 2525 all work — STARTTLS everywhere except 465, which is implicit TLS.
  • The sandbox keeps what it catches for 24 hours; nothing is ever delivered onward.

The four values

A host, a port, a username and a password. That is all any mailer needs, and all the configuration Mailclutch asks for; in your own code the pair belongs in environment variables like anything else.

SMTP settings
Hostsmtp.mailclutch.com
Port587 with STARTTLS. The others, when that one will not do
Usernamemc_ and sixteen characters: the disposable pair above, or one of your own sandboxes once you have an account
Passwordpw_ and sixteen characters — the matching half of the pair
AuthenticationPLAIN or LOGIN; let the library choose
EncryptionTLS 1.2 or better, STARTTLS or implicit depending on the port

The pair picks the sandbox; the address on the envelope plays no part. Nothing is ever delivered onward, so your application can keep sending to real.customer@example.com from staging — it lands in the sandbox, and nowhere else. Once you have an account each sandbox has its own pair, so one client's staging can never write into another's.

Pick a port

Four ports, one server. They differ in one thing only: whether the connection starts in clear text and upgrades, or is TLS from the first byte. Most connection problems are a client set to one talking to a port that expects the other.

The submission port. Opens in clear text, upgrades to TLS, then authenticates.

The conversation starts unencrypted, the client asks to switch to TLS, and the credentials are only sent once it has. Encryption is negotiated rather than assumed, so tell your mailer to require it.

Use it when: The default everywhere. Use it unless something below applies.

S: 220 localhost ESMTP Service ReadyC: EHLO app.example.comS: 250-STARTTLSC: STARTTLSS: 220 2.0.0 Ready to start TLS   [TLS handshake]C: AUTH PLAIN …S: 235 2.0.0 Authentication succeeded

Send something

The pair above, in one line to run from a terminal — or pick your stack from the chip and get the block to paste. It sends a real message, to the sandbox the pair belongs to.

curl -fsS https://app.mailclutch.com/en-CA/welcome.eml |
curl "smtp://smtp.mailclutch.com:587" --ssl-reqd \
  --user "mc_0000000000000000:pw_0000000000000000" \
  --mail-from "welcome@mailclutch.com" \
  --mail-rcpt "anyone@example.com" \
  --upload-file -

Awaiting your email

Send from any address; it stops here rather than going onward. The sandbox keeps what it catches for 24 hours.

For a stack-by-stack walkthrough — what to install, the whole configuration block and a test message to send — see the framework guides.

Check the connection by hand

When a framework says “could not connect” and nothing more, take the framework out of the picture. Each of these prints the whole conversation, with the server's reply to every line — which is exactly what the list below reads.

# One message, with cURL: -v prints every line the server answers.
printf 'Subject: ping\n\nhello\n' | curl -v smtp://smtp.mailclutch.com:587 --ssl-reqd \
  -u mc_0000000000000000:pw_0000000000000000 \
  --mail-from welcome@mailclutch.com --mail-rcpt anyone@example.com -T -

The reply to read is the one after AUTH: 235 is yes, and from there everything else is your application's doing.

Troubleshooting

Every reply is quoted as the server writes it, so you can search your log for the exact line. Open the one you have.

Connecting

The connection is refusedECONNREFUSED · Connection refused

What it means. Nothing is listening where the client is knocking. Almost always the host is still the one from a local tool — localhost:1025 from Mailpit or MailHog, 127.0.0.1 from a docker-compose file — or a typo in the host name.

What to do.

Check the host the application actually resolved: smtp.mailclutch.com, not an alias, not the app's URL. Then prove the port is open from the machine that sends:

nc -vz smtp.mailclutch.com 587
The connection hangs, then times outETIMEDOUT · Connection timed out

What it means. Two unrelated causes look identical. Either an outbound firewall or a PaaS drops the port — most clouds block 25, some block 587 too — or the client and the server disagree on TLS: a client doing STARTTLS on 465 waits for a clear-text banner while the server waits for a TLS handshake, and both wait forever.

What to do.

If the hang is on 465, switch to 587 with STARTTLS, or tell the client to use implicit TLS. If it is on 587, try 2525: it is the same server on a port nothing blocks. The nc line above tells the two apart — a blocked port never connects at all.

The TLS handshake failswrong version number · unexpected EOF · SSL handshake failed

What it means. A client set to implicit TLS (secure: true, SSL, SMTPS) is talking to a STARTTLS port. It opens with a TLS handshake; the server, expecting an EHLO in clear text, reads the handshake as a garbled command and answers 500 5.5.2 Syntax errors — which the client reports as a broken handshake.

What to do.

Pick one side and change it: either keep port 587 and turn implicit TLS off (STARTTLS is negotiated after connecting), or keep implicit TLS and use port 465. The port picker above shows what each one expects.

The certificate is rejectedunable to get local issuer certificate · self-signed certificate in chain

What it means. The server presents a certificate from a public authority, rotated automatically, so a rejection comes from the client's side: a CA bundle that is years old (a slim Docker image without ca-certificates, an old Alpine), or a corporate proxy that re-signs TLS on the way out.

What to do.

Update the CA store of the machine that sends — apk add ca-certificates, apt-get install ca-certificates, or a current base image. Do not turn verification off: a mailer that skips it in staging ships that way to production.

Authenticating

Authentication fails535 5.7.8 Authentication credentials invalid

What it means. The server received a username and a password and said no — to the pair as it arrived, which is not always the pair in your configuration. One of: an account password or API token used instead of the SMTP pair; a pair that has expired, or one minted more than a week ago and never used; a value mangled on the way (a trailing space, quotes copied into the value, an environment file not reloaded).

What to do.

Take the pair from the card at the top of this page — it is live for this visit — and test it outside your application with the swaks line below. A 235 there and a 535 from your app means the pair is fine and the application is mangling it: look at whitespace and quoting. A 535 from swaks too means the pair is wrong or dead, and no amount of application debugging will help.

Only two shapes exist: a username mc_ plus sixteen characters, a password pw_ plus sixteen. Anything else is refused before it reaches the app.

Authentication fails, temporarily454 4.7.0 Temporary authentication failure, try again later

What it means. Not you, not now. The SMTP server could not get an answer from the application within ten seconds, so it refused rather than guess. Your pair was not examined.

What to do.

Retry; a mailer with a retry policy does it on its own, since the code is a 4xx. If it persists for more than a few minutes, something is wrong on our side — tell us.

Relay access denied554 5.7.1 Relay access denied

What it means. The client never authenticated. Without AUTH, the server only accepts mail for its own forward addresses; everything else is refused as relaying. The usual cause is a mailer configured with the host and port but no username and password — or a library that silently skips AUTH when one of the two is empty.

What to do.

Set both values and make sure the library sends them: in a verbose log you should see AUTH PLAIN or AUTH LOGIN before MAIL FROM.

The mechanism is not supported504 5.7.4 Unsupported authentication mechanism

What it means. The client asked for CRAM-MD5, DIGEST-MD5, XOAUTH2 or something else exotic. The server speaks PLAIN and LOGIN, and advertises both.

What to do.

Let the client negotiate, or pin it to PLAIN. LOGIN exists for the clients that cannot do PLAIN — Outlook, some older MTAs — and does the same thing in two steps.

Please introduce yourself first502 5.5.1 Please introduce yourself first.

What it means. A hand-rolled client sent AUTH or MAIL FROM before EHLO. Every library does this for you; it only shows up in a script that speaks SMTP by hand.

What to do.

Send EHLO with a host name first — see the openssl session below for the order of the conversation.

The old pair still works after rotating it

What it means. A successful login is cached for five minutes, so a pair that was just rotated or just expired keeps authenticating until the cache entry lapses.

What to do.

Nothing: wait five minutes. Mail sent with the old pair in that window is accepted and then dropped, which is the next list's first entry.

Sending

Accepted, but nothing appears in the sandbox250 2.0.0 OK: queued — then silence

What it means. The server took the message. Then one of four things happened. The application queued it and no worker is running, so it never actually left. It left with a different pair than the one you are looking at — another environment, another developer, a CI job. The sandbox you opened is not the one the pair belongs to. Or the disposable sandbox dropped it: it holds 50 messages and takes nothing over 1 MiB, and after its 24 hours it keeps accepting for a few minutes while discarding everything.

What to do.

In order: run the queue worker, or send synchronously while debugging. Open the sandbox with the button under the command bar — that button always opens the pair's own sandbox. Then send the one-line cURL from this page: if it lands and your application's mail does not, the application is using another pair or another mailer.

The real recipient received the email

What it means. Not through Mailclutch — the sandbox never delivers onward, whatever the address. The application still has a path to a real mailer: a production MAIL_MAILER overriding the staging one, a second mailer configured for one notification, or jobs queued before the configuration changed and carrying the old transport.

What to do.

Find the other transport. A grep for the real provider's host in the deployed configuration, and a look at the queue for jobs serialized with the old mailer, usually ends it.

Emails land in the wrong sandbox

What it means. Two environments share one pair. Credentials pick the sandbox — the address on the envelope plays no part — so whoever sends with the pair lands in its sandbox.

What to do.

One sandbox per environment, each with its own pair. Once you have an account that is a click; until then, the pair on this page is one and the next visit mints another.

The message is too large552 5.3.4 Maximum message size exceeded

What it means. The whole message — body, attachments and their base64 overhead — is over 36 MiB, and the server refused it at the socket rather than after the upload. Attachments over 25 MiB are kept in the raw message but not extracted as files.

What to do.

Shrink the attachment, or send it as a link — which is what a production mailer would make you do too.

Too many recipients552 5.5.3 Maximum limit of 50 recipients reached

What it means. A single message carried more than fifty recipients across To, Cc and Bcc. The first fifty were accepted; the fifty-first was refused.

What to do.

Send in batches of fifty or fewer. The sandbox captures one copy either way.

Temporary delivery failure451 4.3.0 Temporary delivery failure, please retry later

What it means. The server had the message but the application did not confirm storing it within thirty seconds. Nothing was lost on your side: the message was refused, not dropped.

What to do.

Retry; a queued mailer does so on its own. Persisting for minutes is a problem on our side — tell us.

Too many errors, closing500 5.5.1 Too many errors. Quiting now

What it means. The client sent more than three commands the server did not understand, and the server hung up. This is what an implicit-TLS client looks like on a STARTTLS port — see the handshake entry above — or a script with a typo in its commands.

What to do.

Read the lines the server answered just before: each one names the command it did not recognize.

Still stuck? The server speaks a little more on every port than this page lists — PIPELINING, 8BITMIME, SMTPUTF8, CHUNKING — and nothing it does is secret. Or write to us with the swaks output; that is all we need.