From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/31705 Path: main.gmane.org!not-for-mail From: Harry Putnam Newsgroups: gmane.emacs.gnus.general Subject: Re: Gnus Access mail spool by ssh Date: 09 Jul 2000 21:56:55 -0700 Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035168084 15593 80.91.224.250 (21 Oct 2002 02:41:24 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 02:41:24 +0000 (UTC) Return-Path: Original-Received: from fisher.math.uh.edu (fisher.math.uh.edu [129.7.128.35]) by mailhost.sclp.com (Postfix) with ESMTP id C4A7CD051E for ; Mon, 10 Jul 2000 01:01:49 -0400 (EDT) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by fisher.math.uh.edu (8.9.1/8.9.1) with ESMTP id XAC25446; Sun, 9 Jul 2000 23:58:07 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sun, 09 Jul 2000 23:56:49 -0500 (CDT) Original-Received: from mailhost.sclp.com (postfix@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id XAA28925 for ; Sun, 9 Jul 2000 23:56:39 -0500 (CDT) Original-Received: from mail.networkone.net (mail.networkone.net [209.144.112.75]) by mailhost.sclp.com (Postfix) with SMTP id E579DD051E for ; Mon, 10 Jul 2000 00:57:10 -0400 (EDT) Original-Received: (qmail 26427 invoked from network); 10 Jul 2000 04:57:09 -0000 Original-Received: from adsl-117-113.ln.networkone.net (HELO reader.ptw.com) (209.144.117.113) by mail.networkone.net with SMTP; 10 Jul 2000 04:57:09 -0000 Original-Received: (from reader@localhost) by reader.ptw.com (8.9.3/8.9.3) id VAA10728; Sun, 9 Jul 2000 21:57:07 -0700 Original-To: ding@gnus.org In-Reply-To: Alan Shutko's message of "08 Jul 2000 22:03:57 -0400" User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.5 Original-Lines: 77 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:31705 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:31705 Alan Shutko writes: > Harry Putnam writes: > > > Now I want to have a laptop running FreeBSD 4.0 networked to desktop > > running Redhat linux, be able to view/manipulate mail on the parent machine > > but don't want to setup pop, imap or special sendmail stuff. I > > don't want more daemons running that can be exploited from the internet. > > And haven't really looked into firewall technique. [...] > > If you don't want to do that... well, you could use the ssh to set up > a ppp tunnel between your computers, and run NFS, imap, or whatever > over that. In some cases, that makes sense (ie, laptop halfway across > the continent, over very untrusted ethernet). But not in a home > network. Unless you have a very untrusted home network (ie, both > machines are just connected via a hub to a cable modem) it's much more > convenient to set up some firewall rules on the host connected to the > internet, and trust the internal network. ssh was _not_ designed to > be a mail protocol, and as Kai pointed out, locking issues will be a > bitch. I think Kai hit it right with a few modifications. I guess I was over complicating a bit. Here is what I've come up with: procmail copies all mail to $desktop_spool and a second spool file on $DESKTOP called $HOME/spool/backup/lap.sp Now using Kias formula: ssh $desktop $movemail $mailfile $desk_home/TMPFILE But with the modification that $mailfile is $lap.sp (a copy of incoming). So movemail moves $lap.sp to lap.tmp and when gnus slurps it up through the ssh tunnel The only monkey wrench here was that I couldn't find `movemail' Its nowhere in my path, which is very extensive. A grep of /usr/local/pgnus/lisp/*.el finds many mentions of `movemail' but none seem to show its address. Checking emacs info , a few hits but no address. Finally the trusty gnus manual pages tipped it off and in the mail sources dialog there is a nice line giving the address. So a short script will do it all I think, except I suspect there could be trouble about deleting the spool if procmail happens to be writing to it right then. The cool thing is someone already wrote almost the exact script in gnus info at Mail Source Specifiers. (setq mail-sources '((file :prescript "ssh reader@reader ~/scripts/getmail >%t "))) What does the specifier "t" do here? Does just mean to the default? Lifted almost bodily from gnus info.... I love it when there are good examples like this! I only had to add an `if/then' clause for a little protection. Since movemail doesn't delete the spool but leaves an empty file. getmail.sh script #!/bin/sh MOVEMAIL=/usr/lib/emacs/20.5/i386-redhat-linux-gnu/movemail TMP=/home/reader/spool/backup/lap.tmp MAIL=/home/reader/spool/backup/lap.sp if [ -s $MAIL ];then rm -f $TMP;$MOVEMAIL $MAIL $TMP >/dev/null && cat $TMP fi