This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Running ssh from procmail


More information on this problem with ssh hostname resolution failing.

If my fetchmailrc has

    poll ...  mda "/usr/bin/procmail -d %T"

hostname resolution in the nested script fails with
+ /usr/bin/ssh -g -n -e none -v -R p1:localhost:p1-l me verklempt 'sleep
180'
OpenSSH_3.8.1p1, OpenSSL 0.9.7d 17 Mar 2004
debug1: Reading configuration data /etc/ssh_config
ssh: verklempt: no address associated with name

If I do

    poll ... mda "/usr/bin/procmail -p /home/me/.procmailrc"

(e.g. preserve environment) I get

+ /usr/bin/ssh -g -n -e none -v -R p1:localhost:p1-l me verklempt 'sleep
180'
OpenSSH_3.8.1p1, OpenSSL 0.9.7d 17 Mar 2004
debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to verklempt [<address omitted>] port 22.

Hurray! But I'm confused as to why.

The only think I can think of that would cause ssh to fail to resolve a host
named in /etc/hosts based on the environment would be if my PATH were
picking up a different ssh, but debug indicates they are the same...moreover
I named the binary explicitly as /usr/bin/ssh in the script. Any ideas what
environment var or user setting could be interferering with this? This used
to work as is.

Peter

----- Original Message ----- 
From: "Peter Wisnovsky" <peter@wisnovsky.net>
To: <cygwin@cygwin.com>
Sent: Friday, June 11, 2004 11:39 AM
Subject: Running ssh from procmail -#- MailID:KHFA


> I have a strange problem that I'm hoping someone can help me with. I've
> searched the archives and this may be related to some socket difficulties
> people have had on dual processor systems, but I dunno.
>
> I have a winxp dual xeon system in my office with an up-to-date cygwin
> installation as of today that cygchecks ok.
>
> I use a somewhat wierd mechanism to penetrate my office firewall from my
> home computer, since Mac OSX doesn't support the vpn server my company
uses
> (gack!). I run fetchmail/procmail to check mail at the office, and based
on
> a certain pattern it runs a script that runs ssh to my home system at a
> fixed IP doing port forwarding, and running sleep for a minute. I send
> myself mail, wait a little, then connect my remote desktop client to the
> forwarded port. Ssh is then configured to hang around until the connection
> dies.
>
> This had been working fine for a while. I hadn't used it for a bit, maybe
in
> a month or two, in the meantime upgrading cygwin a couple of times at the
> office. Now when I try I get various forms of wierdness.
>
> If I run ssh -l xyz verklempt (my home system, in /etc/hosts) it works
fine.
>
> If I start bash and run the "tohome.sh" script it connects fine.
>
> If I send myself the telltale email I get
>
>     ssh: verklempt: no address associated with name
>
> Odd, since it knows what "verklempt" is when run on the command line. OK,
I
> replace the address with the fixed IP in the script. I get:
>
>     socket: Operation not permitted
>     ssh: connect to host #.#.#.# port 22: Operation not permitted
>
> Fetchmailrc is (some names changed to protect the innocent)
>
> poll xyz.com protocol pop3 username abc keep mda "/usr/bin/procmail -d %T"
>
> Procmailrc is
>
> SHELL=/bin/sh
> PATH=/bin:/usr/bin:/pkg/mail/bin
> MAILDIR=$HOME/usr/mail
> DEFAULT=$MAILDIR/INBOX.spool
> LOGFILE=$MAILDIR/procmail.logfile
> VERBOSE=on
> LOGABSTRACT=all
> export PATH
>
> :0:
> * ^Subject: blahblahblah
> | /usr/bin/bash -x $HOME/tohome.sh
>
> ...
>
> tohome.sh contains
>
> (echo "${LOGNAME} : ${SHELL} : Open connection at `date` " ;
> /usr/bin/ssh -g -n -e none -R #:localhost:# -l abc $HOMEADDR "sleep 180" ;
> echo Connection closed at `date`) >> /tmp/openconnect.ssh 2>&1 &
>
> Any help someone can provide would be much appreciated...I'm not sure
where
> to start. I've looked at the procmail/fetchmail man pages concerning the
> process environment of forked processes but can't find anything to account
> for this. Moreover since it used to work I suspect its a bug that has been
> introduced not too long ago.
>
> Thanks,
>
> Peter
>
>
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:       http://cygwin.com/problems.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
>


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]