[Gllug] How to get exim4 to use different relays depending on target address

Alain Williams addw at phcomp.co.uk
Sat Sep 17 16:06:39 UTC 2005


On Sat, Sep 17, 2005 at 04:36:08PM +0100, John Winters wrote:
> I'm looking for some assistance with exim4 configuration on a pretty
> vanilla Debian Sarge box.
> 
> This box is at school and I want to be able to send outgoing e-mail from
> it.  Unfortunately the e-mail setup at school is slightly odd.
> 
> I can't send e-mail directly to the outside world because port 25 will
> be blocked by the firewall.
> 
> I can connect to our own internal SMTP server (which handles most of our
> outgoing e-mail) but the admins controlling it won't let me use it as a
> relay.  I can thus use it only for local e-mail - that intended for
> someone within the organisation.
> 
> For external e-mail I can use one external SMTP server (the one which
> handles our incoming e-mail), but if I send internal e-mail to that
> machine it is then passed through a (really crap) spam filter which
> flags a significant amount of my internal e-mail as spam.  It's so crap
> that it doesn't even give a reason, so I've no way of knowing what I
> need to do to get it to stop.  Support's view is that it's expensive so
> it must be good and getting it fixed is probably not an option.
> 
> So, what I need to do is arrange that mail passing through exim4 on my
> box is routed to one of two different places:
> 
>     If it is for <anyone>@<ourorganisation>.co.uk then it needs to go
>     to the internal SMTP server.
> 
>     Otherwise it needs to go to the external SMTP server.

You need to have something like this in the routers section,
remember that the order in which these occur IS important:

internal_mail:
  driver = manualroute
  domains = <ourorganisation>.co.uk
  transport = remote_smtp
  route_list = * internal_mailserver.<ourorganisation>.co.uk

externam_mail:
  driver = manualroute
  domains = ! +local_domains
  transport = remote_smtp
  route_list = * external_mailserver.<ourorganisation>.co.uk
  no_more

# Then routers for local delivery

> In other words, I want to configure exim4 to use a smarthost for most
> purposes, but for one particular set of addresses it is to use a
> different relay.
> 
> Is there a simple way of doing this please?
> 
> Regards,
> John
> 
> -- 
> Gllug mailing list  -  Gllug at gllug.org.uk
> http://lists.gllug.org.uk/mailman/listinfo/gllug

-- 
Alain Williams
Parliament Hill Computers Ltd.
Linux Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256  http://www.phcomp.co.uk/

#include <std_disclaimer.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20050917/a6e2fcac/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list