Comodo Help
Find the desired product help
Comodo Antispam Gateway

Comodo Antispam Gateway

Admin Guide ver 2.12

English

Print Help Download Help
Get Started > Outgoing Filter Configuration > Outgoing Smarthost Setup > Configure Exim To Use A Smarthost > Configure Exim / CPanel To Use A Smarthost
  • Introduction To Comodo Antispam Gateway
    • Release Notes
    • Purchase License
    • License Information
  • Get Started
    • Incoming Filtering Configuration
      • Configure Your Mail Server
      • Configure MX Records
        • Update MX Records In Windows 2003/2008 Server
        • Update MX Records On A Host Using BIND
        • Update MX Records For Comodo DNS
        • Update MX Records For GoDaddy
        • Update MX Records For Enom
        • Update MX Records For Network Solutions
        • Update MX Records For Yahoo! Small Business
        • Update MX Records For 1and1
        • Update MX Records For 4D Web Hosting
        • Update MX Records For DNS Park
        • Update MX Records For DreamHost
        • Update MX Records For DynDNS
        • Update MX Records For IX Web Hosting
        • Update MX Records For No-IP
        • Update MX Records In CPanel
    • Outgoing Filter Configuration
      • Per-User Authentication
      • Outgoing Smarthost Setup
        • Configure QMail To Use A Smarthost
        • Configure PostFix To Use A Smarthost
        • Configure Sendmail To Use A Smarthost
        • Configure Exchange 2000/2003 To Use A Smarthost
        • Configure Exchange 2007/2010 To Use A Smarthost
        • Configure Exchange 2013/2016 To Use A Smarthost
        • Configure Office 365 To Use A Smarthost
        • Configure Exim To Use A Smarthost
          • Configure Exim / CPanel To Use A Smarthost
          • Configure Exim / Directadmin To Use A Smarthost
      • DNS Configuration
  • Login To The Admin Console
  • The Dashboard Area
  • The Admin Console
  • Domain Management
    • Add A Domain
    • Delete Domains
    • Edit Domains
    • Validate Domains
    • Manage A Domain
      • Domain Dashboard
      • Incoming
        • Quarantine
        • Manage Archived Mails
        • Incoming Spam Detection Settings
        • Report Spam
        • Delivery Queue
        • Destination Routes
        • Local Recipients
        • Clear Incoming Cache
        • Log Search
        • Domain Aliases
        • Domain Settings
        • Manage Report Subscriptions For Selected Domain
        • Relay Restrictions
        • Geolocation Restrictions
        • SPF Control Settings
      • Outgoing
        • Clear Outgoing Cache
        • Log Search
        • Users
        • Office 365 Activation
      • Email Management
        • Email Size Restriction
        • Blocked Extensions
        • Released Requests
        • Blacklisted Requests
        • Whitelisted Requests
      • Domain Audit Log
        • Audit Log Configuration
        • View Domain Log
      • Domain Rules
        • Rules
        • TLD And GTLD Rules
        • Recipient Whitelist
        • Sender Whitelist
        • Recipient Blacklist
        • Sender Blacklist
        • Whitelist Senders Per User
        • Blacklist Senders Per User
      • Account Management
        • User Account Management
        • Manage User Auto-import
        • View User History
        • Import Users From LDAP
          • LDAP Import Configuration
          • LDAP Import Confirmation List
          • LDAP Import Ignore List
  • Audit Log
  • Administrator Account Management
    • Administrators
    • User Groups & Permissions
    • Admin Groups & Permissions
    • My Comodo Account
    • My Profile
    • Users History
  • Customer Management
    • End User License And Subscriber Agreements
    • View License Information
    • Manage Report Subscriptions
    • Notification Email Settings
  • CASG Reports - An Overview
    • Quarantine Report
    • Domain Statistics Report
    • Auto-Imported Users Report
    • Quarantine Release Report
    • Reported Spam Report
  • Appendix 1 - CASG Error Codes
  • Appendix 2 - CASG Comparison Table
  • Appendix 3 -Troubleshooting LDAP
  • Appendix 4 - Useful Links
  • About Comodo Security Solutions

Configure Exim / cPanel to use a Smarthost


Routing all mails to a smarthost :


Go to the "Exim Configuration Editor" in WHM. Choose "Advanced Editor". Add in the routers section (after begin routers, and after the democheck: router block):

 
smarthost_dkim:
  driver = manualroute
  domains = !+local_domains
  require_files = "+/var/cpanel/domain_keys/private/${sender_address_domain}"
  transport = remote_smtp_smart_dkim
  route_list = $domain mxpool1.spamgateway.comodo.com::587 (for EU based ASG server) 
or

$domain mxpool1.us. spamgateway.comodo.com::587 (for US based ASG server)smarthost_regular: driver = manualroute domains = !+local_domains transport = remote_smtp_smart_regular route_list = $domain mxpool1.spamgateway.comodo.com::587(for EU based ASG server)
or
$domain mxpool1.us. spamgateway.comodo.com::587(for US based ASG server)


