How do I setup SMTP Relay?

webnickel

New member
Joined
Sep 23, 2009
Messages
1
I've tried researching and following how-tos with no luck at all. I'm not really sure at this point how I am supposed to accomplish this but heres what i need.

I have a SMTP relay/smarthost that i want all my outgoing email (preferable anything outgoing to hotmail, live, msn etc) to be sent through.

How do I set my machine with DA/exim on it to relay all outbound mail to this smarthost?

my smarthost comes with a user and password, so i would need a place to enter that in the conf file somewhere with the relay hostname.

Thanks in advance for your help.
Nick
 
You buy another product.
Why would you do that, scsi? Using what we call a smarthost is often a valid solution, and very reasonable. And exim makes using one very easy.

When we had a problem with rDNS at a datacenter which couldn't be instantly fixed, we simply sent all outgoing email through a different server until we got the rDNS fixed.

Then we changed back.

Jeff
 
In case anyone needs this...and I did this weekend. This works in Exim 4:

smarthost:
driver = manualroute
domains = *
transport = remote_smtp
route_data = "208.xx.xx.xxx"

Just add your IP or server name to route_data and it works just fine.
 
how do i setup the smarthost username and password on this configuration?

Thanks
 
I'm not sure what you mean by a smarthost username and password. A smarthost gets email on port 25, unauthenticated. You need to set up the smarthost to relay email from your outgoing IP#.

Jeff
 
some smarthost services require username and password, especially if it is an outsourced service outside your own datacenter.
 
i found it:

#

Near the bottom of your configure file, in the "AUTHENTICATION CONFIGURATION", enter:

login:
driver = plaintext
public_name = LOGIN
client_send = ": username : password"

Thanks
 
Using outgoing as Smarthost

I'm trying to setup smarthost for a certain domain to use an external filtering service.

Tried the exim settings here but it's not working.

my config after "begin routers"

spamexperts_smarthost_router:
driver = manualroute
domains = ! +local_domains
ignore_target_hosts = 127.0.0.0/8
condition = "${perl{check_limits}}"
transport = spamexperts_smarthost_transport
route_list = abcdef.com 203.81.XX.XXX::26
no_more

after "begin transports"

spamexperts_smarthost_transport:
driver = smtp
hosts_require_tls = *


Error I got after exim restart.

Unrouteable address error.


Has anyone done something similar whereby all mails from a certain domain is sent to an external filtering server?
 
Spamexperts themselfves should be able to help you with that. They have multiple clients with the Directadmin control panel. I only fixed this once, but this was on a Cpanel server.
I just setup the spamexperts server as external email server, so used their mx adresses als primary and secondary mx. I don't know if this is also possible with DA.
 
This is the manual router built into the latest version of SpamBlocker exim.conf file for DirectAdmin (available here [nobaloney.net]):
Code:
 smarthost:
  driver = manualroute
  domains = ! +local_domains
  ignore_target_hosts = 127.0.0.0/8
  condition = "${perl{check_limits}}"
  route_list = !+local_domains HOSTNAME-or-IP#
  transport = remote_smtp

Don't forget to edit HOSTNAME-or-IP#.

Have you removed or commented out the lookuphost router? If not, and if it's above this one, then the code won't be executed.

Jeff
 
Thanks, I managed to route all outbound emails to the filtering server with the above quoted.

However, this route ALL emails from ALL domains. I'm looking at only 1 domain instead of All.

Tried with

domains = ! +local_domains abcd.com

But exim display some unrouteable error.
 
Actually if directadmin use some api/whatever to create mail user on a remote server with this edit we should be able to use an external mail server right?

I would like to use multiple DA Server and separated MySQL and Mail that archive all data for the multiple servers...

Would be very interesting i think...

Any clue?

Regards
 
Thanks, I managed to route all outbound emails to the filtering server with the above quoted.

However, this route ALL emails from ALL domains. I'm looking at only 1 domain instead of All.
I've never tried this. Are you trying to route through a smarthost email from only (for example) one domain?
I've Googled but I can't find documentation for doing this. You might want to ask on the exim mailing list.

Jeff
 
Yes, that's exactly what I'm trying to do. Will do a query on Exim forum.

Thanks mucho.
 
i wonder was there any response on this, i try to do this also , just a list of local domains, that these are send to a specific set of smarthosts
 
You may need to do something like this if for some reason your IP was blacklisted. Many times it isn't your IP specifically buy a whole range of IPs are blacklisted due to one IP in that range. My solution was very similar to the ones above.

Add this to the top of your routers section in exim.conf
Code:
static_route:
  driver = manualroute
  transport = remote_smtp
  domains = lsearch;/etc/virtual/staticroutes
  route_data = $domain_data
Then you can add/modify/delete the entries in the /etc/virtual/staticroutes file which would look similar to this:
Code:
hotmail.com: 192.168.0.1
msn.com: 192.168.0.1
live.com: 192.168.0.1

The domain to match is the part before the colon and the relay IP (smarthost) would be the IP after the colon. I can edit this file without having to restart exim.
 
You may need to do something like this if for some reason your IP was blacklisted. Many times it isn't your IP specifically buy a whole range of IPs are blacklisted due to one IP in that range. My solution was very similar to the ones above. ...

toml thx for your reply, the suggested solution is for destination routes that have blacklisted your ip and it is then a good fix.. will keep this in the wiki (thx)

My situation is only reversed.. i would need to route based on the senders domain..
it's to enable customers specific or custom external spam filters.. for outgoing mail.
to have one or more outgoing domains sending its mail towards a specific smarthost. (source / senders domain)
its easy to forward all outgoing mail towards a smarthost, but based on the senders domain i am still unable to figure it out..
 
Back
Top