A forwarder in cPanel quietly sends mail addressed to one place on to another — a single address to a personal Gmail, or every address at a domain to a successor company. The setup is two clicks, which is why the failure modes are the surprises: a forwarder that drops the local copy you assumed it kept, two forwarders pointed at each other looping until Exim cuts them off, or forwarded mail to Gmail bouncing because forwarding breaks SPF. Knowing the four shapes — single address, domain forwarder, forward-and-keep-copy, and the loop trap — covers almost everything people ask for.
What’s happening
cPanel forwarders are Exim aliases. Email » Forwarders writes entries to the domain’s alias file (/etc/valiases/<domain>), and Exim reads them at delivery time: a message for sales@example.com whose alias says : you@gmail.com is re-sent to that destination instead of (or in addition to) being delivered locally. There are two kinds. A forwarder maps one address to one or more destinations. A domain forwarder (the “Add Domain Forwarder” button, written as a * wildcard alias) re-sends every address at a domain to the matching address at another domain — useful when a company renames or consolidates.
A plain forwarder does not keep a local copy unless you ask for it: a single-destination forward delivers only to the destination. To keep a copy, the alias must list both the local mailbox and the external address. Two things bite. First, forwarding a message preserves the original sender in the From:, but the message now arrives from your server’s IP — which is not in the original domain’s SPF record — so receivers doing strict SPF/DMARC checks (Gmail prominently) can reject or quarantine it. Exim’s SRS (Sender Rewriting Scheme) rewrites the envelope sender to fix the SPF side; DKIM survives forwarding if the body is unchanged. Second, a forwarder that points back into a chain that returns to it loops; Exim’s Received:-header counter eventually refuses the message, but only after it bounces around.
How to verify
See the forwarders configured for a domain and where each one sends:
# cPanel's alias file is the source of truth for forwarders
cat /etc/valiases/example.com
# Just the forwarding entries (skip comments and the default)
grep -vE '^\s*#|^\*:' /etc/valiases/example.com
Watch a forwarded message actually take the hop while you send a test to the forwarded address:
# Live view as you send a test to the forwarded address
tail -f /var/log/exim_mainlog
# Group the inbound message with its forwarded delivery
exigrep 'sales@example.com' /var/log/exim_mainlog | tail -40
Look for the two classic problems — a loop, or a forwarded message bouncing at the destination:
# Loop guard tripping, or destination refusals on forwarded mail
grep -iE 'loop|too many .*received|forward' /var/log/exim_mainlog | tail -40
# Did the destination reject it? (SPF/DMARC on forwarded mail)
grep -iE 'spf|dmarc|550|rejected' /var/log/exim_mainlog | tail -40
The fix
- Add a single forwarder for one address. In cPanel » Email » Forwarders » Add Forwarder, enter the local address, choose Forward to Email Address, and put the destination. That replaces local delivery — mail goes to the destination and no copy stays on this server. Use this when the mailbox is being retired and everything should land elsewhere.
- Forward and keep a local copy when you want both. A single forwarder does not keep a copy. To do both, keep the real mailbox and add a forwarder for the same address to the external destination — Exim then delivers locally and re-sends. The cleaner built-in alternative is cPanel » Email » Email Accounts » Manage » Forwarders, but the reliable mental model is: the alias must name two targets (the local user and the external address) for a copy to stay.
- Use a domain forwarder to move an entire domain’s mail. In Forwarders » Add Domain Forwarder, forward all mail for
olddomain.comtonewdomain.com. Every address maps to the same name at the new domain (info@old→info@new). This is the right tool after a rename or acquisition — but it forwards everything, including spam to addresses that never existed, so pair it with filtering if the old domain attracts junk. - Send one address to several destinations. A forwarder can have multiple destinations — add the address several times pointing at different targets, or list them in the alias. Mail is copied to each. This is how a small
support@reaches three people without a mailing list, but it is fan-out, not a list: there is no subscription management, no archive, and replies do not thread. - Break and prevent loops. If
exim_mainlogshows a message ricocheting, two forwarders point into each other (A → B and B → A), or a forwarder sends to an address that forwards back. Remove one leg of the loop in/etc/valiases/<domain>(or the Forwarders UI). Never forward an address to a destination that ultimately forwards back to it, and never point a forwarder at an autoresponder address — the two together loop fast. - Fix forwarded mail that bounces at Gmail/Microsoft. When forwarded mail is rejected for SPF/DMARC, the cause is forwarding changing the sending IP. Enable SRS so Exim rewrites the envelope sender (in WHM » Exim Configuration Manager, the SRS/forwarder options), which repairs SPF alignment on the bounce path. Confirm DKIM is intact (forwarding preserves it only if the body is untouched — content filters that rewrite the body break it). Where possible, prefer a real mailbox the user collects over forwarding to a strict provider.
- Decommission forwarders deliberately. A forwarder outlives the reason it was created — staff leave, the destination address dies, and mail silently disappears into a defunct inbox or bounces forever. Review
/etc/valiases/<domain>periodically and delete forwarders whose destination no longer exists. A forwarder to a dead address is worse than no forwarder: the sender thinks the message was delivered. - Confirm the hop end to end before you trust it. Send a test to the forwarded address from an outside account and watch
tail -f /var/log/exim_mainlogfor the inbound accept followed by the forwarded=>to the destination — then confirm it actually arrived in the destination inbox, not just that it left. A forwarder that “sends” but lands in the destination’s spam folder is still a problem the sender will blame on you.
A forwarder is correct when mail reaches the intended destination inbox, keeps a local copy only if you meant it to, and never loops. Stack Harbor configures and audits cPanel mail forwarding under cPanel server management — start a conversation when forwarded mail loops or bounces.