Re: dynamic IP's, IP masq and mail, can it be done?

2000-01-25 Thread Allan M. Wind
On 2000-01-25 01:29:55, Ethan Benson wrote:

 I have a small network connected to the internet via a IP masq 
 gateway, and would like to get mail working, but the above setup is a 
 nightmare for mail it would seem.

Why?  Sounds like mail masq'ing.

 is it even possible for mail to work in such a setup or am i wasting 
 my time?

Depends on what you are trying to do.  Outgoing mail should be easy,
incoming mail wouldn't make sense unless you have a domain name (of
some sort).

 I got the gateway machine to send mail, but my fake domain still
 shows up in various places, such as the message ID and a second From
 line.

Hmm... sounds like you didn't masq the envelope.

 and in order to do that i had to setup a virtual table for all the
 local user accounts, otherwise when cron or something send mail to
 root it would go to [EMAIL PROTECTED] ...

I used:

canonical_maps = hash:/etc/postfix/canonical

to map root to my normal email (in case my box dies,
it might have left a clue there).

root [EMAIL PROTECTED]

and 

sender_canonical_maps = hash:/etc/postfix/canonical_sender

to map a user without a real email adderss to my email address

user [EMAIL PROTECTED]

and finally:

recipient_canonical_maps = hash:/etc/postfix/canonical_receiver

to have mail to the user without email be delivered locally
if send from my box.

 should I just get a static IP and a real domain name or is there some 
 way to make this work that is not too ugly?

There's no way around specifying your local acconuts as you have to
tell your mta that it's only authorative for a set of accounts.  You
could automative things using something like make with a dependency on
your /etc/passwd and some script to filter out the accounts that you
don't care about.

 (the way i got mail to work partially, was to disable dns lookups in 
 postfix, which allows mail to get delivered within the fake network, 
 and setting myorigin to alaska.net on the gateway

Ok.

 and setting the vitual table to redirect root and such to localhost
 but other machines cannot send mail still. and the gateway i think
 does not send correct mail since it has all this fake crap in it...)

You probaly need to enable relay for your local network, but otherwise
it sounds like you're on the right path.


/Allan
-- 
Allan M. Wind   Email: [EMAIL PROTECTED]
P.O. Box 2022   Phone: 781.279.4513 (home)
Woburn, MA 01888-0022   Phone: 781.274.7000 ext. 368 (work)


Re: dynamic IP's, IP masq and mail, can it be done?

2000-01-25 Thread Joe Block
Ethan Benson wrote:
 
 Hi,
 
 I have a small network connected to the internet via a IP masq
 gateway, and would like to get mail working, but the above setup is a
 nightmare for mail it would seem.
 
 is it even possible for mail to work in such a setup or am i wasting
 my time?  I got the gateway machine to send mail, but my fake domain
 still shows up in various places, such as the message ID and a second
  From line.  and in order to do that i had to setup a virtual table
 for all the local user accounts, otherwise when cron or something
 send mail to root it would go to [EMAIL PROTECTED] ...
 
 I am using Postfix and have gone through pretty much all of the
 documentation on the web site and still don't have this all working
 very well, and it seems to be a very very messy setup.

I'm using postfix on slink to do this now.  It's been a while since I
set it up so I may be a little vague about some of the details, my
notebook with my debian notes has gone missing.

Do you have a domain already?  If you do, see if your isp will do uucp
delivery for you.  My home lan gets its mail via uucp from my desktop
machine at work.  If you don't have a domain and are unwilling to pay
for a top level domain, talk to the folks at dyndns.org about getting a
subdomain from them.

To do this (from vague memory, there may be a little more to it than
this)

1) set up a uucp link between your home gateway machine and your isp. 
There is a howto on this, so I won't go into detail. 

2) set up your domain's dns so that your isp is the mx for your domain.

3) have your isp configure their end so that all mail for your domain is
transferred via uucp to your machine.

4) Set up your home machine to send all mail outside your domain to your
isp (check out the postfix faq for details) via uucp.  This isn't
totally necessary if you have a fast link - I have a cablemodem and do
all my outgoing delivery myself.

5) Set up your ip-up script to add a call of 'uucico -S ispuucpname' to
force a connection to pick up your pending mail  send out your outgoing
queue.

6) add a cron job to do 'uucico -S ispuucpname' every hour or so to pick
up your mail

If you want to have incoming uucp over tcp and use a seperate password
file for uucp (recommended), put the password entries into
/etc/uucp/passwd and add

uucpstream  tcp nowait  root/usr/sbin/tcpd 
/usr/sbin/uucico -l

to your inetd.conf and then kill -HUP inetd

When I was using diald and ppp for a dialup connection, I had my ip-up
script touch /var/run/linkup and then had ip-down remove it.  Then I
could have cron jobs check to see if the link was already up before
doing anything.

The big advantage of having your mail come in over uucp is that it will
resume interrupted transfers where they left off, rather than making you
retransmit the whole message.  Very nice if you have timed local phone
service.

If your own isp won't do this, there are companies out there who will,
including the consulting firm I work with (http://www.communiweb.net).

jpb
-- 
Joe Block [EMAIL PROTECTED]
CREOL System Administrator

Social graces are the packet headers of everyday life.