ServBay Mailpit Service Configuration Guide
ServBay integrates the Mailpit service as an email server to facilitate users in testing and debugging email sending. This article will detail how to configure the Mailpit service in ServBay, covering the four main configuration tabs: Common, SMTP, POP3, and Relay.
Overview of Mailpit Service
Mailpit provides a local email server and web interface for capturing and inspecting emails, supporting SMTP, POP3 protocols and STARTTLS, SSL/TLS encryption, as well as Relay for email forwarding. It simplifies the email testing and debugging process without relying on external email service providers. In ServBay, you can easily configure Mailpit's parameters to meet your specific needs.
Installing and Enabling Mailpit Service
Before using Mailpit as the mail server, users need to go to ServBay's Services
- Common Services
, and click the green install button on the right side of the Mailpit service to install and enable the Mailpit service.
Thanks to ServBay's powerful PKI system, ServBay will automatically generate the SSL certificate needed for the Mailpit service and configure the Mailpit web management interface. Users do not need to apply for SSL certificates separately for services like SMTP and POP3's STARTTLS, SSL/TLS.
Web Mail Management Interface
Mailpit comes with a web interface for managing emails. ServBay is already automatically configured; after enabling the mail service, users can directly access https://mail.servbay.host to log in to the web management interface to view and manage emails.
Configuring Mailpit
In ServBay's left navigation bar, select Mail
, then click Mailpit Service Config
to enter the configuration interface. You will see four tabs: Common, SMTP, POP3, and Relay.
1. Common Tab
The Common tab is for configuring Mailpit's general settings:
- Max Messages: Set the maximum number of emails that the Mailpit server can store. Older emails will be automatically deleted when this limit is exceeded.
- Max Age: Set the maximum retention time for emails on the Mailpit server, in days. Emails will be automatically deleted after this period.
- SpamAssassin: Enable or disable SpamAssassin spam filtering.
- Webhook URL: Configure a Webhook URL so that when Mailpit receives new emails, it sends a notification to this URL.
- Webhook Limit: Set the limit on the number of emails for Webhook notifications.
2. SMTP Tab
TIP
Thanks to ServBay's robust PKI system, ServBay has by default generated and configured SSL certificates, allowing users to enable STARTTLS or SSL/TLS directly without needing additional SSL certificate application and configuration.
The SMTP tab is for configuring the Mailpit SMTP server settings:
- SMTP Port: Set the port number that the Mailpit SMTP server listens to. The default is 1025.
- STARTTLS: Enable or disable STARTTLS encryption.
- SSL/TLS: Enable or disable SSL/TLS encryption.
- Username: Set the username for the SMTP server (optional).
- Password: Set the password for the SMTP server (optional).
- Max Recipients: Set the maximum number of recipients per email.
- Allowed Recipients: Set the allowed recipient addresses or domains (optional). If left blank, all recipients are accepted.
3. POP3 Tab
TIP
Thanks to ServBay's powerful PKI system, ServBay has by default generated and configured SSL certificates, allowing users to enable SSL/TLS directly without needing additional SSL certificate application and configuration.
The POP3 tab is for configuring Mailpit's POP3 server settings:
- Enable POP3 Server: Enable or disable the POP3 server.
- POP3 Server Port: Set the port number that the Mailpit POP3 server listens to. The default is 1110.
- Username: Set the username for the POP3 server (optional).
- Password: Set the password for the POP3 server (optional).
- SSL/TLS: Enable or disable SSL/TLS encryption.
4. Relay Tab
The Relay tab is for configuring Mailpit's email forwarding function:
- Enable SMTP Relay: Enable or disable the SMTP relay function.
- Host: Set the SMTP server address used for relaying emails (e.g., smtp.gmail.com).
- Port: Set the SMTP server port number used for relaying emails. The default is 25.
- STARTTLS: Enable or disable STARTTLS encryption.
- Allow Insecure: Allow connections to unsecured SMTP servers (not recommended).
- Auth: Select authentication method (Login, Plain, CRAM-MD5).
- Username: Set the SMTP server username used for relaying emails.
- Password: Set the SMTP server password used for relaying emails.
- Return Path: Set the return address.
- Allowed Recipients: Set the allowed recipient addresses or domains for relaying (optional).
- Blocked Recipients: Set the blocked recipient addresses or domains for relaying (optional).
- Relay All: Relay all emails.
- Relay Matching: Only relay emails that meet specific conditions (requires configuration of Allowed Recipients or Blocked Recipients).
Saving Configuration
After completing all configurations, click the Save
button to save changes. Click the Reset
button to restore all configurations to default values.
With the above configurations, you can use the Mailpit service for email testing and debugging in ServBay. Please remember that you may need to restart the Mailpit service for changes to take effect. You can restart the Mailpit service through ServBay's service management interface.