SMTP handlers in lazysite/forms/handlers.conf receive form
submissions, format them as email, and hand off to
plugins/form-smtp.pl. The connection settings (sendmail path, SMTP
host, TLS, authentication) live in a separate file,
lazysite/forms/smtp.conf, so multiple SMTP handlers can share one
connection configuration.
In lazysite/forms/handlers.conf, each SMTP handler declares the
email envelope:
handlers:
- id: email-delivery
type: smtp
name: Email delivery
enabled: true
from: webforms@example.com
to: admin@example.com
subject_prefix: "[Contact] "
Keys:
fromtosubject_prefixenabledtrue (default) or false. Disabled handlers are skipped.
lazysite/forms/smtp.conf defines how email is actually sent. The
installer provides smtp.conf.example as a starting point.
Pipes the email to the local sendmail binary. Works on most Linux servers with a configured MTA (Postfix, Exim, etc.):
method: sendmail
sendmail_path: /usr/sbin/sendmail
Connects to an SMTP server with optional TLS and authentication:
method: smtp
host: mail.example.com
port: 587
tls: starttls
auth: true
username: webforms@example.com
password: your-smtp-password
For a local relay without TLS or auth:
method: smtp
host: localhost
port: 25
tls: false
auth: false
tls: truetls: starttlstls: falseSet auth: true to authenticate. The username comes from the
username: key. The simplest way to set the password is the
Password field on the Plugin Config page (or a password: key in
smtp.conf) - it is stored in the operator-only smtp.conf and never
shown back in the manager.
Alternatively, keep it out of the conf entirely with password_file:
(a path relative to the docroot); the file wins only when no
password: is set:
echo "your-smtp-password" > lazysite/forms/.smtp-password
chmod 600 lazysite/forms/.smtp-password
Both smtp.conf and the password file live under lazysite/forms/,
which is operator-only and denied to every publishing surface.
After saving, use Validate SMTP connection on the Plugin Config page. It runs a staged check against the saved settings and names the failing stage rather than a generic error:
It never sends an email - it connects, negotiates, authenticates, and quits.
The email body lists all form fields:
Form submission
----------------------------------------
name: John Smith
email: john@example.com
message: Hello there
----------------------------------------
Submitted: Friday, 18 April 2026 at 14:30:00 BST
IP: 192.168.1.1
The subject line uses subject_prefix (from the handler config)
followed by the first available short field.
Test with curl:
echo '{"config":{},"form":{"name":"Test","email":"test@test.com","message":"Hello"}}' | \
DOCUMENT_ROOT=/path/to/public_html \
perl plugins/form-smtp.pl --pipe
Net::SMTP (Perl core)IO::Socket::SSL (for TLS - libio-socket-ssl-perl on Debian)