You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This guide explains how to configure Mailtrap SMTP in Nutify for email notifications, including a workaround for the hidden From Email field.
Context
When using Mailtrap with Nutify, the SMTP connection may work correctly, but Nutify can still fail with a generic:
Configuration Error
In debug logs, the real error may look like this:
msmtp: envelope from address api not accepted by the server
msmtp: server message: 501 5.1.7 Bad sender address syntax
msmtp: could not send mail
The cause is that Nutify may use the SMTP username as the sender address.
For Mailtrap, the SMTP username is usually:
api
But api is not a valid email sender address. Mailtrap requires the sender address to belong to a verified sending domain.
Example valid sender:
hello@example.com
Required Mailtrap values
In Mailtrap, create or use an SMTP/API token for your verified sending domain.
Typical SMTP values:
Field | Value
-- | --
SMTP server | live.smtp.mailtrap.io
SMTP port | 587
Username | api
Password | Your Mailtrap SMTP/API token
Encryption | STARTTLS
Sender / From Email | An address from your verified domain
Recipient / To Email | Any destination address you want to receive alerts on
Important:
Username = api
From Email = hello@example.com
Do not use api as the sender address.
Problem: From Email field may be hidden
In some Nutify versions, the From Email field exists in the HTML but is hidden in the UI for some providers.
If the field is not visible, Nutify may fall back to the SMTP username as sender.
That creates this invalid msmtp configuration:
from api
user api
Mailtrap rejects this because api is not a valid sender email address.
If from_email is empty, NULL, or api, the configuration is likely still wrong.
Optional: mark the configuration as default
If you only have one email configuration but is_default is set to 0, Nutify may still use it as the first available configuration. However, you can mark it as default manually.
Inside the container:
cd /app/nutify/instance
python3 - <<'PY'
import sqlite3
con = sqlite3.connect("nutify.db.sqlite")
cur = con.cursor()
cur.execute("UPDATE ups_opt_mail_config SET is_default = 1 WHERE id = 1")
con.commit()
msg = EmailMessage()
msg["From"] = from_email
msg["To"] = to_email
msg["Subject"] = "Mailtrap SMTP test from Nutify container"
msg.set_content("This is a direct SMTP STARTTLS test from the Nutify container.")
with smtplib.SMTP(host, port, timeout=20) as smtp:
smtp.set_debuglevel(1)
smtp.ehlo()
smtp.starttls(context=ssl.create_default_context())
smtp.ehlo()
smtp.login(username, password)
smtp.send_message(msg)
print("OK: email sent")
PY
A successful SMTP transaction should end with something similar to:
250 2.0.0 Ok: queued
OK: email sent
Security note:
Do not publish or share lines containing:
AUTH PLAIN ...
That line contains your credentials encoded in Base64. If it was shared publicly, rotate the Mailtrap token immediately.
Common errors
501 5.1.7 Bad sender address syntax
Cause:
from = api
Fix:
Use a valid sender address from your verified Mailtrap domain:
Enable debug logging or check the Nutify mail logs. Look for msmtp stderr.
SMTP works manually, but Nutify fails
Cause:
The manual test probably used a valid From: email, while Nutify used api as the envelope sender.
Fix:
Set the hidden from_email field to a valid verified sender address.
Suggested UI improvement
This may be considered a small UI/UX issue.
Nutify already has a from_email field, but it may be hidden for some SMTP providers. For providers like Mailtrap, SendGrid, Mailgun, Amazon SES, Postmark, etc., the sender address can be different from the SMTP username and is often required.
Suggested improvement:
Always show the From Email field for custom SMTP providers.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Mailtrap SMTP setup guide for Nutify
This guide explains how to configure Mailtrap SMTP in Nutify for email notifications, including a workaround for the hidden From Email field.
Context
When using Mailtrap with Nutify, the SMTP connection may work correctly, but Nutify can still fail with a generic:
In debug logs, the real error may look like this:
The cause is that Nutify may use the SMTP username as the sender address.
For Mailtrap, the SMTP username is usually:
But
apiis not a valid email sender address. Mailtrap requires the sender address to belong to a verified sending domain.Example valid sender:
Required Mailtrap values
In Mailtrap, create or use an SMTP/API token for your verified sending domain.
Typical SMTP values:
Field | Value -- | -- SMTP server | live.smtp.mailtrap.io SMTP port | 587 Username | api Password | Your Mailtrap SMTP/API token Encryption | STARTTLS Sender / From Email | An address from your verified domain Recipient / To Email | Any destination address you want to receive alerts onImportant:
Do not use
apias the sender address.Problem: From Email field may be hidden
In some Nutify versions, the From Email field exists in the HTML but is hidden in the UI for some providers.
If the field is not visible, Nutify may fall back to the SMTP username as sender.
That creates this invalid msmtp configuration:
Mailtrap rejects this because
apiis not a valid sender email address.The correct configuration should be similar to:
Workaround: show the hidden From Email field
Open your browser developer tools:
Look for this field:
It may be inside a hidden container like:
Temporarily remove the hidden styles.
Change:
to:
And change:
to:
The From Email field should now appear in the Nutify web UI.
Set it to a sender address from your verified Mailtrap domain:
Then click:
If the configuration is correct, Nutify should show:
After that, click:
Validate saved configuration in SQLite
If Nutify is running in Docker, you can verify that the configuration was saved correctly.
Enter the Nutify container:
Then run:
Expected result:
The important part is:
If
from_emailis empty,NULL, orapi, the configuration is likely still wrong.Optional: mark the configuration as default
If you only have one email configuration but
is_defaultis set to0, Nutify may still use it as the first available configuration. However, you can mark it as default manually.Inside the container:
Expected result:
Direct SMTP test from inside the container
If you want to verify that Mailtrap itself works from the Nutify container, you can run this test.
Enter the container:
Run:
A successful SMTP transaction should end with something similar to:
Security note:
Do not publish or share lines containing:
That line contains your credentials encoded in Base64. If it was shared publicly, rotate the Mailtrap token immediately.
Common errors
501 5.1.7 Bad sender address syntaxCause:
Fix:
Use a valid sender address from your verified Mailtrap domain:
From Header Domain MismatchCause:
The sender email does not belong to a verified Mailtrap sending domain.
Fix:
Use an address from your verified domain.
Example:
Configuration Errorwith no useful web UI detailsCause:
Nutify may hide the real msmtp error in the UI.
Fix:
Enable debug logging or check the Nutify mail logs. Look for
msmtp stderr.SMTP works manually, but Nutify fails
Cause:
The manual test probably used a valid
From:email, while Nutify usedapias the envelope sender.Fix:
Set the hidden
from_emailfield to a valid verified sender address.Suggested UI improvement
This may be considered a small UI/UX issue.
Nutify already has a
from_emailfield, but it may be hidden for some SMTP providers. For providers like Mailtrap, SendGrid, Mailgun, Amazon SES, Postmark, etc., the sender address can be different from the SMTP username and is often required.Suggested improvement:
Or at least show it when:
Example:
This would avoid the invalid sender error with Mailtrap.
All reactions