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

Re: mails for other domains



hi Brian,

I have done the below and it seems to work but i'll like to ask how can i go 
about using the an external database as you suggested?

regards,


-fiao

On Sunday 14 July 2002 08:57 am, Brian Candler wrote:
> On Sat, Jul 13, 2002 at 09:47:12PM +0100, Fisayo Adeleke wrote:
> > I have currently have exim running for a single domain 'mycompany.com'
> > and it's sending and receiving mails perfectly. How can i set up my exim
> > to hold mails for more than one domain e.g. customer1.com, customer2.net
> > and thatcompany.org, etc.?
>
> One way of doing this is given here:
> http://www.ws.afnog.org/afnog2002/track1/exim/EximPrac.pdf
> (in section 2.1). This lets you set up a separate aliases file for each
> virtual domain, e.g.
>
>     # Aliases file for customer1.com
>     sales:    mailbox123
>     info:     mailbox124
>
> Another way was posted to this list a little while ago [attached], to route
> mail for allusers at somedomain to a single local mailbox, e.g.
>
>     customer1.com:          mailbox123
>
> Another way is to use an external database (e.g. mysql or LDAP) which
> contains the mapping of E-mail address to mailbox file or maildir. If you
> build your mailserver this way, and also have a POP3 server which
> authenticates against your mysql/LDAP database, then you can set it up so
> that you do not need each of your users to have an entry in the Unix
> password file at all.
>
> Regards,
>
> Brian.

