Skip to primary content
Skip to secondary content

Incredigeek

Incredigeek

Main menu

  • Home
  • Linux
  • Ansible
  • Security
  • Ubiquiti
  • LibreNMS
  • Projects
    • Pangolin Whisper Web Interface
    • UBNTMOD
    • Email Tracker
    • IP Watt Meter
    • Grond : LUKS Password Cracker
  • Donate

Tag Archives: email warning

Add warning for emails from external domains in cPanel/WHM

Posted on December 9, 2024 by admin
Reply

In this post we are going to setup Exim to add “[External]” to the email subject if it originates from outside of the local domain.

Thanks to Sam for this post. It was extremely helpful.
https://tech.saqr.org/2020/01/for-incoming-email-not-from-our-domain.html

Steps

  1. Create a new Exim Filter
  2. Enable Filter

Create an Exim Filter

SSH to the server and create a Exim filter. In cPanel there are in /usr/local/cpanel/etc/exim/sysfilter/options/. You can name the filter what ever you want.

vi /usr/local/cpanel/etc/exim/sysfilter/options/external_email_warning

Change “incredigeek.com” to your domain name.
You can also change “[External]” to whatever you want to be prepended to the subject.

if
  $header_to: contains "@incredigeek.com>"
  and $header_from: does not contain "@incredigeek.com>"
  and $header_subject: does not contain "[External]"
then
  headers add "Old-Subject: $h_subject:"
  headers remove "Subject"
  headers add "Subject: [External] $h_old-subject"
  headers remove "Old-Subject"
endif

Save the file.

Enable Custom Exim Filter

Now log into WHM, go to Service Configuration > Exim Configuration Manager > Basic Editor > Filters

At the bottom of the filters, you should see a new “Custom Filter: external_email_filter”
This is the filter you just created. Make sure it is On, and Save changes.

Enable Custom Exim Email Filter for External Email

There you go! Any email you receive now that is from an external domain should now have “[External]”, or whatever you specified, prepended to the subject.

If you run into any errors, try reviewing the panic log to see if there are any syntax errors.

Troubleshooting

You can use tail to follow the panic log to verify you have all the syntax correct.

tail /var/log/exim_paniclog -f

Posted in cPanel, Linux | Tagged cpanel, custom filter, disclaimer, email, email warning, exim, exim custom, external email, filter, linux, whm | Leave a reply

If you do not want Ads, use a Adblocker.

Was the information helpful? Consider donating some Monero to keep fresh information coming!

Recent Blog Post

  • Ansible “PlayContext” error for RouterOS Community Collection
  • How to “Lock” docker version on RHEL / RockyLinux / AlmaLinux
  • Changing Ubiquiti Radio password from Command Line
  • How to Fix UISP “Application is loading. 1 min remaining…” Again… fluentd Error
  • How to the Uninstall Elastic Agent on Linux

  • 3D Printing
  • AI
  • Alienware
  • AMD
  • Android
  • Ansible
  • Apple
  • Arduino
  • Automation
  • Baicells
  • Cable
  • Cambium
  • CCNA
  • CentOS
  • Chia
  • cnPilot
  • Command Line
  • Computer Mods
  • cPanel
  • Cron
  • Crypto Currency
  • Debian
  • Dell
  • DNS
  • DNS
  • Drones
  • Email
  • Fedora
  • FreeBSD
  • Freeradius
  • GPU Crypto Hashrates
  • GrapheneOS
  • Hacking
  • Hackintosh
  • Hardening Guides
  • Information
  • Inkscape
  • Internet
  • JavaScript
  • Learning
  • Learning
  • LibreNMS
  • LineageOS
  • Linux
  • MacOS
  • Matrix
  • Mikrotik
  • Minecraft
  • Mining
  • MySQL
  • Nagios
  • Networking
  • Networking
  • Nvidia
  • Office
  • OS X
  • Playbooks
  • Plotman
  • Programming
  • PSU
  • Python
  • Random
  • Raspberry Pi
  • Recovery
  • RedHat
  • Reset Passwords
  • Scripts
  • Security
  • Slackware
  • SNMP
  • Stories
  • Tear Downs
  • Tips and Tricks
  • Ubiquiti
  • Ubiquiti Command Line
  • Ubuntu
  • Uncategorized
  • UniFi
  • UniFi Protect
  • UniFi Video
  • Unity3D
  • VIM
  • Virtualization
  • Visual Studio
  • VMware
  • Web
  • Web Browser
  • Windows
  • Windows 10
  • Windows 8
  • Wireless
  • Wireshark
  • WISP
  • WordPress
  • XenServer
  • Zenoss

android automation Backup bash centos command line cpanel crypto debian DNS docker email fedora firewall install javascript librenms linux microsoft mikrotik mining monitoring networking nms nvidia OS X password programming routeros script security snmp ssh ubiquiti ubnt ubuntu ui unifi unity unity3d upgrade whm Windows XenServer zenoss

Proudly powered by WordPress