From owner-freebsd-questions Wed Jul 19 11:41:53 2000 Delivered-To: freebsd-questions@freebsd.org Received: from mail.networkone.net (mail.networkone.net [209.144.112.75]) by hub.freebsd.org (Postfix) with SMTP id D407F37BFDC for ; Wed, 19 Jul 2000 11:41:43 -0700 (PDT) (envelope-from reader@newsguy.com) Received: (qmail 3544 invoked from network); 19 Jul 2000 18:41:42 -0000 Received: from adsl-116-86.ln.networkone.net (HELO local.lan) (209.144.116.86) by mail.networkone.net with SMTP; 19 Jul 2000 18:41:42 -0000 Received: (from reader@localhost) by local.lan (8.9.3/8.9.3) id LAA01900; Wed, 19 Jul 2000 11:41:41 -0700 (PDT) (envelope-from reader) To: freebsd-questions@freebsd.org Subject: Fetchmail over ssh tunnel - eats Return-Path From: Harry Putnam Date: 19 Jul 2000 11:41:40 -0700 Message-ID: <87em4qklnf.fsf@satellite.local.lan> Lines: 62 User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.6 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 @ /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