[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Finding a replacement for my ISP's smtp server



On Mon, 28 Jul 2014 21:56:50 +0100
Brian <ad44@cityscape.co.uk> wrote:

> On Mon 28 Jul 2014 at 16:05:11 -0400, Jerry Stuckle wrote:
> 
> > On 7/28/2014 1:16 PM, Brian wrote:
> > 
> > > All my mail from home is sent directly using exim which, as far
> > > as I can make out will only send on port 25. Leaving aside what
> > > you say below (my ISP does not block outgoing port 25 traffic) I
> > > should not be affected? 
> > 
> > Exim can use other ports also.  It's all in the configuration. (but
> > sorry, I do not have enough expertise to tell you exactly how to do
> > it).
> 
> Exim will definitely *receive* mail on multiple ports; that much I do
> know. Sending on other than port 25 would appear to contradict the
> idea that MTAs only communicate over port 25. But I'll look into it.
> 

You can do nearly anything you can imagine with exim4. It has 'routers'
to deal differently with different sending and receiving domains (and
pretty much any other aspect of a message it is given), and 'transports'
which specify how the message is to be handled, SMTP being one
alternative. You set up a transport to deal with a particular remote
server, then a router to identify the mail to be sent there. You can
have an arbitrary number of smarthosts handling different domains, or
send directly to some domains, all other mail going via a smarthost,
etc. The routers have to be in a particular order, the transports don't.

Here are a router and transport I used for sending to a smarthost, years
ago, for all mail to a set of sub-domains. I no longer have any domain
names hosted here, so I've left in the mail host's name and server
details. Here also is the skeleton conf.d/passwd.client file where
server logon credentials are saved.



#####################################################
### router/200_exim4-config_primary
#####################################################

### router/200_exim4-config_primary
#################################
# This file holds the primary router, responsible for nonlocal mails

.ifdef DCconfig_internet
# configtype=internet
#
# deliver mail to the recipient if recipient domain is a domain we
# relay for. We do not ignore any target hosts here since delivering to
# a site local or even a link local address might be wanted here, and if
# such an address has found its way into the MX record of such a domain,
# the local admin is probably in a place where that broken MX record
# could be fixed.

#mydomain:
  debug_print = "R: mydomain for $local_part@$domain"
  driver = manualroute
  domains = *.mydomain.co.uk
  transport = oneandone_auth_smtp
  route_list = * auth.smtp.1and1.co.uk





### transport/30_exim4-config_remote_smtp_smarthost
#################################

# This transport is used for delivering messages over SMTP connections
# to a smarthost. The local host tries to authenticate.
# This transport is used for smarthost and satellite configurations.

remote_smtp_smarthost:
  debug_print = "T: remote_smtp_smarthost for $local_part@$domain"
  driver = smtp
  hosts_try_auth = <; ${if exists{CONFDIR/passwd.client} \
        {\
        ${lookup{$host}nwildlsearch{CONFDIR/passwd.client}{$host_address}}\
        }\
        {} \
      }
.ifdef REMOTE_SMTP_SMARTHOST_HOSTS_AVOID_TLS
  hosts_avoid_tls = REMOTE_SMTP_SMARTHOST_HOSTS_AVOID_TLS
.endif
.ifdef REMOTE_SMTP_HEADERS_REWRITE
  headers_rewrite = REMOTE_SMTP_HEADERS_REWRITE
.endif
.ifdef REMOTE_SMTP_RETURN_PATH
  return_path = REMOTE_SMTP_RETURN_PATH
.endif
.ifdef REMOTE_SMTP_HELO_FROM_DNS
  helo_data=REMOTE_SMTP_HELO_DATA
.endif

oneandone_auth_smtp:
  debug_print = "T: oneandone_auth_smtp for $local_part@$domain"
  driver = smtp
  hosts_require_auth = auth.smtp.1and1.co.uk
  port = 587



#####################################################
### end transport/30_exim4-config_remote_smtp_smarthost
#####################################################




/etc/exim4/conf.d/passwd.client:

# password file used when the local exim is authenticating to a remote
# host as a client.
#
# see exim4_passwd_client(5) for more documentation
#
# Example:
### target.mail.server.example:login:password


-- 
Joe


Reply to: