Subject: Q Addressbook

From: Jose Reynaldo Setti <[email-masked]>
Date: Fri, 21 Apr 1995 17:16:39 GMT

Is there a way to automatically transform elm aliases
files into pine addressbooks? Or even ucb mail alias files
into pine addressbooks?

Thanks in advance for any information,

---jrs.

---

From: [email-masked] (Edwin Kremer)
Date: 24 Apr 1995 12:09:17 GMT

In <[email-masked]> Jose Reynaldo Setti <[email-masked]> writes:

   | Is there a way to automatically transform elm aliases
   | files into pine addressbooks?

Well, I did this quicky one some time ago. It works for me and it has
been helpful to others. It's free. Don't make money of it :-)
You do need Perl, however.

		best regards,
						--[ Edwin ]--
--
Edwin H. Kremer, systems- and network administrator.   <[email-masked]>
Dept. of Computer Science,  Utrecht University, The Netherlands   [WHOIS: ehk3]
----------------------- http://www.cs.ruu.nl/~edwin ---------------------------

#!/bin/sh
# This is a shell archive (shar 3.32)
# made 10/07/1994 22:12 UTC by [email-masked]
#
# existing files WILL be overwritten
#
# This shar contains:
# length  mode       name
# ------ ---------- ------------------------------------------
#   3564 -rwxr-xr-x elm2pine
#
if touch 2>&1 | fgrep 'amc' > /dev/null
 then TOUCH=touch
 else TOUCH=true
fi
# ============= elm2pine ==============
echo "x - extracting elm2pine (Text)"
sed 's/^X//' << 'SHAR_EOF' > elm2pine &&
X#!/net/bin/perl
X#---------------------------------------------------------------------------
X#	elm2pine - convert Elm-2.4 aliases file to Pine 3.90 format
X#	(writes result to standard-output)
X#
X# 1.0	EHK 02-Sep-94	from scratch
X# 1.1	EHK 03-Sep-94	fix continuation-line parsing bug, resulting in
X#			duplicate partial distribution-lists. Actually, I
X#			got the documentation wrong at first glance, so this
X#			is more of a major rewrite than just a bug fix...
X#---------------------------------------------------------------------------
X
X$P		= 'elm2pine' ;
X
X$home		= $ENV{'HOME'} || die "Can't find your HOME directory: $!" ;
X$elm		= "$home/.elm/aliases.text" ;
X
Xopen(ELM, "< $elm") || die "You don't have Elm aliases in your ~/.elm directory: $!" ;
X
X#---------------------------------------------------------------------------
X# Pass 1 : read the entire alias file in core; do some minimal processing
X#---------------------------------------------------------------------------
Xprint STDERR "$P: Pass 1 -- reading aliases '$elm'...\n" ;
Xwhile ( <ELM> ) {
X	chop ;
X	next if ( /^$/ || /^#/ ) ;	# skip comment and blank lines
X
X	# delete blanks around the Elm aliases field-seperator '='
X	# and around the Elm-specials ',' and ';'
X	s/\s*([=,;])\s*/\1/g ;
X
X	# if we have leading blanks, this must be a continuation line
X	if ( /^[\t\s]/ ) {
X		# which we can only have if we've seen a nickname already
X		if ( ! defined($nickname) ) {
X			print STDERR "$P: ERROR: continuation line without prefix ignored: '$_' \n" ;
X			next ;
X		}
X
X		s/^\s+// ;			# get rid of the leading blanks
X		$alias{$nickname} .= "$_" ;
X		$clines++ ;
X	}
X	else {
X		if ( $clines ) {
X			print STDERR "$P:      [OK]  $clines continuation-line(s) joined.\n" ;
X			$clines = 0 ;
X		}
X		undef($nickname);
X		($nickname, $fullname, $address) = split(/=/) ;
X		$fullname = "*none-given*" if ( $fullname eq '' ) ;
X
X		# Elm has multiple-nicknames, so we have to duplicated
X		# them for Pine to maintain the same information
X		@nnames = split(/,/, $nickname) ;
X		if ( $#nnames > 0 ) {
X			$multi_aliases = $#nnames + 1 ;
X			print STDERR "$P:      [OK]  $multi_aliases multiple-aliases duplicated.\n" ;
X		}
X		foreach $nname ( @nnames ) {
X					$alias{$nname} = "$fullname#$address" ;
X				}
X	}
X}
Xclose(ELM) ;
X
X#---------------------------------------------------------------------------
X# Pass 2 : convert to Pine format. Add default Fcc-field, optional comment
X#	   and apply Pine semantics to Elm-special chars ';' and ','
X#---------------------------------------------------------------------------
Xprint STDERR "$P: Pass 2 -- converting Elm aliases to Pine format...\n" ;
X$aliasc = 0 ;
Xforeach $nickname (sort keys(%alias)) {
X	$_ = $alias{$nickname} ;
X	$aliasc++ ;
X
X	( $fullname, $addrlist ) = split(/\#/) ;
X
X	# anything after a ',' in the fullname is optional comment
X	if ( $fullname =~ /,/ ) {
X		$fullname =~ s/(.*),(.*)/\1/ ;
X		$comment = "$2" ;
X	}
X	else {
X		$comment = '' ;
X	}
X
X	# a ';' in the fullname for Elm, must be a ',' for Pine
X	$fullname =~ s/;/, / ;
X
X	# distribution-list aliases need brackets
X	$addrlist = "(" . "$addrlist" . ")" if ( $addrlist =~ /,/ ) ;
X
X	# output as Pine aliases now:
X	#	<nickname>TAB<fullname>TAB<address>TAB<fcc>TAB<comment>
X	# [Aaaaaaaaaarrrrggggggggggggghhhhhh.... why the !&^@#$^$% `TAB' :--(
X
X	$, = "\t" ;
X	print $nickname, $fullname, $addrlist ;
X
X	# if we have a comment-field, we will put in a Fcc-field as well
X	print "\t$nickname\t$comment" if ($comment ne '') ;
X	print "\n" ;
X}
X
Xprint STDERR "$P:      [OK]  successfully converted $aliasc aliases.\n" ;
X
Xexit 0 ;
X
X__END__
SHAR_EOF
$TOUCH -am 0903221994 elm2pine &&
chmod 0755 elm2pine ||
echo "restore of elm2pine failed"
set `wc -c elm2pine`;Wc_c=$1
if test "$Wc_c" != "3564"; then
	echo original size 3564, current size $Wc_c
fi
exit 0

---

From: Aladdin Khamis <[email-masked]>
Date: Tue, 25 Apr 1995 09:01:52 +0000 (GMT)

Does any of you know anything about Ispell working under DG/UX systems ? 
or maybe any other speller that is much better than the UNIX speller, 
something that can give suggestions for spelling mistakes.

>--|\/\/\/|------------------------------------
>| |      | | E-mail: [email-masked]  |  Aladdin Khamis 
>| | ([5mo[0m)(o) '--/ /-----------------------------
>| C      _)  //             |	Information Systems Department
>|  | ,___|  /               |		Galtronics Ltd.
>---|   /--------------------	P.O.Box 1589   Tiberias  14115