[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: potential internet access loss =<



Joseph Carter <knghtbrd@earthlink.net> wrote:

> On Mon, Sep 21, 1998 at 10:19:40AM -0400, Tim Sailer wrote:
> > I can set you up with a temporary account on buoy.com until you get settled.
> > Send me email there (address in sig).
> 
> Thanks Tim, I've been trying to pull some crazed solution about ssh tunnels
> and user level pop servers out of my head with helpful suggestions from
> #debian, lots of ideas but none of them as efficient as just sending the
> mail to a machine with a pop server.  =>

Here's a 'SCP-POP' script I wrote a couple of weeks ago, if anyone care... :)

----- s n i p -----
#!/bin/sh

USER="turbo"
MAIL="/var/spool/mail/turbo"
SERV="master.debian.org"

case "$1" in
    -f)
	# Check who we got mail from, on the server...
	ssh -x $SERV "from"
	;;

    -c)
	# Check if we have mail or not...
	DONE=`finger $USER@$SERV | grep -e 'New mail' -e 'Mail last'`
	if [ "$DONE" != "" ]
	then
	    echo "You got mail..."
	else
	    echo "No mail..."
	fi
	;;

    *)
#	DONE=`finger $USER@$SERV | grep -e 'New mail' -e 'Mail last'`
#	if [ "$DONE" != "" ]
#	then
	    echo -n "Packing mail..."
	    ssh -x $SERV "rm ~/inbox*; /usr/bin/lockfile -ml $MAIL"
	    ssh -x $SERV "cat $MAIL > ~/inbox; echo -n > $MAIL ''"
	    ssh -x $SERV "/usr/bin/lockfile -mu $MAIL; gzip ~/inbox" 2>/dev/null
	    echo "done."

	    echo -n "Transfering mail..."
	    scp $SERV:~/inbox.gz ~/inbox.gz
	    echo "done."

	    echo -n "Adding mail to mailbox..."
	    zcat ~/inbox.gz >> ~/Mailbox
	    rm ~/inbox.gz
	    echo "done."
#	else
#	    echo "No mail..."
#	fi
	;;
esac
    
exit 0
----- s n i p -----

-- 
-- Microsoft: Do less with more.   UNIX on Intel: Do more with less. --
 Turbo     __ _     Debian GNU     Unix _IS_ user friendly - it's just 
 ^^^^^    / /(_)_ __  _   ___  __  selective about who its friends are 
         / / | | '_ \| | | \ \/ /          Live long and prosper
  _ /// / /__| | | | | |_| |>  <  Turbo Fredriksson    turbo@tripnet.se
  \\\/  \____/_|_| |_|\__,_/_/\_\ Surrey/B.C./Canada      (604)572-3523
Debian Certified Linux Developer  PGP#788CD1A9   www5.tripnet.se/~turbo
------- PGP:  B7 92 93 0E 06 94 D6 22  98 1F 0B 5B FE 33 A1 0B --------

-- 
Noriega Qaddafi Uzi Waco, Texas jihad ammunition counter-intelligence
security quiche South Africa fissionable radar Honduras Nazi plutonium

Attachment: pgppkFlHkDV82.pgp
Description: PGP signature


Reply to: