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

Re: simple exim configuration



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Saturday 21 December 2002 8:16 am, Paul Scott wrote:
> Alan Chandler wrote:
...
> >but for instance, I do
> >
> >fetchmail ->smtp->exim (as MTA)->pipe->spamassassin->exim(as
> >sendmail)->$HOME/Maildir->courier->pop3->kmail
>
> Can you tell me what configuration causes any of those connections
> (except for those which have already been answered in this thread).

Fetchmail
=========

Runs as a daemon (debian package loaded and started by /etc/init.d/fetchmail) 
- - I have listed some of my /etc/fetchmailrc below (I actually poll several 
seperate ISPs and I also have 5 different blueyonder user lines for different 
accounts)

poll pop3.blueyonder.co.uk no dns proto POP3 tracepolls
	aka blueyonder.co.uk
	localdomains chandlerfamily.org.uk
 user "ac003a3222" password "xxxxx" forcecr is * smtpaddress fetchmail.home

this is the multidrop case (catchall for not specific chandlerfamily.org.uk 
addresses).  The specific line is like this

 user "ac003a3222_5" password "xxxxx" forcecr is alan fetchall smtpaddress 
fetchmail.home

which is where mail to alan@chandlerfamily.org.uk gets delivered to.
 

It passes mail via smtp to whatever is on port 25 of the machine.  In my case 
its exim, started via inetd.  The relevant line in /etc/inetd.conf is ...


#:MAIL: Mail, news and uucp services.
smtp            stream  tcp     nowait  mail    /usr/sbin/exim exim -bs

Exim
====

I think you asked some questions earlier about qualify_domain in exim.conf and 
also I seem to remember a bit of the thread about relaying.

here are some relevant paramters (my home network behind the filewall all have 
names *.home - mail from these machines is allowed to leave off the 
@domainname part and if so, has roo.home added as the sender and 
chandlerfamily.org.uk added as the recipient.  exim regards localhost, *.home 
and chandlerfamily.org.uk in mail addresses as local (ie it does not try to 
forward them somewhere else).  Note, I will only relay mail on if it comes 
either locally or from the 10.0.10.0/24 address range (my internal network in 
other words).

primary_hostname = mail.home
qualify_domain = roo.home
receiver_unqualified_hosts = *.home
qualify_recipient = chandlerfamily.org.uk
local_domains = localhost:*.home:chandlerfamily.org.uk
host_accept_relay = 127.0.0.1: 10.0.10.0/24


The following are parts of exim.conf that workout how to deliver mail.  Please 
note I have left a lot out (for instance, I also have mailing lists etc 
supported but not shown).  The bit related to spam checking is show.  Mail 
with a "real-" before the address avoids the spam filter, the rest of local 
mail is checked how it arrived.  Normally its from outside and is sent to the 
check_spam deliverer, otherwise it falls through that check and is delivered 
locally (or directly for mail if its not a known local user).

# This allows local delivery to be forced, avoiding spam filter, alias
# files and forwarding.

real_local:
  prefix = real-
  driver = smartuser
  local_parts = /etc/exim/local-users
  user = ${lc:$local_part}
  transport = local_delivery

# Only Mail that I expect to deliver locally is checked for spam

spam_to_check:
  driver = smartuser
  transport = check_spam
  condition=${if eq {$received_protocol} {spam_checked} {no} {${if eq 
{$sender_address_domain} {chandlerfamily.org.uk} {no} {yes} }} }

# This director matches local user mailboxes.
# (I am being very restrictive on what I will allow - but see later)

localuser:
  driver = smartuser
  local_parts = /etc/exim/local-users
  user = ${lc:$local_part}
  transport = local_delivery

#
# Anything else that has not been handled is to be forced to alan
#
allelse:
  driver = smartuser
  transport=deliver_alan

The transports (again only some) in exim.conf define how it is delivered 
(either locally into a file or piped through spamassassin).

local_delivery:
  driver = appendfile
  group = mail
  mode = 0660
  mode_fail_narrower = false
  envelope_to_add = true
  return_path_add = true
  directory=/home/${lc:$local_part}/Maildir
  maildir_format = true
  prefix = ""

check_spam:
  driver = pipe
  user = mail
  group = mail
  prefix =
  suffix =
  command = spamc -f | exim -oMr spam_checked ${if eq {$sender_address} {} {} 
{-f $sender_address}} \$LOCAL_PART@chandlerfamily.org
.uk
  ignore_status = true
  use_shell = true
  path = /usr/bin:/usr/sbin


Courier
=======

Courier just is a standard debian package.  It expects to find the mail in 
$HOME/Maildir of each user - which it authenticates users who connect via 
pop3 or via imap.

Kmail
=====

This is just configured to read mail via pop3 to mail.home and to send mail 
via smtp to mail.home.  Mail received from kmail by exim is then routed 
internally (if its in the "local_domains" listed above), or via blueyonder 
(my isp) if its for the rest of the internet.  The relevant part of exim.conf 
is

# Send all mail to a smarthost

smarthost:
  driver = domainlist
  transport = remote_smtp
  route_list = "* smtp.blueyonder.co.uk bydns_a"

with a transport

remote_smtp:
  driver = smtp
  headers_rewrite = *@*home $1@chandlerfamily.org.uk
  return_path = ${lc:${sender_address_local_part}}@chandlerfamily.org.uk


With any part that has a @*home address being rewritten to 
@chandlerfamily.org.uk.


I trust this lot answers your questions - sorry its a bit long.  If you need 
any part explained, copy it back and I will try and answer.


- -- 
Alan Chandler
alan@chandlerfamily.org.uk
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+BKgNuFHxcV2FFoIRAgUmAKCz+TOkkkl2tQZL1AZVccAbVguM8gCfQvtn
vCd92Gi1+ykwf29wObh5o+Q=
=jZwv
-----END PGP SIGNATURE-----



Reply to: