Re: Reading mail from CLI with Mutt
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Saturday, August 12 at 10:51 AM, quoth Derek Martin:
>On Fri, Aug 11, 2006 at 01:39:24PM -0400, Kyle Wheeler wrote:
>> Well, heck, if you're going to recommend doing it that way (i.e. a
>> method that requires intimate knowledge of IMAP), tell him to use a
>> good shell (e.g. bash) that can let him do the TCP connections
>> directly:
>>
>> echo '? LIST "" "*"' > /dev/tcp/host/port
>
>$ echo '? LIST "" "*"' > /dev/tcp/localhost/143
>bash: /dev/tcp/localhost/143: No such file or directory
Heh, let me guess, you're on a Debian (or Debian-based) system. They
disabled bash's network abilities for some reason (something about
"shells should not be able to connect to the network"):
http://lists.debian.org/debian-user/2003/04/msg01636.html
It's been a part of bash since at least 2.05b, if not earlier.
>$ ls -l /dev/tcp
>ls: /dev/tcp: No such file or directory
That doesn't work even on a bash that has been compiled with
networking support. Those aren't *real* files.
>If this works anywhere, it's extremely non-portable.
<shrug> It works on any system whose package administrators haven't
disabled it. To my knowledge, that's pretty much everybody but Debian;
I could be wrong though.
Here's an amusing script that uses it:
#!/bin/bash
(
while read -u 5 line ; do
echo "$line"
done &
while true; do
read myline
echo "$myline" >&5
done
) 5<>/dev/tcp/$1/$2
~Kyle
- --
There can be but little liberty on earth while men worship a tyrant in
heaven.
-- Robert Green Ingersoll
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!
iD8DBQFE3gYmBkIOoMqOI14RAjOeAJ9ZsZrZ0Ro6LeHYY4AuFxxoVRBVpwCfbHEt
tpH5xfWsJAbl2rmSaPLabs8=
=aWd1
-----END PGP SIGNATURE-----