[exim] a common(?) usecase with smarthost

Top Page
Delete this message
Reply to this message
Author: graeme vetterlein
Date:  
To: exim-users
Subject: [exim] a common(?) usecase with smarthost
I started to write up my issue, then thought I probably had the solution
already
(1: I may be wrong , 2: other people may have same issue)

TL;DR .. jump to ***

I've been struggling with various setups recently and it occurred to me
there's nothing really special in what I want to do, it's probably a
Well-Known-Setup.

I own a domain "mydomain.com"
I have an "always on server"  (SMTP, dovecot, fetchmail....)
I have a "mail hosting company" forwardemail.net
I don't open any incoming ports to my home systems (I use fetchmail)
Mail sent within the house is usually sent to user@home.
The exim config (Debian) has dc_other_hostnames='......home,mydomain.com...'

With my previous mail hosting company, I redirected mail addressed to
name@??? to them.
They saved it in a few mailboxes and I downloaded every 10 minutes to my
home. All works fine
except you can only read/write mail while at home (ie on home LAN inside
firewall)

When I switched to the new provider I carried over this model. However since
they are more "full featured" I wanted to do better.

So right now if I send mail inside the house to:

1.   graeme              - Delivered Locally
2.   graeme@home         - Delivered Locally
3.   graeme@??? - Delivered Locally
4.   graeme@??? - Gets sent to smarthost (forwardemail.net)

So things only leave the house iff they are for "somebody outside the
house".

If somebody mails me from outside the house, it obviously :

5.   graeme@??? - Goes to forwardemail.net and I pop/imap it
down to home server.

Now what I'd like to do is be able to send/receive email outside the
house. So:

i:   I leave mail sent from outside world on forwardemail.net (don't
delete it).
     pop *copies* down to local home server (there are issues of spam
and space usage etc)
ii:  When I'm outside the house I use smtp.forwardemail.net to both send
(and read imap.forwardemail.net)
iii: When I'm inside the house and use smtp.home as my mailer and look
at local imap.home server (dovecot)

But here's the rub ...and I suspect it's simple (if you know how fix)

While at home:

- if I mail user@home I want it to not leave the house
- if I mail user@??? , I want it to go out to forwardemail.net

(Why? Because much of the mail to user@home is error reports and logs
from other systems)

So this seems easy...right? I just edit dc_other_hostnames="" and remove
mydomain.com , then all mail to
user@home stays local, but all mail to user@??? goes out to
forwardemail.net...great ....EXCEPT..

won't this mean that outgoing mail say it's from graeme@home ?? Which is
unusable out in the real world.

***
Then I spotted : dc_hide_mailname and dc_readhost. Is this their exact
purpose?

So, taken together:

1: Set /etc/mailname to "home"
2: Set dc_other_hostnames=" ... home" and few similar names but NOT
"mydomain.com"
3: Set dc_readhost=mydomain.com and dc_hide_mailname=true

So inside the house , people (machines) can mail graeme@home and it
stays in the
house or mail graeme@??? and it goes out to smarthost WITH the
legal
external address (e.g from user@??? NOT user@home)



--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@???
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/