On Tue, 24 Aug 1999, Scott Sharkey wrote:

> I've got a mail server on a private network (192.168.x.x) which
> I want to periodically pick up mail from my server that's 
> co-located elsewhere.  Both servers are running qmail.
> 
> The public server has MX records for my domain, pointing to
> it.  Mail to/from there seems to be working just fine.
> Right now, I'm just using a pop client to pick up the mail
> when I'm connected, but that's not a good solution.
> 
> I want the private server to periodically dialin, pick up
> the messages, send any that are queued (this is already
> working), and deliver via POP (also already working).
> 
> SO, do I switch the public server from handling the mail
> as a standard domain to a virtual domain?  How do I get
> the private server (which has a DYNAMIC IP address) to
> pickup the mail?
> 
> I've looked at both fetchmail and serialmail.  I think I
> understand how to do this with fetchmail, but I cannot
> make heads or tails of the serialmail "docs".  I would 
> LOVE to do this via ssh tunnelling if I can.
> 
> It seems that serialmail will only work if the dialin
> server has a static IP address (ie, there's no way to
> tell it to send to my dialup dynamic address?)

 I've done pretty much the same thing before (a while ago, so my
remembered details are a bit sketchy, unfortunately).  As long as you know
your dynamic IP address, you can use serialmail.

>From the dynamicIP'd box, I run a script periodically which runs the
command

ssh -C -c blowfish <public server> maildirsmtp <path to>/Maildir \
<domain in delivered-to-> <dynamic IP> `hostname`

 Where <public server> is the public server's hostname/IP
 <path to>/Maildir is the path to the Maildir which has the waiting mail
 <domain in delivered-to> is the domain part in the message's headers
like:
 delivered-to: [EMAIL PROTECTED]
 I have:
 onbenshaw-
 In the <domain in delivered-to-> place, (and it gets chopped off, so the
mail is delivered to [EMAIL PROTECTED] on the dynamic IP box
 --Yes, its a virtual domain on the public server
(in control/virtualdomains:
on.benshaw.com:onbenshaw
)
 The <dynamic IP> is the current dynamic IP of the dynIP'd box.
 and `hostname` is simply the hostname of the dynIP'd box.

 The script ssh's to the public server, and runs maildirsmtp, which goes
through the Maildir where all of the received mail is, and tells the
public server to push all that mail to <dynamic IP> via SMTP.

 The public server then connects to <dynamic IP>:SMTP and delivers the
mail.

 The traffic isn't encrypted by ssh, because it just goes through SMTP,
but its transparent to the box with the dynamic IP--its just incoming SMTP
traffic to it (after it triggers the send).

Hope this description helps in your setting-up of it.

.Shawn

Reply via email to