AdminsForum

CyberPanel Websites & OpenLiteSpeed Guides

Guide CyberPanel Email Forwarding, Catch-All and Plus-Addressing (With 2 Fixes)

Started by JAY 0 replies 103 views
1JAY
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
#1
CyberPanel Email Forwarding, Catch-All and Plus-Addressing (With 2 Fixes)

Three small email features that people ask about all the time: send a copy of one mailbox to another address, catch mail sent to addresses that don't exist, and accept . All three are in CyberPanel's Email menu. The first two worked straight away on our test server. Plus-addressing needed two fixes from SSH, and the second one is easy to miss because the panel says nothing.

Our test domain is cyber.adminslab.com with two mailboxes,
Code:
info@
and
Code:
team@
. If you don't have mail set up yet, start with our CyberPanel email setup guide.

1. Forward a mailbox
Open Email > Forwarding, pick the website and the mailbox, choose Forward to email, type the destination and click Add Forwarding. The rule shows up in the table below:
[Image: attachment.php?aid=493]

We forwarded
Code:
info@
to
Code:
team@
. The destination can be any address, inside or outside your server. The other option in the dropdown, Pipe to program, hands each message to a script instead (some help desk tools use this).

Does the original mailbox keep a copy? Yes.
Then we sent a test message to info@ and read the mail log. One message, two deliveries:
[Image: attachment.php?aid=531]

Code:
journalctl --since "-3min" --no-pager -o cat | grep "to="
The log shows
Code:
to=<info@...>
delivered and
Code:
to=<team@...>, orig_to=<info@...>
delivered. So the mailbox still fills up; clean it or set up a rule in your mail app if you only read the copy. To stop forwarding, use the Delete button next to the rule.

Forwarding to Gmail, Outlook and other big providers works, but be careful with spam: when your server forwards a spam message, the receiving provider sees your server sending it. If you forward a busy public address, turn on spam filtering first (Email > SpamAssassin or Rspamd on the same menu).

2. Catch-all address
A catch-all receives mail sent to any address at your domain that has no mailbox and no forwarding rule: typos like
Code:
infp@
, old addresses, made-up ones.
Open Email > Catch-All, pick the domain, type the destination and click Save Configuration. The box above the form confirms it:
[Image: attachment.php?aid=495]

Test it with an address that doesn't exist, and with one that does:
[Image: attachment.php?aid=532]

Code:
swaks -s 127.0.0.1 -f [email protected] -t [email protected] swaks -s 127.0.0.1 -f [email protected] -t [email protected]
(
Code:
swaks
is a small test tool:
Code:
apt install -y swaks
.)
Code:
nobody123@
landed in
Code:
team@
with
Code:
orig_to=<nobody123@...>
, and
Code:
info@
still went to its own mailbox (plus the forwarded copy). Real mailboxes are not affected by the catch-all.

Should you leave it on? Usually not for long. Spammers send to thousands of guessed names (
Code:
admin@
,
Code:
sales@
, random strings), and a catch-all accepts all of it. Turn it on while you move from an old setup to find which addresses people still use, then create those as mailboxes or forwards and remove the catch-all with Remove Catch-All.

3. Plus-addressing (user+tag@domain)
With plus-addressing, is delivered to
Code:
info@
. You give a different tag to every site you sign up at, then filter on it, and you can see who sold your address.

Fix 1: the settings page can't save.
When we switched on plus-addressing in Email > Plus-Addressing and clicked Save Global Settings, CyberPanel couldn't write the Postfix config:
[Image: attachment.php?aid=497]

Code:
[Errno 13] Permission denied: '/etc/postfix/main.cf'
The toggle shows "Enabled", but nothing was saved:
Code:
postconf recipient_delimiter
still printed an empty value. The panel process isn't allowed to write that root-owned file. Set it from SSH as root instead:
Code:
cp /etc/postfix/main.cf /root/main.cf.bak postconf -e 'recipient_delimiter = +' systemctl reload postfix postconf recipient_delimiter
The last command now prints
Code:
recipient_delimiter = +
.

Before the fix, with a catch-all on,
Code:
info+news@
simply went to the catch-all, because Postfix saw it as an unknown address. Without a catch-all it would have bounced.

Fix 2: "user unknown" after turning it on. With the delimiter set, our next test bounced:
Code:
to=<[email protected]>, relay=dovecot, dsn=5.1.1, status=bounced (user unknown)
Postfix now understood the tag, but it still passed the full address
Code:
info+news@...
to Dovecot's delivery program, and Dovecot has no user by that name. The delivery line in
Code:
/etc/postfix/master.cf
was:
Code:
flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${recipient}
Change it to hand Dovecot the plain mailbox name, and the full address separately:
Code:
cp /etc/postfix/master.cf /root/master.cf.bak sed -i 's|-d ${recipient}|-d ${user}@${nexthop} -a ${recipient}|' /etc/postfix/master.cf grep dovecot/deliver /etc/postfix/master.cf systemctl reload postfix
Code:
${user}
is the part before the
Code:
+
,
Code:
${nexthop}
is the domain. Dovecot 2.3.21 on our server already had
Code:
recipient_delimiter = +
, so nothing to change there (
Code:
doveconf recipient_delimiter
to check yours).
After both fixes, all three cases from one test run:
[Image: attachment.php?aid=533]

Code:
info+news@
delivered to info (and its forwarded copy to team),
Code:
info@
delivered normally, and the catch-all still worked.
Code:
postqueue -p
said
Code:
Mail queue is empty
: no stuck or bounced mail.

Keep your backups (
Code:
/root/main.cf.bak
,
Code:
/root/master.cf.bak
). A CyberPanel upgrade can rewrite these files; after an upgrade, check both settings again with
Code:
postconf recipient_delimiter
and
Code:
grep dovecot/deliver /etc/postfix/master.cf
.

A note on test mail and bounces
When the user-unknown test bounced, Postfix tried to send the bounce back to our made-up sender at another domain, and it sat in the queue. Use one of your own mailboxes as the sender when you test (
Code:
). To remove a stuck message, find its ID with
Code:
postqueue -p
and delete it with
Code:
postsuper -d QUEUEID
.

Common problems
  • Forwarded mail never arrives at Gmail/Outlook: check the log line for that recipient (
    Code:
    journalctl -o cat | grep "to=<[email protected]>"
    ). A
    Code:
    status=bounced
    or
    Code:
    deferred
    line says why; often it's spam filtering or missing SPF/DKIM on your server.
  • Catch-all doesn't catch anything: the address has a mailbox or forward already, or MX for the domain doesn't point at this server.
  • Plus address bounces with "user unknown": fix 2 above isn't applied (or was overwritten by an upgrade).
  • Plus address goes to the catch-all instead of the mailbox: fix 1 isn't applied;
    Code:
    postconf recipient_delimiter
    is empty.

More CyberPanel guides
Tested on CyberPanel 3.0 (build 8, OpenLiteSpeed edition) on Ubuntu 24.04, October 2026. Menu names can change slightly between versions.

Attached Files

Image(s)
                       
Reply
Possibly Related Threads…matched by title
Replies:0Views:7
Replies:0Views:13
Replies:0Views:18
Replies:0Views:15
Replies:0Views:103

Users browsing this thread: 1 Guest(s)
Forum Jump: