Skip site navigation (1)Skip section navigation (2)
Date:      19 Jul 2000 11:41:40 -0700
From:      Harry Putnam <reader@newsguy.com>
To:        freebsd-questions@freebsd.org
Subject:   Fetchmail over ssh tunnel - eats Return-Path
Message-ID:  <87em4qklnf.fsf@satellite.local.lan>

next in thread | raw e-mail | index | archive | help

Running FreeBSD-4.0 snap 6/24

Fetching mail to a laptop running FreeBSD from a parent machine (on
local ethernet).  What I'm doing here is fetching all the same mail to
both machines.  The parent (linux box) fetches from the internet from
a pop server using fetchmail-5.3.1

I wasn't sure of the best way to duplicate that mail and send copies
to the laptop as well.  It has no `real' IP.  But is accessing the
internet through the parent via IP masquerade.

What I've done is use procmail to send a copy of everything to a user
account on the parent machine.  The laptop then accesses the mailspool
of that user account by way of fetchmail through a ssh tunnel.

This is done by having ssh start an IMAP server on the parent when the
connection is made.  That IMAP server dies once the fetch is complete.

The laptop is running the fetchmail port fetchmail-5.4.1 and using a
.fetchmailrc like this:

         poll xxx.xxx.xxx with proto IMAP and options no dns
         preauth ssh plugin /home/reader/scripts/ssh-fetch.sh

Where ssh-fetch.sh is a tiny script:

        #!/bin/sh
        exec ssh <USER>@<REMHOST> /usr/sbin/imapd

It starts imapd and then fetchmail connects to that and fetches
everything in user `laptop's mail spool.

This is all working fine (although the fetching is very slow
..approximately one message per second) But the fetchmail on the
laptop is eating the Return-Path headers.  Those headers are plainly
visible when the mail is in /var/spool/mail/$USER on the parent, but
when it arrives at the laptop the `Return-Path' header is missing.

This broke many of my filters and required major rewrite of filtering.
All under control now, but why are the Return-Path headers being removed?

A further problem is that this process is invoking some kind of dns
lookups so If I try to run the fetch when the parent is offline, it
breaks for lack of a nameserver.

I've m4 'ed several different sendmail.cf files containing things like
`nodns' and `nocononify' plus the fetchmailrc also specifies `no dns'
but still the lookups are being called. 

The laptop's sendmail is setup to relay through my ISPs mail machine so
that sending from the laptop will work.  Also masquerades the envelope
as  the newsguy.com domain so that my `From' line works.

Should the laptop's sendmail.cf be set to relay through the parent
machine's sendmail instead? Would that involve complicated setting on
the parent so far as allowing the relay?  Would that stop the dns
lookups.

I want to be able to run fetchmail between laptop and parent with no
dns or mx lookups involved, so that it can be done when the parent is
offline.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?87em4qklnf.fsf>