lando-mail-smtp
Skill4 starsChanged 15 days agoMITView on GitHub
Wires PrestaShop's outgoing email (BO Parámetros Avanzados > Correo electrónico) to Lando's mailhog service so local emails (order confirmations, module notifications, password resets, ...) are actually deliverable and inspectable instead of silently disappearing. Use when the user says "configura el mail en lando", "conecta mailhog", "los emails no llegan en local", "el correo no funciona en lando", "quiero ver los emails en local", "prueba el envío de correo", or after finishing a lando-setup full install if the project sends any transactional email (module notifications, order emails, password reset, contact form). Also trigger when debugging why a module's Mail::send() call produces no visible output locally.
In this repository37 other files it gives its agents.
- blast-radiusSkill
- elementflow-kbSkill
- gitlab-changelog-releaseSkill
- gitlab-ci-quality-gatesSkill
- gitlab-project-bootstrapSkill
- gitlab-security-setupSkill
- gitlab-wiki-bootstrapSkill
- lando-checkSkill
- lando-img-placeholderSkill
- lando-setupSkill
- mallard-releaseSkill
- mr-flowSkill
- no-commentsSkill
- paginated-report-pdfSkill
- panda-kbSkill
- ploi-prestashop-deploySkill
- prestashop-kbSkill
- ps-consoleSkill
- ps-css-buildSkill
- ps-demo-userSkill
- ps-email-previewSkill
- ps-image-regenSkill
- ps-invoice-previewSkill
- ps-new-projectSkill
- ps-one-page-checkoutSkill
- ps-project-docSkill
- ps-security-auditSkill
- ps-storefront-polishSkill
- ps-theme-cacheSkill
- ps-translateSkill
- ps-view-transitionsSkill
- ps-watchSkill
- reflectSkill
- show-me-your-workSkill
- skill-authorSkill
- task-contextSkill
- verify-ps-projectSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 42
If not already present (the lando-setup skill's template doesn't add this by default — add it separately), add to services:
- Very specific: line 53
Run lando rebuild -y (or lando start if the project isn't running yet) after adding it.
- Very specific: line 63
Look for the mail service block:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
lando-mail-smtp
Trigger
- "configura el mail en lando", "conecta mailhog", "los emails no llegan en local"
- "el correo no funciona en lando", "quiero ver los emails en local"
- "prueba el envío de correo" / "verifica que llega el email"
- Proactively, right after a
lando-setupfull install, if the project has any transactional email path (module notifications, order confirmation, password reset, contact form) — ask the user if they want mail wired up now.
Why this is needed
Lando's mail: type: mailhog service alone does not make PrestaShop's
Mail::send() deliver anywhere. PrestaShop defaults to PS_MAIL_METHOD=1
(native PHP mail()), which mailhog never intercepts — emails just vanish
silently, no error, nothing in the logs. Mailhog only catches mail sent over
SMTP, so PrestaShop must be explicitly switched to SMTP mode and pointed
at the mailhog service.
Prerequisite — mailhog service in .lando.yml
If not already present (the lando-setup skill's template doesn't add this
by default — add it separately), add to services:
services:
mail:
type: mailhog
hogfrom:
- appserverRun lando rebuild -y (or lando start if the project isn't running yet)
after adding it.
Step 1 — Get the mailhog service's internal hostname
cd ~/developer/{workspace}/{project-name}
lando infoLook for the mail service block:
{ service: 'mail',
urls: [ 'http://localhost:{PORT}' ],
type: 'mailhog',
internal_connection: { host: 'mail', port: '1025' },
hostnames: [ 'mail.{lando-name}.internal' ],
... }Two hostnames resolve to the mailhog container from inside appserver:
mail(short alias)mail.{lando-name}.internal(project-scoped)
Always use the project-scoped one (mail.{lando-name}.internal), not the
bare mail alias. Lando's shared proxy network exposes the mail/appserver
short aliases to every running Lando project on the machine — with
several projects up at once, the short alias can resolve to a different
project's mailhog/appserver container (the exact collision this skill's
sibling lando-setup already warns about for fastcgi_pass appserver:9000
in nginx). The .internal form is scoped to this project only and can't
collide.
urls gives the mailhog web UI port (e.g. http://localhost:32799) —
that's where you'll read captured emails, separate from the SMTP port (always
1025 internally).
Step 2 — Configure PrestaShop's SMTP settings
Via the BO (recommended — matches what a teammate would click through)
- Log in to the BO.
- Parámetros Avanzados > Correo electrónico (Advanced Parameters > Email).
- Set:
- Servidor SMTP:
mail.{lando-name}.internal(from Step 1) - Puerto SMTP:
1025 - Cifrado:
Ninguno/ off — mailhog doesn't speak TLS - Usuario/contraseña: leave empty, mailhog needs none
- Servidor SMTP:
- Toggle Usar SMTP / activate SMTP mode.
- Save.
Via direct DB update (faster for scripted/agent setup, same effect)
lando ssh -s database -c "mysql -uroot {recipe} -e \"
UPDATE ps_configuration SET value='2' WHERE name='PS_MAIL_METHOD';
UPDATE ps_configuration SET value='mail.{lando-name}.internal' WHERE name='PS_MAIL_SERVER';
UPDATE ps_configuration SET value='1025' WHERE name='PS_MAIL_SMTP_PORT';
UPDATE ps_configuration SET value='off' WHERE name='PS_MAIL_SMTP_ENCRYPTION';
\""Replace ps_ with the project's actual table prefix and {recipe} with the
.lando.yml recipe name (also the default DB name/user/password — see
lando-setup). PS_MAIL_METHOD: 1 = native PHP mail() (default, broken
for mailhog), 2 = SMTP (what we want).
No lando restart/cache-clear needed for either method — Configuration::get()
reads live.
Step 3 — Verify end-to-end
Trigger any email-sending action in the storefront or BO (password reset, a module's notification button, an order confirmation, the passwordless login code flow some PS9 projects use, ...), then check mailhog:
curl -s "http://localhost:{mailhog-port}/api/v2/messages?limit=1" | python3 -c "
import json,sys
d=json.load(sys.stdin)
m=d['items'][0]
print('To:', m['Content']['Headers'].get('To'))
print('Subject:', m['Content']['Headers'].get('Subject'))
"Or just open http://localhost:{mailhog-port} in a browser — mailhog's own
UI lists every captured message with full HTML/text preview.
{mailhog-port} changes across lando restarts in some Lando versions —
don't hardcode it in scripts; re-run lando info (or grep its mail block)
each time before checking, or read the URL fresh via the browser tab if one's
already open.
Gotchas
- Confirm SMTP actually applied — if emails still don't arrive after
Step 2, re-check
PS_MAIL_METHODreally is2. Some BO email settings screens silently fail to save if a required field (e.g. "De" sender email) is invalid; the DB update path skips that risk entirely. ps_shop_email/PS_SHOP_EMAILmust be a syntactically valid address for PrestaShop to attempt sending at all, even over SMTP — an empty or malformed sender address can causeMail::send()to returnfalsebefore ever touching SMTP.- A module that ignores
Mail::send()'s return value never surfaces SMTP failures — if verification (Step 3) shows nothing arriving, temporarily wrap the module's send call tovar_dump()/log the boolean return, rather than assuming the module code itself is broken. - This is a per-project, per-environment setting —
ps_configurationlives in the DB, so a fresh DB import from server (lando-setup's DB refresh mode) will overwritePS_MAIL_METHODback to whatever the server uses (almost always1, nativemail(), since production servers don't run mailhog). Re-run Step 2 after every DB refresh.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

