From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/31768 Path: main.gmane.org!not-for-mail From: Nuutti Kotivuori Newsgroups: gmane.emacs.gnus.general Subject: Re: Gnus Access mail spool by ssh Date: 13 Jul 2000 06:46:06 +0300 Organization: Gnus Information Center Sender: owner-ding@hpc.uh.edu Message-ID: <87em4yd75t.fsf@sonera.com> References: <87lmz7d93d.fsf@sonera.com> <87hf9vcsc6.fsf@sonera.com> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: main.gmane.org 1035168141 15963 80.91.224.250 (21 Oct 2002 02:42:21 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 02:42:21 +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 15E5BD051F for ; Wed, 12 Jul 2000 23:53:22 -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 WAC06939; Wed, 12 Jul 2000 22:49:44 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Wed, 12 Jul 2000 22:48:38 -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 WAA09008 for ; Wed, 12 Jul 2000 22:48:27 -0500 (CDT) Original-Received: from quimby.gnus.org (quimby.gnus.org [193.69.4.139]) by mailhost.sclp.com (Postfix) with ESMTP id 7D404D051F for ; Wed, 12 Jul 2000 23:48:59 -0400 (EDT) Original-Received: (from news@localhost) by quimby.gnus.org (8.9.3/8.9.3) id FAA11667 for ding@gnus.org; Wed, 12 Jul 2000 05:50:40 +0200 (CEST) Original-To: ding@gnus.org Original-Path: not-for-mail Original-Newsgroups: gnus.ding Original-Lines: 113 Original-NNTP-Posting-Host: kotivnu1-nb.ete.tele.fi Original-X-Trace: quimby.gnus.org 963373839 11223 131.177.214.96 (12 Jul 2000 03:50:39 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: 12 Jul 2000 03:50:39 GMT User-Agent: T-gnus/6.14.4 (based on Gnus v5.8.6) EMY/1.13.6 (Life is balance) FLIM/1.13.2 (Kasanui) APEL/10.2 MULE XEmacs/21.1 (patch 10) (Capitol Reef) (i386-debian-linux) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:31768 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:31768 "Harry" == Harry Putnam writes: > Sorry, I'm still confused here.... Your description stops right at the > punch line. > > Nuutti Kotivuori writes: > >> Local machine runs fetchmail, which runs ssh to connect to the remote >> machine and run imapd, which the fetchmail will access. . . . > > What does fetchmail do with it. Deliver to /var/mail/$USER or put it > on standard out of ssh command or what? Well as pointed out, fetchmail does as it's told. For the very best solutions, it likes to use a local SMTP server, if not, then MDA, if not then maybe BSMTP delivery or whatever. That has nothing to do with this setup, it's just fetchmail configuration. >> Local .fetchmailrc: >> >> poll mail.host.foo with proto IMAP and options no dns >> preauth ssh plugin /usr/home/xxx/bin/fetchmail-imap-wrapper > > OK .. I follow the .fetchmailrc recipe. > Is this wrapper necessary if ssh-agent is engaged? Err. Depending, see below. >> Local bin/fetchmail-imap-wrapper: >> >> #!/bin/sh >> exec ssh -i $HOME/.ssh/identity-imap -l xxx $1 /opt/net/etc/imapd > > You aim ssh at a specific id in ~/.ssh -- login as xxx.... what does > $1 do? First argument to what... ssh? --- imapd gets invoked and > passes new mail to fetchmail? Which then does what? $1 is the first argument passed to the script. And as the manual page of fetchmail says, it will pass the name of the server and the port of the server as arguments to the script. So $1 in that case expands to the name of the server. This is so if I have my .ssh/config including usernames for my hosts, I can use the same wrapper script for all connections. As for the imapd, it get's eof after fetchmail is finished and dies away - as the ssh connection shuts down. > I've tried this with the following scripts: > > .fetchmailrc: > poll reader.local.lan with proto IMAP and options no dns > preauth ssh plugin /home/reader/scripts/ssh-fetch.sh > > ssh-fetch.sh > #!/bin/sh > exec ssh reader@reader /usr/sbin/imapd > > I can't tell if its going to work because some other mess with my > FreeBSD install crops up to wreck it. > > $ fetchmail > /usr/libexec/ld-elf.so.1: Shared object "libssl.so.1" not found > > Fetchmail installed from FreeBSD install with no complaints. Well it looks ok. But it seems you are missing ssl support. It is not needed and if you compile fetchmail yourself, you shouldn't include ssl support unless you really need it. This can probably be fixed by installing libssl. This can be obtained from www.openssl.org, I do not know about FreeBSD installs. > This is starting to look like too much pain in the ass for such a > simple chore. Umm. I found this to be very easy to set up. Then again, I already had fetchmail installed and was using it. > Running just the shell script (ssh-fetch.sh) gives: > > bsd > scripts/ssh-fetch.sh > * PREAUTH reader.ptw.com IMAP4rev1 v12.264 server ready > > whoopee .... now what? Well this seems to be doing fine, your script works. If you type ctrl-d there, you'll see the connection close down cleanly. Or you can type 'a LIST "" %'. Or 'a SELECT INBOX'. Anyway that's just extra if you wanna see how the server works. > `man imapd' you say... Well the one I have is just one tiny cut above > useless, lacking descriptive information. www.imap.org has pointers to the IMAP4rev1 RFC that you should look for info on how IMAP works, not that you need it. > I think I like the straight forward approach laid out by Kai and Lars. > What are the chances on a local network that the `cat' command in the > mail-sources prescript will die an ugly death? I'm beginning to think > what ever risk, it is much less problem than sorting out a bunch of > complicated soft ware for this one task. > > Plus, it seems one could insert some kind of `trap' that would make it > safer. > > Especially since I have an overall backup of all incoming mail that > keeps the latest 1000 messages. Well, it would be awfully nice if mail-sources and nnimap supported using a command instead of a direct connection. -- Naked