> Return-path: <owner-afnog-outgoing at afnog.org>
> Envelope-to: brian at localhost
> Delivery-date: Fri, 14 Jun 2002 22:10:45 +0100
> Received: from localhost ([127.0.0.1])
> 	by vaio.linnet.org with esmtp (Exim 4.05)
> 	id 17IyKW-0001zN-01
> 	for brian at localhost; Fri, 14 Jun 2002 22:10:00 +0100
> Received: from pop3.uk.worldonline.com
> 	by localhost with POP3 (fetchmail-5.9.11)
> 	for brian at localhost (single-drop); Fri, 14 Jun 2002 22:10:00 +0100 (BST)
> Received: from mk-rewrite-3.mail.uk.tiscali.co (212.74.114.134) by 
mk-cpfrontend.uk.tiscali.com (6.0.053)
>         id 3CF22F5F001F1BD9 for bcandler at worldonline.co.uk; Tue, 4 Jun 2002 
15:12:31 +0100
> Received: from [64.71.166.114] (helo=cali-1.pobox.com)
> 	by mk-rewrite-3.mail.uk.tiscali.co with esmtp (Exim 3.33 #1)
> 	id 17FF1G-00085b-00
> 	for brian at bcandler.worldonline.co.uk; Tue, 04 Jun 2002 15:10:42 +0100
> Received: from cali-1.pobox.com (localhost.localdomain [127.0.0.1])
> 	by cali-1.pobox.com (Postfix) with ESMTP id 7A1D33E6B0
> 	for <brian at bcandler.worldonline.co.uk>; Tue,  4 Jun 2002 10:12:24 -0400 
(EDT)
> Delivered-To: b.candler at pobox.com
> Received: from spice.eahd.or.ug (spice.eahd.or.ug [216.250.215.44])
> 	by cali-1.pobox.com (Postfix) with ESMTP
> 	id 5571B3E634; Tue,  4 Jun 2002 10:11:55 -0400 (EDT)
> Received: by spice.eahd.or.ug (Postfix)
> 	id 0CF141F68C; Tue,  4 Jun 2002 17:16:22 +0300 (EAT)
> Delivered-To: afnog-outgoing at afnog.org
> Received: from localhost (localhost [127.0.0.1])
> 	by spice.eahd.or.ug (Postfix) with ESMTP id DC6021F686
> 	for <afnog-outgoing at afnog.org>; Tue,  4 Jun 2002 17:16:21 +0300 (EAT)
> Received: by spice.eahd.or.ug (Postfix, from userid 28)
> 	id D7B0B1F680; Tue,  4 Jun 2002 17:16:20 +0300 (EAT)
> Delivered-To: afnog at afnog.org
> Received: from localhost (localhost [127.0.0.1])
> 	by spice.eahd.or.ug (Postfix) with ESMTP id 55F7B1F686
> 	for <afnog at afnog.org>; Tue,  4 Jun 2002 17:16:20 +0300 (EAT)
> Received: from internal.mail.telinco.net (internal.mail.telinco.net 
[212.1.128.4])
> 	by spice.eahd.or.ug (Postfix) with ESMTP id A9FF31F680
> 	for <afnog at afnog.org>; Tue,  4 Jun 2002 17:16:16 +0300 (EAT)
> Received: from ppp-dp1-mk-66.access.uk.worldonline.com ([212.74.113.66] 
helo=playdog.local.linnet.org)
> 	by internal.mail.telinco.net with esmtp (Exim 3.22 #1)
> 	id 17FF0J-0005fN-00; Tue, 04 Jun 2002 15:09:43 +0100
> Received: (from brian at localhost)
> 	by playdog.local.linnet.org (8.9.3/8.9.3) id XAA01365;
> 	Mon, 3 Jun 2002 23:35:16 +0100
> Date: Mon, 3 Jun 2002 23:35:16 +0100
> From: Brian Candler <B.Candler at pobox.com>
> To: Godfred Ofori-Som <gofori at ghana.com>
> Cc: afnog at afnog.org
> Subject: Re: Virtual Domains Setup
> Message-ID: <20020603233516.B1244 at linnet.org>
> References: <5.1.0.14.2.20020603181646.03c1cdc0 at 127.0.0.1>
> Mime-Version: 1.0
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: inline
> User-Agent: Mutt/1.2i
> In-Reply-To: <5.1.0.14.2.20020603181646.03c1cdc0 at 127.0.0.1>; from 
gofori at ghana.com on Mon, Jun 03, 2002 at 06:25:45PM +0000
> Sender: owner-afnog at afnog.org
> Precedence: bulk
> 
> On Mon, Jun 03, 2002 at 06:25:45PM +0000, Godfred Ofori-Som wrote:
> > I am trying to setup a virtual domain with exim. I have looked at the
> > configuration but i think what i want is different from the way virtual
> > domains has been described.
> > The configuration I want, is to use exim to collect emails for some
> > domains and just drop it to a single mailbox on my mail server.
>
> The same question was raised by someone at the workshop. One solution is to
> modify the router slightly: change 'lsearch' to 'lsearch*'
>
> virtual_domains:
>   driver = redirect
>   domains = lsearch;/usr/exim/vdomains
>   data = ${lookup{$local_part}lsearch*{/usr/exim/aliases-$domain}}
>                               ^^^^^^^^
>   no_more
>
> Then you can put entries in /usr/exim/aliases-example.com of the form:
>
>     sales:   mailbox123
>     *:       mailbox456
>
> in which case mail to 'sales at example.com' will get delivered to
> 'mailbox123', but mail to '<anythingelse> at example.com' will get delivered
> to 'mailbox456'
>
> (changing 'lsearch' to 'lsearch*' means that if exim fails to find the
> value it was looking up, it tries the lookup again for the value '*')
>
> That gives you a lot of flexibility, but it still requires you to create a
> separate file for each domain, which may have only one entry in it.
>
> It's very easy to change the router so it just looks up the domain in a
> single file:
>
> virtual_domains:
>   driver = redirect
>   domains = lsearch;/usr/exim/vdomains
>   data = ${lookup{$domain}lsearch{/usr/exim/vdomains}}
>   no_more
>
> In this case you have only one file, /usr/exim/vdomains, with entries like
> this:
>
> example.com:	mailbox123
> example.net:	mailbox456
>
> Mail to <anylocalpart> at example.com will be delivered to mailbox123, and
> mail to <anylocalpart> at example.net will be delivered to mailbox456.
>
> Notice the difference in the lookup expression:
>
>   ${lookup{ VALUE-TO-LOOKUP } SEARCHTYPE { FILE }}
>
> In the first case we told exim to lookup the local-part (left-hand side of
> the address) in a file, whose name depended on the domain (right-hand side
> of the address)
>
> In the second case we tell exim to lookup just the domain in a single file.
>
> Is that what you were looking for?
>
> Regards,
>
> Brian.
>
> -----
> This is the afnog mailing list, managed by Majordomo 1.94.5
>
> To send a message to this list, e-mail afnog at afnog.org
> To send a request to majordomo, e-mail majordomo at afnog.org and put
> your request in the body of the message (i.e use "help" for help)
>
> This list is maintained by owner-afnog at afnog.org

-----
This is the afnog mailing list, managed by Majordomo 1.94.5

To send a message to this list, e-mail afnog at afnog.org
To send a request to majordomo, e-mail majordomo at afnog.org and put
your request in the body of the message (i.e use "help" for help)

This list is maintained by owner-afnog at afnog.org