The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Exim Mailserver handling forwarded messages

Discussion in 'E-mail Discussions' started by Pixelpirat, Mar 6, 2009.

  1. Pixelpirat

    Pixelpirat Well-Known Member

    Joined:
    Jun 6, 2006
    Messages:
    79
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Germany
    Hello!

    Is there a way to config exim, that new messages, that should been forwared to an external address (another server), are spam and virus checked before there forwarded?

    Now is like this, that exim direct forward the messages to the external adress, without any spam resp. virus checking. That means also, if the forwarded message are rejected that this is landed in our queue... :)

    Many thanks for hints and tricks!

    Pixelpirat
     
  2. swanseahost

    swanseahost Member

    Joined:
    Mar 4, 2006
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Hi there,

    Are you running antispam / antivirus on your server ? Something like MailScanner ?

    If so then you can do the following

    touch /etc/staticroutes

    Then open /etc/staticroutes in your favourite text editor (pico is my preference) and add each domain you would like pushed on in the following format (one per line):

    domainname.com: target.mail.server

    target.mail.server can be a FQDN or an IP address

    In the Routers Configuration section of your exim.conf add the following:

    static_route:
    driver = manualroute
    transport = remote_smtp
    route_data = ${lookup{$domain}lsearch{/etc/staticroutes}}

    Then after an exim restart you should have working smart routers (its always worthwhile to tail the exim_mainlog for a while afterwards just to make sure its ok)

    service exim restart

    Once you have done this then email will be sent to your MX records (Server) then passed through and sent to the External Server after being scanned. It will also keep a copy of the email on your server queued if the external server is down / off.
     
  3. Pixelpirat

    Pixelpirat Well-Known Member

    Joined:
    Jun 6, 2006
    Messages:
    79
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Germany
    Thanks for the fast answer!

    We are using clamav as antivirus and antispam...

    But so it is only working for the forwarding of one domain - we want that all user of the server which activated the forwarding take advantages... for example:

    user1@hosteddomain.com forwarded to Ext-user1@gmail.com
    user2@hosteddomain.com forwarded to Ext-user2@gmx.com

    user1@hosteddomain2.com forwarded to Ext-user2@somewhere.com
    user2@hosteddomain2.com forwarded to user99@hosteddomain.com

    This shall work for all of the domains on the server, not only for one or for some parts...

    Thanks & greetings...

    Pixelpirat
     
  4. Bud Spencer

    Bud Spencer Member

    Joined:
    Jun 6, 2006
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Frankfurt, Germany
    Does nobody has a clue.... ???

    It would be for me also interesting... :D

    Thanks!
     
  5. Bud Spencer

    Bud Spencer Member

    Joined:
    Jun 6, 2006
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Frankfurt, Germany
    mmh... nobody a clue... :D
     
  6. rhenderson

    rhenderson Well-Known Member

    Joined:
    Apr 21, 2005
    Messages:
    785
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Oklahoma
    cPanel Access Level:
    Root Administrator
    There are several posts about this if you search. The bottom line is forwarded accounts are not scanned which is a huge problem. Once the email is forwarded if it is spam and then reported at the final destination your server gets blocked.

    One solution posted in here somewhere is to make a physical account along with the forwarded account then it is scanned. We did this for awhile and then had to write a script to empty our the accounts. It was a pain. We then chose to educate our customers of the dangers of forwarding.

    It is not that no one knows, it is a feature that needs to be added to cPanel.
     
Loading...

Share This Page