Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Sep 2005
    Posts
    18

    Default Relays, exim and cpanel

    Hello,

    this is a question about Exim, but perhaps someone has got the same problem.
    I've some relays for antispam/antivirus and the MX record for all domains from the Cpanel servers changed to go through those servers.
    The problem is that some spammers sends mails directly to the A record of the domain (the Cpanel server) so those mails aren't scanned.

    Any solution to this?
    Any way to say to Exim to refuse incoming mail that doesn't come from relays or isn't authenticated (to send outside)?

    Thanks!

    Regards,
    split.

  2. #2
    Member
    Join Date
    Jan 2005
    Location
    /dev/null
    Posts
    770

    Default

    this is perfectly possible with acl's - http://www.exim.org/exim-html-4.20/d...l/spec_37.html

    I will write one for you later on if you have no joy

  3. #3
    Member
    Join Date
    Sep 2005
    Posts
    18

    Default

    Hello!

    thx for the answer, I'm reading now the ACL section of the Exim tutorial (I've never use them :-/ ).
    Can you write one to see how it works, please?

    Thanks!

    Regards,
    split.

  4. #4
    Member
    Join Date
    Jan 2005
    Location
    /dev/null
    Posts
    770

    Default

    Something like this should do it, its only a simple example but you should get the point.

    In the top box of the advanced exim config editor in WHM add:

    Code:
    acl_smtp_helo = acl_check_helo
    Then in the ACL section:

    Code:
    acl_check_helo:
        deny message = Invalid HELO/EHLO. You are not a server on my network.
                condition = ${if match{$sender_helo_name}{yourservers.fqdn.com}{no}{yes}}
    
         accept

  5. #5
    Member
    Join Date
    Sep 2005
    Posts
    18

    Default

    Hello again!

    thinking about it, I've seen that commenting some lines from exim.conf could be enought:

    check_recipient:
    accept hosts = :
    require verify = sender
    # accept domains = +local_domains
    # endpass
    message = "The recipient cannot be verified. Please check all recipients of this message to verify they are valid."
    verify = recipient

    # accept domains = +relay_domains

    warn message = ${perl{popbeforesmtpwarn}{$sender_host_name}}
    hosts = +relay_hosts
    accept hosts = +relay_hosts

    warn message = ${perl{popbeforesmtpwarn}{$sender_host_address}}
    condition = ${perl{checkrelayhost}{$sender_host_address}}
    accept condition = ${perl{checkrelayhost}{$sender_host_address}}

    accept hosts = +auth_relay_hosts
    endpass
    message = $sender_fullhost is currently not permitted to \
    relay through this server. Perhaps you \
    have not logged into the pop/imap server in the \
    last 30 minutes or do not have SMTP Authentication turned on in your email client.
    authenticated = *

    deny message = $sender_fullhost is currently not permitted to \
    relay through this server. Perhaps you \
    have not logged into the pop/imap server in the \
    last 30 minutes or do not have SMTP Authentication turned on in your email client.


    Commenting the lines:

    # accept domains = +local_domains
    # accept domains = +relay_domains

    Exim won't accept mails if they aren't comming from relay_hosts (where I've defined the relays) or not authenticated.

    I'm right?

    Thanks!

    Regards,
    split.

  6. #6
    Member
    Join Date
    Jan 2005
    Location
    /dev/null
    Posts
    770

    Default

    commenting out those lines will stop all incoming mail traffic which is fine if you only want your server to send out, but stop any mail pushed from your other servers.

    accept domains = +local_domains - accept e-mail for local domains
    accept domains = +relay_domains - accept e-mail for domains in /etc/remotedomains


    adding a hosts accept would be a better way of securing it in actual fact

    warn message = Sorry your server is not permitted to relay to us.
    hosts = +our_hosts
    accept hosts = +our_hosts

    then add an acl called our_hosts with the lsearch syntax used for the others
    Last edited by nickp666; 10-20-2006 at 07:33 AM.

Similar Threads & Tags
Similar threads

  1. Blocking local relays
    By brianell in forum E-mail Discussions
    Replies: 1
    Last Post: 08-06-2009, 04:15 PM
  2. configurar PTR y OPEN RELAYS
    By guatemalanet in forum Discusión en Español
    Replies: 0
    Last Post: 04-06-2008, 12:45 AM
  3. Detecting 'Open Relays'
    By bidware in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 10-02-2006, 11:14 AM
  4. Unusual Ammount of Cpanel Mail Relays
    By ryan.overton in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 04-11-2006, 11:07 AM
  5. ALL CPANEL servers = limited open relays
    By H2Hosting.com in forum cPanel and WHM Discussions
    Replies: 9
    Last Post: 09-04-2003, 01:00 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube