How can I copy cPFence SMTP settings in bulk to multiple servers?

cPFence supports configuring SMTP notifications for alerts and other system messages. You can set this up using either the WebUI or the CLI. The WebUI provides a convenient way to configure SMTP across all servers in a single click.

Method 1: Using the WebUI (Recommended)

 

 

 

To configure SMTP using the WebUI, follow these steps:

  1. Go to System Settings from the left sidebar.
  2. Click on Enable cPFence SMTP.
  3. Fill in all required fields:
    • Recipient Email
    • SMTP Host
    • Port (e.g., 465 for SMTPS)
    • SMTP User
    • SMTP Password
    • From Email
  4. Click Enable SMTP.

If "All Servers" is selected, this will apply the configuration to every server in your cluster at once.

Method 2: Using the CLI

Step 1: Configure SMTP on the First Server

Run the following command to begin the SMTP setup:

cpfence --set-email [email protected]

You will be prompted to enter SMTP details interactively. This creates the SMTP configuration file used by cPFence.

Step 2: Copy Settings to Other Servers

After configuration, the SMTP settings are saved in:

/etc/s-nail.rc

You can manually copy the block below to other servers:

# cPFence SMTP Configuration - START
set v15-compat
set from="[email protected] (your-server-name)"
set mta=smtps://your-encoded-username:[email protected]:465
# cPFence SMTP Configuration - END

To apply it on another server:

  1. Open /etc/s-nail.rc in a text editor:
nano /etc/s-nail.rc
  1. Paste the copied SMTP block at the bottom of the file.
  2. Update the from line to match the current server name.
  3. Save and exit.

Need Further Assistance?

If you encounter any issues or need additional help, feel free to reach out to our support team via your client portal.

  • 0 utilizatori au considerat informația utilă
Răspunsul a fost util?

Articole similare

Is cPFence Compatible with Cloudflare, BunnyCDN and Quic.Cloud?

Yes, cPFence is fully compatible with Cloudflare, Quic.Cloud, and BunnyCDN. In fact, we recommend...

Why Do I See "could not change directory to /root: Permission denied" Warnings?

You may occasionally encounter the following warning message while using cPFence: could not...

How to Uninstall cPFence ?

If you need to remove cPFence from your system, follow the steps below to uninstall the software...

Configuring Hostname on Ubuntu for cPFence Emails and Features

Setting a proper hostname on your server is important for several reasons, including being able...

How to Set Up Slack Notifications in cPFence?

If you'd like to receive cPFence alerts on your desktop or mobile via Slack, follow the steps...