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.

Remote Mail Server

Discussion in 'E-mail Discussions' started by khyer, Sep 16, 2009.

  1. khyer

    khyer Registered

    Joined:
    Sep 16, 2009
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    We are using cPanel to manage the websites of various student clubs and organizations in our student union. Our institute has a rule that says that all outgoing mail must be sent through their servers. We have a dedicated mail server running Exim that filters spam, processes mail to mailing lists and sends all mail through our campus mail servers.

    We don't give our users mailboxes, as we already have a mailing list solution configured through an existing Exim server. However, how can I make mail that is sent within PHP go through our dedicated mail server? Our old webserver (not running cPanel) can somehow do it, but I can't figure out how to do it on cPanel. We just want the mail to get sent through a different mail server, rather than directly from this box.

    Thanks in advance for your time.
     
  2. MattCurry

    MattCurry Well-Known Member

    Joined:
    Aug 18, 2009
    Messages:
    275
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Houston, Tx
    Remote Mail

    Hello,

    I just want to make sure I understand, are you trying to use a different SMTP server for your clients? or were you trying to forward the mail generated on this server through your in house SMTP server? The easy work around would be to have your users use the SMTP server to send and your pop server to check incoming mail. Please let me know if this is the direction you are going.

    Thank you,
    Matthew Curry
     
  3. chrish.

    chrish. Member

    Joined:
    Jun 30, 2009
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    I assume you're looking to set up a smarthost (e.g. smart router, smtproute, relay_host, whichever you fancy calling it), that sound about right?

    This requires editing exim.conf via the advanced configuration editor, and is "officially unsupported" I think is the tag line, though, it is certainly physically doable.

    You can do it as such:

    nickpack.com - Using Exim as a smarthost

    Those entries would go in the advanced configuration editor, if you go right below the log_selector line

    If you put it in the wrong place, exim will barf and complain the configuration file is invalid, so the changes won't be applied. Put it in that topmost editable area, on a new line below the log_selector line.

    In terms of static routes, I believe you could just do

    Code:
    *:server.domain.tld
    
    to have all domains' email routed through server.domain.tld

    I'll need to check and confirm, but it might be even easier - something like:

    Code:
    smarthost:
    driver = manualroute
    domains = *
    transport = remote_smtp
    route_data = "server.domain.tld" 
    

    EDIT: ah yes, here we go - http://www.oreillynet.com/pub/a/oreilly/networking/news/exim_0701.html

    I *do* know the first method mentioned (the one from the nickpack site) works - I tested it, seems fine. Its shortcoming is it's a per-domain redirect.

    From the sound of your setup, a global redirect might be more suitable, which is what I've aimed for in the latter bits of my post.
     
    #3 chrish., Sep 17, 2009
    Last edited: Sep 17, 2009
  4. khyer

    khyer Registered

    Joined:
    Sep 16, 2009
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    CPanelMattCurry,

    I am indeed trying to use a different SMTP server. I don't want mail generated on this server to be sent directly out of this box. It needs to be sent to another mail server, which is already configured to forward the mail to our campus mail servers for scanning and such before they forward it out.

    I will try what cpanelchrish recommended and see if that works.

    Thank you both for your input, I'll let you know how it goes.
     
  5. khyer

    khyer Registered

    Joined:
    Sep 16, 2009
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    It worked

    It worked, I had to use this though:

    smarthost:
    driver = manualroute
    domains = *
    transport = remote_smtp
    route_data = "mta3.somewhere.com"

    This one works for Exim4, the example in the link you gave was for an earlier version, but it pushed me in the right direction.

    Now, when I receive messages sent from this server, the e-mail client still shows it coming from my webserver.domain.com, and not my mailserver.domain.com. Is there a way to alter that? instead of it having sent with a return path of root@websrver.domain.com, can I have it sent from root@mailserver.domain.com?
     
Loading...

Share This Page