Then add in the transports section (after begin transports):

remote_smtp_smart_dkim:
  driver = smtp
  hosts_require_tls = *
  interface = ${if exists {/etc/mailips}{${lookup{$sender_address_domain} 
lsearch*{/etc/mailips}{$value}{}}}{}}
 helo_data = ${if exists {/etc/mailhelo}{${lookup{$sender_address_domain}
lsearch*{/etc/mailhelo}{$value}{$primary_hostname}}}{$primary_hostname}} dkim_domain = $sender_address_domain dkim_selector = default dkim_private_key = "/var/cpanel/domain_keys/private/${dkim_domain}" dkim_canon = relaxed remote_smtp_smart_regular: driver = smtp hosts_require_tls = * interface = ${if exists {/etc/mailips}{${lookup{$sender_address_domain}
lsearch*{/etc/mailips}{$value}{}}}{}} helo_data = ${if exists {/etc/mailhelo}{${lookup{$sender_address_domain}
lsearch*{/etc/mailhelo}{$value}{$primary_hostname}}}{$primary_hostname}}


Save the configuration. All the outgoing mail will be relayed trough the filterserver and accept original and DKIM signed emails.


Routing all mails to a smarthost with SMTP Authentication:

  • Go to the "Exim Configuration Editor" in WHM.
  • Choose "Advanced Editor". do not include "begin authenticators".
  • Otherwise, simply append our 4 lines and leave out our "begin authenticators".


  begin authenticators

  spamgateway_login:
  driver = plaintext
  public_name = LOGIN
  client_send = : username@example.com : yourUserPassword


Add a Router in the Router Configuration Box.


  send_via_spamgateway:
  driver = manualroute
  domains = ! +local_domains
  transport = spamgateway_smtp
  route_list = "* mxpool1.spamgateway.comodo.com::587 byname" (for EU based ASG server)
or
  "* mxpool1.us.spamgateway.comodo.com::587 byname" (for US based server) host_find_failed = defer no_more


Add a Transport to the Transport Configuration Box.

 

(for EU based ASG server)
 spamgateway_smtp:
  driver = smtp
  hosts = mxpool1.spamgateway.comodo.com  hosts_require_auth = mxpool1.spamgateway.comodo.com
  hosts_require_tls = mxpool1.spamgateway.comodo.com

(for US based server)
spamgateway_smtp:
driver = smtp
hosts = mxpool1.us.spamgateway.comodo.com
hosts_require_auth = mxpool1.us.spamgateway.comodo.com
hosts_require_tls = mxpool1.us.spamgateway.comodo.com


Restart Exim.


Extra: Routing all mails for a specific domain to a smarthost with individual outgoing accounts:


To be able to set custom settings/limits for outgoing users, use the information above (Routing with SMTP Authentication) with a small change. Use this:

client_send = :  ${extract{user}{${lookup{$sender_address_domain}lsearch{/etc/exim_spamgateway}}}}  : 
                 ${extract{pass}{${lookup{$sender_address_domain}lsearch{/etc/exim_spamgateway}}}}


instead of the client_send in the previous example.


To create a file called /etc/exim_spamgateway with the following structure, use this :


domain1.com:    user=user@domain1.com     pass=abc
domain2.com:    user=user@domain2.com     pass=xyz


Extra: Limiting Outgoing for certain domains


This option can be combined with the individual accounts configuration to restrict outgoing only to specific domains. You can add the following entry (underneath domains) in the router :


senders = ^.*@domain1.com : ^.*@domain2.com
Our Products
  • Free Antivirus
  • Free Internet Security
  • Website Malware Removal
  • Free Anti-Malware
  • Anti-Spam (Free Trial)
  • Windows Antivirus
  • Antivirus for Windows 7
  • Antivirus for Windows 8
  • Antivirus for Windows 10
  • Antivirus for MAC
  • Antivirus for Linux
  • Free Endpoint Security
  • Free ModSecurity
  • Free RMM
  • Free Website Malware Scanner
  • Free Device Manager for Android
  • Free Demo
  • Network Security
  • Endpoint Protection
  • Antivirus for Android
  • Comodo Antivirus
  • Wordpress Security
Cheap CDN
  • Bootstrap CDN
  • Semantic UI CDN
  • Jquery CDN
  • CDN Plans
  • CDN
  • Free CDN
Enterprise
  • Patch Management Software
  • Patch Manager
  • Service Desk
  • Website Down
  • Endpoint Protection Solutions
  • Website Security Check
  • Remote Monitoring and Management
  • Website Security
  • Device Manager
  • ITSM
  • CRM
  • MSP
  • Android Device Manager
  • MDR Services
  • Managed IT Support Services
  • Free EDR
Free SSL Certificate
Support Partners Terms and Conditions Privacy Policy

© Comodo Group, Inc. 2025. All rights reserved.