#761141 alpine tries to rsh to localhost in order to use imap server on localhost, makes users sad

Package:
alpine
Source:
alpine
Description:
Text-based email client, friendly for novices but powerful
Submitter:
Joey Hess
Date:
2015-01-07 17:24:05 UTC
Severity:
normal
#761141#5
Date:
2014-09-11 02:39:04 UTC
From:
To:
A user reported that alpine had suddenly started saying things about
rsh to IMAP server, and prompting for a password but not accepting any
input... Rather than opening her inbox.

Investigation showed that alpine was running:

26465 pts/9    S+     0:00 /usr/bin/rsh localhost -l anna exec /etc/rimapd

alpine was configured to use imap for the inbox (due to lack of maildir
support):

inbox-path={localhost/novalidate-cert}inbox

Apparently apine defaults to trying to use rsh (really ssh) to connect
in this situation. If the server doesn't support ssh password logins,
the attempt fails and it goes on to try a regular imap connection, with
only some ssh connection overhead. However, if the server allows ssh
password logins, ssh prompts for a password. It's been many years since
I used real rsh, but I think it never involved a password prompt (why
should it, it had no security and bell bottoms were still in fashion),
so it's quite possible that the code in alpine that runs it does not
connect up the tty, or that pine and rsh are fighting over console
input.

In any case, this seems like a really stupid thing to do when the mail
client has been configured to use imap. Doubly so when the imap server
it's trying to log into is localhost, which would make this rsh a no-op
even if it somehow succeeded. Trebly so given that a /etc/rimapd command
has not existed on any Unix system since, appoximately, 1984. (Let alone
in Debian, which doesn't even contain a rimapd command!)

The workaround is this:

inbox-path={localhost/novalidate-cert/NoRsh}inbox

Rather than letting each user stumble over this long-forgotten land
mine, I recpectfully suggest that it be dealt with by making this rsh
nonsense be compiled out.

(Note: It's possible that this user has some setting in .pinerc that
enables this behavior. I didn't see anything that leapt out at me
though.)

#761141#10
Date:
2015-01-07 17:21:05 UTC
From:
To:
Dear Joey,

   I have just read your message, and I have a few comments. The fact that
the ssh command failed to work (and asked for a password) is likely an
indication of an error at the time of login in, this probably means that
there is an error in the ~/.bashrc file of the user using Alpine (or
equivalent.)

   If you want to disable completely ssh and rsh login to the server for
everyone, you can set the rsh-open-timeout and ssh-open-timeout variables
to zero in your global pine-conf file (the one that is supposed to be
located in /etc/.)

   Granted that rsh and ssh support are hacks, they are quite convenient;
they allow a user to connect to a local server (and be automatically
logged in!), and they are useful to people that want to use an imap server
to read folders in formats that Alpine does not support. It is still used,
although it is not necessarily used in the way it was designed to be used,
so it will probably stay there, as there are people that still depend on
it.

   By the way, you might receive a duplicate message. I am copying you and
sending it to the bug-tracker, since the latter has rejected my messages
in the past because of my signature, so just to make sure you get it, I am
copying you.

   I hope this message does not make you sad ;).