Settings - Mail
Configure SMTP servers, mail spooling, and email delivery settings
Overview
The Mail Settings page controls how ColdFusion sends email via the cfmail tag. You can configure multiple SMTP servers for redundancy, set up mail spooling for asynchronous delivery, configure authentication and encryption, and manage mail queue behavior. Proper configuration ensures reliable email delivery and optimal performance.
SMTP Server Configuration
Configure primary and backup SMTP servers for email delivery.
Mail Server (SMTP)
server, in the ColdFusion 2025 Update 14 Docker image)smtp.example.com, smtp.gmail.com, mail.privateemail.comServer Port
587 - Submission port with STARTTLS (recommended)
465 - SMTPS (implicit SSL/TLS, legacy)
2525 - Alternative submission port
Username & Password
Enable SSL Socket Connections / Enable TLS Connection
SSL: Encrypted from start (port 465)
Verify Mail Server Connection
Mail Spool Settings
Configure asynchronous email processing and queue management.
Enable Mail Spool
Page requests are not blocked by slow SMTP servers
Spool Interval (Seconds)
schedule, shipped in Adobe's official Docker image)High Volume: 1-5 seconds
Low Volume: 30-60 seconds
Spool Mail Messages For Delivery To (Disk or Memory)
cfusion/Mail/Spool (the cfusion/Mail directory holds spooled and undeliverable mail; Source: Adobe: Install the server configuration)Mail Delivery Threads
Undelivered Mail
How ColdFusion handles messages that fail to send.
Failed Deliveries
_CFusion_\Mail\Undelivr (Windows), /opt/coldfusion/mail/undelivr (UNIX)Advanced Settings
Configure additional mail server options and logging.
Backup Mail Servers
- Edition
- Enterprise only
- Purpose
- Comma-separated list of backup SMTP servers; use username:password@server:port when authentication or a non-default port is needed
- Recommendation
- Configure backup server for high-availability
Use different providers/infrastructure for true redundancy. Example: Primary = internal relay, Backup = external service (SendGrid, SES)
Mail Character Set
- Default
- UTF-8
- Recommendation
- Always use UTF-8 for international character support
Default character encoding for email messages. Can be overridden per-message in cfmail tag.
Sign Messages
- Use Case
- Required for certain compliance scenarios
- Requirement
- Keystore (JKS or PKCS12), keystore password, and optionally key alias and key password
Digitally sign outgoing emails with certificate for compliance and security.
Mail Logging
- Default
- Warning (neo-mail.xml, key
severity, in the ColdFusion 2025 Update 14 Docker image) - Severity Levels
- Debug, Information, Warning, Error
- Recommendation
- Information for production, Debug for troubleshooting
- Location
- mail.log (errors) and mailsent.log (sent messages, when Log All Mail Messages is enabled) in the ColdFusion logs directory
Log mail operations including SMTP transactions, delivery attempts, and errors.
Popular SMTP Provider Settings
Quick reference for common email service provider configurations.
Gmail / Google Workspace
- Server
- smtp.gmail.com
- Port
- 587 (TLS enabled)
- Authentication
- Email address and App Password
- Limit
- 500/day (Gmail), higher for Workspace
Must use App Passwords, not regular password (requires 2FA enabled on Google account).
Microsoft 365 / Outlook.com
- Server
- smtp-mail.outlook.com or smtp.office365.com
- Port
- 587 (TLS enabled)
- Authentication
- Full email address; OAuth access token as the password where Microsoft requires OAuth
- Limit
- 300/day (Outlook), 10,000/day (M365)
Adobe documents OAuth for SMTP by passing an access token in the cfmail password attribute (server smtp.office365.com, port 587, TLS). The published fix targets ColdFusion 2021 and 2018 and adds the JVM flag -Dcoldfusion.mail.oauth2=true; confirm the steps for your release.
SendGrid
- Server
- smtp.sendgrid.net
- Port
- 587 or 2525 (TLS enabled)
- Username
- apikey (literal string)
- Password
- Your SendGrid API key
- Limit
- Varies by plan; check SendGrid
Amazon SES
- Server
- email-smtp.us-east-1.amazonaws.com
- Port
- 587 (TLS enabled)
- Credentials
- SMTP username/password from SES console
Region-specific endpoint. Start in sandbox mode, request production access.
Mailgun
- Server
- smtp.mailgun.org
- Port
- 587 (TLS enabled)
- Username
- postmaster@your-domain.mailgun.org
- Password
- SMTP password from Mailgun dashboard
Best Practices
Production Environment
- Always enable mail spooling for async delivery
- Configure backup SMTP server for redundancy
- Use TLS encryption for all SMTP connections
- Set spool interval based on volume (5-15 seconds typical)
- Monitor undelivered mail directory for delivery issues
- Configure appropriate rate limiting for your SMTP provider
- Use dedicated SMTP service (SendGrid, SES) for high volume
- Implement SPF, DKIM, and DMARC records for deliverability
- Monitor mail.log for errors and delivery failures
Development Environment
- Use mail capture tools (MailHog, Papercut) to avoid sending real emails
- Configure test SMTP server separate from production
- Set longer spool intervals to reduce processing overhead
- Enable debug logging to troubleshoot issues
Security Considerations
- Always use authentication - never allow anonymous relay
- Enable TLS/SSL encryption to protect credentials
- Use app-specific passwords instead of primary account passwords
- Restrict SMTP relay to authorized IP addresses when possible
- Implement rate limiting to prevent email flooding
- Validate email addresses to prevent injection attacks
- Monitor for unusual sending patterns indicating compromise
- Rotate SMTP credentials periodically
Performance Tuning
- Enable mail spooling to prevent cfmail from blocking requests
- Adjust spool interval based on volume and latency requirements
- Increase mail delivery threads (Enterprise) for high-volume applications
- Use multiple SMTP servers to distribute load
- Monitor spool directory size - large queues indicate issues
- Consider external mail service for bulk sending
Common Issues and Solutions
Email Not Sending
- Symptom: cfmail executes but emails never arrive
- Check: SMTP server settings, authentication, port accessibility
- Solution: Use "Verify Connection" to test configuration
- Firewall: Ensure SMTP ports (587, 465, 25) are not blocked
- Logs: Check mail.log for connection errors
Authentication Failed
- Symptom: "Authentication failed" error in mail.log
- Gmail: Use App Password (requires 2FA enabled on Google account)
- Office 365: Verify SMTP AUTH is enabled for mailbox
- Solution: Double-check username, password, and authentication method
Emails Going to Spam
- Symptom: Emails delivered but marked as spam
- SPF Record: Add SMTP server to SPF record
- DKIM: Configure DKIM signing for authentication
- DMARC: Implement DMARC policy
- Content: Avoid spam trigger words, include unsubscribe link
- Reputation: Use reputable SMTP service, warm up IP address
Spool Queue Growing
- Symptom: Thousands of files in spool directory
- Cause: SMTP server unavailable, rejecting connections, or throttling the sender
- Solution: Check SMTP connectivity and authentication, then move any messages in the Undelivr directory back to Spool
- Prevention: Monitor queue depth, alert on growth
Slow Page Performance
- Symptom: Pages with cfmail tag load slowly
- Cause: Mail spooling disabled, sending synchronously
- Solution: Enable mail spooling for async delivery
- Alternative: Use cfthread for immediate sending without blocking
Connection Timeout
- Symptom: "Connection timeout" errors
- Firewall: SMTP port blocked by firewall or security group
- Network: Network connectivity issues
- Solution: Verify port accessibility using telnet or nc
- Test: telnet smtp.example.com 587
Monitoring and Maintenance
Daily Monitoring
- Check spool directory size - should be near empty
- Review mail.log for errors
- Monitor undelivered directory for failed messages
- Track email delivery metrics (sent, failed, bounced)
Weekly Maintenance
- Review undelivered messages, investigate patterns
- Archive or delete old mail.log files
- Check for mail server connectivity issues
- Verify backup SMTP server is functional
Alerts to Configure
- Spool queue exceeds 100 messages
- Undelivered directory exceeds 50 messages
- SMTP connection failures exceed threshold
- Mail.log shows authentication failures