[Exim] intranet with dialup connection

Top Page
Delete this message
Reply to this message
Author: tcurdt
Date:  
To: exim-users
Subject: [Exim] intranet with dialup connection
Sorry! I lost the mail I'm referring to but noticed
you have the same problem as I had - hope it works
for you, too:

We're running exim in our intranet having a dial-up
connection. So we are not permanently connected
to the internet. (I know Philip... exim wasn't
designed for this purpose ;-) but it works anyway!!

There were a lot discussions about this topic before...
Actually I don't like the solution in the FAQ
running two instances of exim on different ports
-one for the intranet and one for the internet-
just to be able to mix intern and extern mailadresses!

Which means...

We have our localdomain "ournet.local" with our users
"misterx@???" etc. But since these mail
addresses are not world reachable they need to be
rewritten to a world reachable and valid eMail
address on the net if -and only if!- the're supposed
to leave the intranet!

So if misterx writes to a local user the message
does not need to be rewritten at all.
But if misterx writes to an extern world address
he has to show up as a valid sender!!

They way we do it might not be perfect or somehow
messy but it works for us (comments are welcome
anyway!):

We have two types of transports. For the local
intranet only a local delivery is necessary.
For the mails that are supposed to leave our
local net we have this transport:

remote_smtp:    
  driver = smtp
  remove_headers = "From"
  add_headers = "From: ${lookup{$sender_address_local_part}\
    lsearch{/etc/exim/remote_smtp_from_rewrite}{$value}{$sender_address}}"


and option "queue_remote_domains = *" in the global config.

All local mails are delivered immediately. The mails leaving
the local net are queued. When we're online a "exim -qf"
forces the mails to be transported. The transport above
replace the "From" header with a world reachable eMail address
as defined in the file "/etc/exim/remote_smtp_from_rewrite"

remote_smtp_from_rewrite look like:
misterx        someonevalid@???
mistery        someonevalid@???


Hope this helps :-)
--
Torsten