pg_utl_smtp 2.0 adds async mode and TLS for PostgreSQL email notifications
The Oracle-compatible PostgreSQL extension pg_utl_smtp has released version 2.0 with asynchronous email sending, SSL/TLS support, and stricter SMTP error handling.
Summary
pg_utl_smtp 2.0.0 brings asynchronous email delivery to PostgreSQL, a capability not present in Oracle's original UTL_SMTP package. The release also adds SSL/TLS connections, fixes duplicate EHLO commands, and raises errors on SMTP failures during any protocol stage. The extension lets triggers and stored procedures send email directly, enabling data-driven alerts without application-layer involvement.
What's new in pg_utl_smtp 2.0
- Asynchronous mode: New
pg_utl_smtp.asynchronoussetting enables non-blocking email sends, useful for porting MSSQL'ssp_send_dbmail() - SSL/TLS support:
secure_connection_before_smtpparameter encrypts SMTP connections - Stricter error handling: SMTP errors during HELO/EHLO, MAIL, RCPT, DATA, end-of-DATA, or QUIT now raise PostgreSQL errors instead of failing silently
- Connection fixes: Eliminated duplicate EHLO at connection start; QUIT properly releases connection, second QUIT raises error
- CI/testing: GitHub Actions regression tests added
- Upgrade path:
ALTER EXTENSION pg_utl_smtp UPDATEfor existing installations
Why it matters
The async mode and TLS support make this extension more viable for production alerting pipelines. It remains particularly relevant for organizations migrating from Oracle or SQL Server to PostgreSQL who need to preserve database-driven email notification patterns.
Original reference: www.postgresql.org →