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

Re: sendmail (or exim) help, please



On Fri, Feb 25, 2000 at 05:39:08AM +0800, runner@matavnet.hu wrote
> Hi !
> 
> Is it possibble to masquarade my e-mail to the outside world from 
> my LAN ? I'll tell you exactly what I wanted to say. I have a local 
> LAN, one e-mail address. I have set up a local DNS and ipchains 
> rules but I stopped at sendmail. I want to relay mail for the local 
> machines and put the mail into a queue if it goes to the inet but 
> deliver immediatelly inside the LAN. The domain has the name 
> "linbase.org" (not registreted) so all of the outgoing mails have to 
> have "runner@matavnet.hu" (the valid mail address) at the From: 
> and in the Reply-to: fields, not someone@linbase.org.
> Please, help me, how to setup this ! I welcome any URLs, RTFMs, 
> HOWTOs if it's apart from the "official" docs in the distros, 
> because I have already read through them but (maybe I'm too dumb 
> or overlooked something) found nothing to my special problem. 
> Does anyone has a working solution to the situation like this ? If 
> you have a solution with Exim I would welcome it too.
> Thanx a lot,
> Ago
> 

I do this with exim; we have two dialup accounts, and a local
LAN.  We want outgoing mail to have our dial-up account name
in From and Reply-To, but we want local mail (including mail
addressed to the dial-up account names) delivered directly.
We also want to be able to send mail to other dial-up users
at our ISP.

What I've done is this:

 - Listed our ISP mail host name in local_domains in /etc/exim.conf:
   local_domains = localhost:*.localnet:isp.net.au

 - Added a special director that handles locally-generated mail for 
   one of our dialup accounts, at the head of the list of directors:
   dialup_localusers:
     driver = aliasfile
     domains = isp.net.au
     file = /etc/exim/isp-addresses
     search_type = lsearch

   /etc/exim/isp-addresses is a regular alias file that maps ISP
   account names to local usernames (or other addresses), like this:
   huiac:  john@huiac.localnet

 - Added another director after that one, that deals with any other
   customers of our ISP:
   dialup_otherusers:
     driver = smartuser
     domains = isp.net.au
     transport = remote_smtp

 - If I had accounts at more than one ISP, I'd need to create 
   a separate alias file and two directors (local users/other
   ISP users) for each ISP.

 - Use a smarthost (our ISP) for delivering non-local mail; as the
   local machine is mailserver for our entire LAN, this is the only
   entry in the ROUTERS section of /etc/exim.conf:
   smarthost:
     driver = domainlist
     transport = remote_smtp
     route_list = "* mail.isp.net.au bydns_a"

   If I wanted to deliver mail to other machines on my internal LAN,
   I'd need an additional router ahead of this one to handle those.

 - Added rewriting rules to replace our local LAN addresses with
   the appropriate ISP account addresses in any headers:
   *@huiac.localnet    ${lookup{$1}lsearch{/etc/exim/outgoing-addresses}\
                                        {$value}fail} Fh
   
   /etc/exim/outgoing-addresses contains lines like this:
   john   huiac@isp.net.au

   This example replaces the address john@huiac.localnet with
   huiac@isp.net.au in all headers except envelope "To:" headers.

Simpler schemes are possible, but this is the only one I've
devised so far that will deliver locally-generated mail
addressed to one of my dial-up accounts (e.g.,
<huiac@isp.net.au>) as local mail (i.e., without going via my
ISP's mailserver), deals with multiple dial-up account names
and also correctly delivers mail to other people's accounts 
on my ISP.


John P.
-- 
huiac@camtech.net.au
john@huiac.apana.org.au
"Oh - I - you know - my job is to fear everything." - Bill Gates in Denmark


Reply to: