catch-all address setup for cyberpanel

Insert the catchall inside of cyberpanel’s e_forwardings table using phpmyadmin ( like source= @example.com with destination= catchall@example.com, you’ll have to create a destination mailbox btw )




 INSERT INTO e_forwardings (source, destination) 

VALUES ('@20tester.app', 'catchall@20tester.app');


Then replace query in /etc/postfix/mysql-virtual_forwardings.cf with


query = SELECT DISTINCT destination FROM e_forwardings WHERE source='%s' OR source='@%d'

And that’s it. I do it like that because for some domain I don’t even want to create a mailbox and just forward all emails to gmail.


query = SELECT DISTINCT destination FROM e_forwardings WHERE source='%s' OR source='@%d'






To insert a `catchall` email address into CyberPanel's `e_forwardings` table using phpMyAdmin, and to create a destination mailbox, follow these steps:


 Step 1: Create a Destination Mailbox

1. Log into CyberPanel:

   - Open CyberPanel and log in.

   - Go to Mail > Create Mail Domain if the domain doesn’t exist yet.

   - Go to Mail > Create Mailbox.

   - Select the domain (e.g., `example.com`).

   - Create a mailbox for the `catchall` email (e.g., `catchall@example.com`).


 Step 2: Insert Data into `e_forwardings` Table

Now that you have the destination mailbox (`catchall@example.com`), you can insert the forwarding rule into the `e_forwardings` table using phpMyAdmin.


1. Access phpMyAdmin:

   - Log into phpMyAdmin through your CyberPanel.

   - Select the database used by CyberPanel (it’s usually named something like `cyberpanel`, but it might vary based on your setup).

   - Find and open the `e_forwardings` table.


2. Insert a New Row:

   - Click on the Insert tab at the top of the `e_forwardings` table page.


3. Enter the Values:

   - In the source field, enter `@example.com` (this will forward all emails sent to `example.com` to the catchall address).

   - In the destination field, enter `catchall@example.com` (the catchall mailbox that you created).

   

   Example:

   - `source` = `@example.com`

   - `destination` = `catchall@example.com`


4. Save the Changes:

   - After entering the values, click Go at the bottom of the page to save the new entry.


 SQL Query for Manual Insertion

Alternatively, you can run the following SQL query directly in phpMyAdmin’s SQL tab to insert the forwarding rule:


```sql

INSERT INTO e_forwardings (source, destination) 

VALUES ('@example.com', 'catchall@example.com');

```


This will create the forwarding rule, ensuring that all emails sent to any address under `example.com` are forwarded to `catchall@example.com`.


 Step 3: Verify

After adding the forwarding rule, you can verify it in CyberPanel under Mail > Forwarding to ensure that the rule has been applied correctly.


Let me know if you need further assistance!

Comments

Popular posts from this blog

cpanel exam CPSP Answers

How to install zimbra collaboration suite 8.8.11 on CentOS 7

awstats installation