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]

Running ssh from procmail


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/


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