Address Book Contents

This help file contains a list of all Help topics available for the Address Book.  You can use the scroll bar to see the entries that are not currently visible in the Help window.  For information on how to use Help, press F1 or choose How to Use Help from the Help menu.

Overview	How to Use	Troubleshooting

Menus

Address Book

Edit

Settings


Address Book

Open...

Add New Book...

Delete

Properties...

Copy To...

Update Remote

Setting Up Open Directory Service


Edit

Add Name

Add Group

Members...

Delete Name


Settings Address Book
Settings

ECCO Setup...


Overview

The Address Book allows you to create and save email addresses that you wish to use more than once, so that you do not have to repeatedly type the addresses each time you send email.  After you have specified an email address in an Address Book, you can select it from the book instead.

You can access the Address Books through Z-Mail Pro, Phone Tag, Forum, NEWTCal, InPerson, and Tag-It!.  E-mail addresses from your ECCO phonebook can also be added into one or more of your Mail Address Books.

The Address Book provides a number of useful features:

•	Create new address books

•	Add individuals to your list

•	Create new groups or distribution lists

•	Add members to new or existing groups

Note:	Forum automatically creates an address book for each of its news server profiles. These address books contain the addresses of the subscribed news groups on each of the servers.

You can access the Address Book by choosing the Address Book menu command or the Address button.

Z-Mail Pro: Choose the Address Book... command from the Services menu, or choose the Address... button located on the new message/article window. The new message/article window appears when you choose the Create..., Reply to or Forward… commands from the Message menu

Forum: Choose the Address Book... command from the Services menu, or choose the Address... button located on the new message/article window. The new message/article window appears when you choose the Post…, Reply to or Forward… commands from the Article menu.

PhoneTag: Choose the Address command from the Control menu, or by choose the Address... button located on the new message/article window.

Tag-It!: Choose the Address command from the Control menu, or by choose the Address... button located on the new message/article window.

NewtCal: Choose the Appointments command from the Edit menu, and select the Attendees button.

Note:	When the Address book is accessed from the Service menu, a number of the menu items are also available as buttons.

See Also

Accessing the Address Book

Adding Groups to an Address Book

Adding Individuals to an Address Book

Addressing Your Mail Message

Copying Names Between Address Books

Creating Additional Address Books

Deleting Existing Address Books

ECCO Setup Option

Viewing Address Book Properties


How to Use
How to Use the Address Book

Accessing the Address Book

Adding Groups to an Address Book

Adding Individuals to an Address Book

Addressing Your Mail Message

Copying Names Between Address Books

Creating Additional Address Books

Deleting Existing Address Books

ECCO Setup Option

Using Remote Address Books.

Viewing Address Book Properties

Setting up Open Directory Service


Addressing Your Mail Message

You can address your mail message using your Address Book entries by doing the following:

1.	Choose the Address Book... button from the Z-Mail Pro/Forum new message/article window.  The Address Book dialog box appears.

2.	Double click on the address book in the left window containing the addresses you require.

3.	Select each email address you want to add as a recipient:

•	Local address book:  Choose the address you require

•	Remote address book: Enter the search pattern or name and choose Search.  The results of the search are displayed, choose the name you require. See Using Remote Address Books.

4.	Choose the To (primary recipient), and if desired, the Cc (carbon copy), or Bcc (blind carbon copy) buttons.

5.	Choose the Close button to return to the Mail new message/article window.

Note:	With a remote address book (in search mode), when the book is opened, no addresses are displayed. You must enter a search pattern and choose the search button, to display addressees.  To display all addresses enter *.*.


Open
Open...

Open allows you to open an existing Address Book.  To do this:

1.	Open Address Book from either the Services menu or the Z-Mail Pro/Forum new message/article window.

2.	Select the Address Book you want to open

3.	Choose the Open... command from the Address Book menu or

•	double-click on the desired Address Book or

•	press enter


Add New Book
Add New Book...

You can create a new Address Book, add additional Address Books that are stored locally, access an existing Address Book that resides on a remote host or access an ECCO E-Mail list in an ECCO file.

To create a new or add another Address Book:

1.	Open the Address Book from either the Services menu or the Z-Mail Pro/Forum new message/article window.

2.	Choose the Add Address Book... command from the Address Book menu.  The Add Address Book dialog box appears.

3.	Enter the following information:

Local or Remote	Select the location of your address book.
Name	Enter the name, up to 15 characters, you want to give to the new Address Book, this will appear in the Address book list.
File(local)	Enter the Address Book's path and filename.  You can enter the pathname directly or use the Browse button to browse for the selected drive and directory.  For a new address book, you will be prompted to confirm you want to create a new file.  This is only applicable for local address books. For an ECCO addressbook: choose the browse button, the Open dialog appears.  Change the file type in the drop down list to *.eco. Select the file from the list of all available ECCO files or leave the file name blank.  Refer to ECCO Setup for more details. Note: You cannot create a new .eco files from within address book, the .eco file you specified must already exist.
Host (remote)	Enter the name or IP address of the host in the Host text box.  This is where the Address Book you want to access remotely is stored.  See Using Remote Address Books.
Protocol	Whois++ - For address books created to support Whois++ Z-Mail ODS  - For address books created using Z-Mail Pro.  See Setting Up Open Directory Service
Port	Default Port for Whois++ is 43 Default Port for Z-Mail ODS is 15213
Advanced	The Advance button sets additional options for remote address books.
Delimiter	A delimiter is used as a marker between the email address and freeform information (that is additional information, such as telephone numbers, address etc., entered by the system administrator). A space, by default is read as the delimiter.  Enter here any other characters that are used as a delimiter, such as underscore, tab etc.
Search for Addresses	Addresses are searched for on the remote host, where the address book is located.  These addresses are not cached locally.
Download All Addresses	Default. The Address book is downloaded to the local drive.  A temporary file is created on your local drive which is automatically deleted when the address book is deleted. To update this address book choose Update Remote form the Address menu.
4.	Choose the OK button.

Note:	Address Book changes the default settings to the last parameters you defined when setting up an Address Book.


Using the Remote Address book
Using the Remote Address Books

A remote Address book is created with the Add New Book command and modified with the Properties command.

You can open the remote Address Book by double clicking on its name in the listbox.   There are two types of Remote Address books, depending on the setting selected in the Properties dialog box:

Search for Addresses

Addresses are searched for on the remote host, where the address book is located.  These addresses are not cached locally.  When this type of remote address book is opened the addresses are not displayed automatically. You must enter a name or search pattern and choose the search button, to display addresses.  To display all addresses enter *.*.

Download All Addresses

The Address book is downloaded to the local drive.  The first time you open the book, the application connects to Directory Server, downloads all the addresses, and displays them in the listbox. These addresses are cached in a local file so you can open the Address Book repeatedly without having to go through the network. If you want to update the Address Book contents from the network, choose the Update Remote command from the Address Book menu. This file is automatically deleted when the address book is deleted.

These type of remote address book is used in the same way as a local address book.  All addresses are displayed.


Delete

Lets you delete existing Address Books.  To do this:

1.	Open the Address Book from the Services menu or the Mail new message/article window.

2.	Select the book(s) you want to delete and choose the Delete command from the Address Book menu.

3.	Select the book(s) you want to delete and choose the Delete command from the Address Book menu.

4.	A dialog box prompts you to confirm you want to delete the name from the address Book list.

5.	With local address books a second dialog prompts you to decide if you want to delete the local file (.adb) from the hard drive. If an .adb file is deleted the information is removed permanently.


properties
Properties...

Lets you view and modify the properties of a an existing Address Book.  You can also modify the name of an Address Book and the file name (pathname).  To do this:

1.	Open the Address Book from the Services menu or the Mail new message/article window.

2.	Select the desired Address Book and then choose the Properties... command from the Address Book menu.

3.	A Properties dialog box appears that lists:

Local or Remote	The location of your address book.
Name	Enter the name you want to give to the new Address Book.  This will appear in the Address book list.
File(local)	The Address Book's path and filename.  You can enter the pathname directly or use the Browse button to browse for the selected drive and directory.  For a new address book, you will be prompted to confirm you want to create a new file.  This is only applicable for local address books. For an ECCO addressbook: choose the browse button, the Open dialog appears.  Change the file type in the drop down list to *.eco. Select the file from the list of all available ECCO files or type in a new file name.  Refer to ECCO Setup for more details. You cannot create a new .eco files from within address book, the .eco file you specified must already exist.
Host (remote)	The name of the host where the Address Book you want to access remotely is stored.
Protocol	Whois++ - For address books created to support Whois++ Z-Mail ODS  - For address books created using Z-Mail Pro.  See Setting Up Open Directory Service
Port	Default Port for Whois++ is 43 Default Port for Z-Mail ODS is 15213
Advanced	The Advance button shows additional options for remote address books.
Delimiter	A delimiter is used as a marker between the email address and freeform information (that is additional information, such as telephone numbers, address etc., entered by the system administrator).Any other characters that are used as a delimiter are entered here.
Search for Addresses	Addresses are searched for on the remote host, where the address book is located.  These addresses are not cached locally.
Download All Addresses	The Address book is downloaded to the local drive.  To update this address book choose Update Remote form the Address menu.
4.	Modify as required.


Copy To
Copy To...

Lets you copy one or more individual or group names from one Address Book to another.  To do this:

1.	Open the Address Book from the Services menu or the Mail new message/article window.

2.	Open the Address Book you want to copy from.

3.	Highlight the name(s) of individuals or groups you want to copy.

4.	Choose the Copy To... command from the Address Book menu to display the Copy Address To dialog box.

5.	Select the Address Book you want  the names and addresses copied into and choose the OK button.


Update Remote

Remotely stored Address Books can be cached in a local file (set through Properties) so you can repeatedly open the Address Book without having to go through the network.  If you want to update the Address Book contents from the network, choose the Update Remote command from the Address Book menu.


Add Name

Allows you add an individual or group to an Address Book.

To add an individual to an Address Book:

1.	Open the Address Book from the Services menu or the Z-Mail Pro/Forum new message/article window.

2.	Open the appropriate address book.

3.	Enter the user's name and e-mail address in the Search pattern or new name text box.  For example,

John Doe <john@netmanage.com.>

555-111@mcimail.com

71234.1234@compuserve.com

john@[156.27.10.107]

4.	Or enter the news group address in the Search pattern or new name text box.  For example,

<@news:rec.games.chess@news.netmanage.com>

You may also specify a news group address, without specifying a server name (the default server defined in Forum will automatically be used) in which case it should look as following:

<@news:rec.games.chess>

5.	Choose the Add Name command from the Edit menu, or the Add Name button  The name appears on the list and is automatically added to the Address Book.


Add Group

To add a group to the Address Book, do the following:

1.	Open the Address Book from the Services menu or the Z-Mail Pro/Forum new message/article window.

2.	Open the appropriate address book.

3.	Type the group name in the Search pattern or new name text box.

4.	Choose the Add Group command from the Edit menu, or the Add Group button.

5.	The Address list text box appears for you to add members to this group.  Enter or select the name and email address of the member you want to include in this group.  The right side pull down menu lists the different transports available, and the bottom text box lists the addresses available.  Select any address you require and choose the Add button, or double click on the name.

The selected names appear in the Group Members list.  All group names appear in the Address Book dialog box in square brackets.  For example, [groupname].

6.	Choose the OK button.

Select an individual name and choose the Members... command from the Edit menu to see if they belong to a group.

You may rename entries by selecting them and pressing the Rename button.  Select one or more entries and press the Delete button to remove them from the Address Book.  Addresses are automatically saved when you enter them.


Members
Members...

Lets you see:

•	All members who are assigned to a group, for example

Group [salesteam] has members mark@somewhere.com,  Bill@somewhere.com and Kenley@somewhere.else.com

•	All groups an email address is a member of, for example

Mark@somewhere.com is a member of [sales], [finance] and [swimteam]

To do this:

1.	Open the Address Book from the Services menu or the new message/article window.

2.	Open the desired Address Book.

3.	Select the group whose members you want to see or the email address whose group memebership you want to see.

4.	Choose the Members... command from the Edit menu.  A dialog box appears displaying the group name and its members or the email address and group names which the address is a member of.


Delete Name

Lets you delete an individual or group name from an Address Book.

To do this:

1.	Open the Address Book from the Services menu or the Mail new message/article window.

2.	Select the name(s) you want to delete.

3.	Choose the Delete Name command from the Edit menu.


ECCO Setup

The ECCO Setup option in the Address Book dialog is provided for the convenience of ECCO users.  If you have the ECCO software package on your system, you can add e-mail addresses from your ECCO phonebook into one of your Mail address books. You can choose to add all the e-mail addresses from your ECCO phonebook or only a selected set of addresses.  Do the following:

1.	Open the Address Book from the Services menu or the Z-Mail Pro/Forum new message/article window.

2.	Choose the Add New Book... command from the Address Book menu.

3.	Enter the following information:

Local or Remote	The location of your address book.
Name	Enter the name you want to give to the new Address Book, this will appear in the Address book list.
File(local)	Enter the Address Book's path and filename.  You can enter the pathname directly or choose the browse button, the Open dialog appears.  Change the file type in the drop down list to *.eco. Select the file from the list of all available ECCO files or type in a new file name. You cannot create a new .eco files from within address book, the .eco file you specified must already exist.
1.	Choose the ECCO Setup...command from the Settings menu.  The ECCO Setup dialog box is displayed.

2.	Enter the column name from your ECCO Address Book that contains e-mail addresses into the Field Name text box in the ECCO Setup dialog box.  The default is E-Mail, but the name should be the same, or blank.

Note:  	In releases prior to ECCO 3.0, the column name for e-mail addresses was an optional, user-specified field name in the ECCO phonebook.  Therefore, the name you enter in the Field Name text box depends on what you named the column in your ECCO phonebook.  For example, if the ECCO phonebook column name was “E-Mail”, enter “E-Mail” in the Field Name text box.

3.	In the Criteria drop-down list box, select All to add all the e-mail addresses from your ECCO Address Book to the Mail Address book. Or, scroll to select an alpha character to add only the addresses beginning with that character.

For example, if you want to include only e-mail addresses beginning with the letter B, select the letter B from the list.

Note:	To keep your Z-Mail Pro address book current, you must refresh your Z-Mail Pro address book copied from ECCO each time you update the ECCO address file.


Troubleshooting Address Book
Troubleshooting

If you experience difficulties using the Address book, refer to the following items:

Remote Address book:

•	If the remote Address book does not open verify that the correct protocol (Whois++ or Z-Mail ODS) and port are selected.

•	Make sure that the host name where the remote addressbook resides is correctly entered, and that you have access permissions.

•	If a dialog reports a failure to retrieve the remote address book, verify the directory server on the remote host is running.

•	If no names appear in the address list, enter a name into the  Search pattern text box, and choose the search button.

Note:  	If the option   “Search for Address” is selected, addresses in Remote address books are not displayed automatically. In this case, a  search string must be entered.  To change this option to “Download all Addresses”, choose Properties from the Address menu, and choose the Advance button.

•	If Additional information appears after the email address, enter the correct Delimiter In the Properties dialog ( advanced button) form the Address book menu.

ECCO Addressbooks:

•	If your ECCO addressbook does not initialize the ECCO program, choose Properties from the Address menu,  select the file and choose the brows button.  Ensure that the File type selected is *.ECO ( not *.ADB).  Select the ECCO Setup command from the Settings menu, and enter the appropriate information.  Refer to ECCO Setup for more detailed information.


Installing and Configuring the Z-Mail Pro Open Directory Service

Z-Mail Pro users have the option of using a remote centralized directory service. This directory service is a file of searchable email addresses (and other information) accessible only when connected to the network. Users can cache frequently used addresses by copying search results from the centralized address book to a local address book (using the address book’s Copy To… menu item).

Features of ODS

Installing an ODS Server

Configuring Your Directory Server Host

Configuring Z-Mail Pro's Address Book

Testing the directory service

Compose a message using the directory service

Advanced Settings for ODS

Samples


Features of ODS

A centralized address book allows you to:

•	Easily - keep the address book up-to-date by eliminating the need to modify numerous copies.

•	Save disk space on each user’s PC; large address books reside on a server.

•	Control contents; the  “read only” attribute allows only an administrator with server access to perform modifications.

•	Include additional information associated with each email address, such as phone number, office location, department and employee number. Users can then use this directory service as a telephone book and other services.


Installing an ODS Server

The following topics briefly describes the installation and use of directory services for Z-Mail Pro. A basic knowledge of UNIX networking and shell scripts is required.  Z-Mail Pro provides access to a directory service, not the directory service itself.  When a user requests a directory lookup, Z-Mail passes the request to a Directory Service (DS) residing on a UNIX (or other) machine.  Since the Directory Service is separate from Z-Mail Pro, you may use any directory lookup mechanism to validate or suggest e-mail addresses.

Configuring Your Directory Server Host

Testing Directory Services

Uninstalling Directory Services

At the end of this appendix are sample UNIX shell scripts that perform simple directory lookups. Also provided is a sample DS listener shell script that is launched by INETD when a DS request arrives on the UNIX host.

See Also

Configuring Z-Mail Pro's Address Book

Advanced Settings for ODS


Configuring Your Directory Server Host

You must have root (superuser) privileges to install directory services.  Complete the following steps:

1.	Choose one of the lookup.* scripts (or a script of your own) and copy it to your UNIX host. Usually, these scripts are kept in /usr/local/lib, but this location may vary according your host’s configuration.

2.	Put the DS listener script dirserv.d in /usr/local/etc, or in the directory where scripts are stored on your system.

3.	Edit the dirserv.d script to call the lookup script you have chosen (or pass it the name of the lookup script as it’s first argument by configuring INETD.conf properly. See step 4 below and  the Sample Lookup Request Dispatcher for details.)

4.	Add the following line to your /usr/etc/INETD.conf file; this starts the DS listener dirserv.d when a request arrives:

zmailds stream tcp nowait guest /usr/local/etc/dirserv.d

Note:  	You may want to add command line arguments to dirserv.d (including arg0, the full path of dirserv.d) in order to specify the lookup program from INETD.conf instead of hardcoding it in dirserv.d.

5.	Replace guest in the above line with a user name on your system that has the correct privileges to run dirserv.d, but no additional privileges. The guest user exists on many UNIX systems.

6.	Replace the path to dirserv.d in the above entry with the path to dirserv.d on your system.

7.	Add the following line to your /etc/services (or equivalent) file:

zmailds 15213/tcp zmaildsd # Z-Mail Address Lookup Service

8.	You can replace 15213 in the above entry with another port.  15213 is the Z-Mail Pro default and is unlikely to conflict with existing services at your site.

9.	Send a HUP signal to INETD to cause it to re-read INETD.conf (you may have to do this twice on some systems). To send a HUP signal, find the process-id of INETD and enter:

kill -HUP process-id

Directory services are now installed on your UNIX host.

See Also

Installing an ODS Server

Testing Directory Services

Uninstalling Directory Services

Configuring Z-Mail Pro's Address Book

Advanced Settings for ODS


Testing Directory Services

To test your directory services, use Telnet to connect to the port you specified in /etc/services on the UNIX host and query the server. For example:

1.	To Connect to the host enter:

telnet ds-host 15213

The response should be similar to the following:

Trying 192.0.1.1... Connected to ds-host. Escape character is '^]'.

If telnet displays the error message:

telnet: Unable to connect to remote host: Connection refused

recheck the parameters you entered in /etc/INETD.conf and /etc/services, and ensure you are connecting to the correct host and port. You may need to send another HUP signal to INETD.

2.	Query the server by entering an integer followed by the pattern to match (a regular expression).

For example, to search for no more than 10 matches for all addresses containing “bob” enter:

10 bob

The server response should be similar to the following:

bob@baker.com

bob@butcher.com

betty@bobbin.org

Connection closed by foreign host.

Once directory services are correctly installed, you must configure Z-Mail Pro to query the Directory Service host.

See Also

Installing an ODS Server

Configuring Your Directory Server Host

Uninstalling Directory Services

Configuring Z-Mail Pro's Address Book

Advanced Settings for ODS


Uninstalling Directory Services

To uninstall Directory Services from the UNIX host, complete the following steps:

1.	Delete (or comment out) the line in /usr/etc/INETD.conf that begins with zmailds. The line should look like the following:

zmailds stream tcp nowait guest /usr/local/etc/dirserv.d

2.	Delete (or comment out) the line in /etc/services that begins with zmailds. The line should look like the following:

zmailds 15213/tcp zmaildsd # Z-Mail Address Lookup Service

3.	Send a HUP signal to INETD. To send a HUP signal, find the process-id of INETD and enter:

kill -HUP process-id

Directory services are now uninstalled. It is not necessary to remove dirserv.d or the lookup script(s).

See Also

Installing an ODS Server

Configuring Your Directory Server Host

Testing Directory Services

Configuring Z-Mail Pro's Address Book

Advanced Settings for ODS


Configuring Z-Mail Pro's Address Book

After a directory service has been Installed, Configured and Tested you need to configure Z-Mail Pro.  First make a new address book, then test and use this address book.

Making a new address book

Testing the directory service

Compose a message using the directory service

See Also

Installing an ODS Server

Configuring Your Directory Server Host

Testing Directory Services

Advanced Settings for ODS

Samples for ODS


Making a new address book for ODS

 To make a new Address book complete the following steps:

1.	Start Z-Mail Pro

2.	From the Services menu, choose the Address Book… command.

3.	From the Address Book menu, choose the Add New Book… command.

4.	Select the Remote radio button.

5.	Enter a name for your centralized address book (e.g. Corporate).

6.	Enter the IP address or host name of the ODS server.

7.	Choose Z-Mail ODS as the protocol.

8.	Click on the Advanced button and choose the Search for Addresses button.

9.	If necessary (users should consult the administrator) change the field delimiter (under Advanced), so that it matches the delimiter specified by the lookup program (or the address book data in a flat file).

See Also

Testing the directory service

Compose a message using the directory service

Advanced Settings for ODS


Testing the directory service

To test that your Remote Address book can be accessed:

1.	Type in a search pattern string (e.g. bob)

2.	Choose the Search Remote button (all users with bob as part of their email address (or optional comments) should be displayed)

See Also

Making a new address book

Compose a message using the directory service

Advanced Settings for ODS


Compose a message using the directory service

You can now use your Directory Service Address book to address your mail:

1.	Choose the Compose button, or the New command form the Message menu

2.	Choose the Address… button

3.	Select the Corporate centralized address book

4.	Enter a search pattern

5.	Choose the Search Remote button

6.	Select an address from the search results

7.	Choose the To, Cc, or Bcc buttons to use the selected address

8.	Choose the Close button when finished addressing your message

Note:	 If “comment” information is being added to your message’s To, Cc, or Bcc header, check that your address book’s Delimiter (Advanced) property is set correctly.

See Also

Making a new address book

Testing the directory service

Advanced Settings for ODS


Advanced Settings for ODS

The script run from dirserv.d via the INETD port can perform numerous tasks, based on the script itself and the search criteria used. For instance you can use a set of "arg1" keywords that take different actions.

For example, use a keyword "online" which would trigger a shell or Perl script to perform a "who" command and then for each on those userids and map to a NIS or flat file alias list and pass the names and address back to Z-Mail.

It is possible to use this technique to access an online phone directory, show local majordomo mailing lists, show users at a given site, and so on.

Z-Mail Pro lets you set up multiple address books, so you can set up multiple Open Directory Service servers. If they are to run on the same host, just use different port numbers for each.

The server examples here are scripted in Bourne shell or Perl. For performance reasons, you may want to write your own server in C.

You are not restricted to using a flat file as your address database. You can adapt the examples to access whatever lookup mechanism you prefer (searching the password file (or NIS), sendmail’s alias file, querying a PH, X.500, or SQL server, etc.).

If you develop useful directory service enhancements, please share your ideas with the rest of the Z-Mail community by posting them to the comp.mail.zmail newsgroup.

See Also

Installing an ODS Server

Making a new address book

Samples for ODS


Samples for ODS

Open Directory Service (ODS) is a simple general purpose directory service protocol designed for use with the Z-Mail Pro mail client.   In this release we provide several scripts for use with the Unix operating system.  The scripts provide examples of ODS used with an arbitrary text file,  the Sendmail SMTP mail server aliases file, or the alias map provided by Sun NIS.

The scripts are provided on the release CD in the directory CDROM.

•	The dirserv.d script is a script used by INETD to listen for and launch directory server requests.

Sample Lookup Request Dispatcher, dirserv.d

•	The lookup.flat script is a script which can be launched by dirserv.d to search a user-supplied ASCII file.

Sample Lookup Service Program, lookup.flat

•	The lookup.alias is a script which can be launched by dirserv.d to search a Sendmail aliases file or  the Sun NIS aliases map.

Sample Perl dirserv.d with Integrated Lookup Service

The prerequisite for installing and using these scripts is familiarity with Unix system administration, i.e., having a superuser account and familiarity with the use of INETD.  It is recommended that the script directory be copied from the CD onto a directory on a Window machine running either and NFS or FTP server. These files can then be copied to a Unix machine via either an NFS mount or an FTP transfer.


Sample Lookup Request Dispatcher, dirserv.d

#! /bin/sh -

#

# dirserv.d  Z-Mail Open Directory Service support script

# Copyright (c) 1993-96 NetManage, Inc.

#

# This script listens on a socket for what is presumed to be

# a connection from a Z-Mail client requesting a directory

# service lookup. Dirserv.d runs a directory service program

# specified as its (optional) first argument and prints back

# to the socket first the exit status and then the output of

# the directory service (address lookup) program.

#

# The client needs to provide two parameters to this program via the

# socket. The first is an integer denoting the maximum number of

# matches to return. A value of -1 indicates no limit. (This parameter

# is given to the lookup service program “as is” and might even be

# ignored.) The second parameter is the search pattern, which is also

# passed to the lookup service “as is”. The “regular expression” syntax

# of the search pattern is defined by the lookup service.

#

# Z-Mail interprets the exit status of the directory service program

# as follows:

#    0 No problems, addresses that match are on standard output.

#    1 Execution failed for some reason, error message on standard

#      output or standard error.

#    2 More than the maximum number of addresses matched, error

#      message on standard output or standard error.

#    3 Incorrect number of arguments.

#    4 No addresses matched, original address on standard output.

#    5 One known-correct matching address on standard output.

#

# Setting up the socket connections is assumed to be handled by INETD.

# Modify your INETD.conf and /etc/services files to cause this script

# to be started when a connection arrives on port 15213.  Here's a

# sample INETD.conf entry:

#

#      zmailds  stream  tcp  nowait  guest  /usr/local/etc/dirserv.d

#

# Or if you wanted to explicitly specify the name of a lookup program:

#

#      zmailds  stream  tcp  nowait  guest  /usr/local/etc/dirserv.d \

#        /usr/local/etc/dirserv.d /usr/lib/Zmail/bin/lookup.flat

#

# And here's a sample /etc/services entry:

#

#      zmailds  15213/tcp   zmaildsd  # Z-Mail directory service

#####################################################################

#

# Default lookup service -- edit as necessary.

SERVICE="${1-/usr/lib/Zmail/bin/lookup.flat}"

CR=`echo | tr '\012' '\015'`

#

OUTPUT="${TMPDIR-/tmp}/zmODS$$"

# Obtain search probe from client (an integer and a search pattern)

read lookupmax pattern

# Strip trailing CR-NL if any

pattern="`echo \"$pattern\" | tr -d '\015\012'`"

"$SERVICE" "$lookupmax" "$pattern" > "$OUTPUT" 2>&1

# Send numeric result code and CR-NL on each line of the search results

(echo $? ; cat "$OUTPUT") | sed 's/$/'"$CR"/

rm -f "$OUTPUT"

See Also

Sample Lookup Service Program, lookup.flat

Sample Perl dirserv.d with Integrated Lookup Service


Sample Lookup Service Program, lookup.flat

#

# Z-Mail Pro directory lookup script to search flat files (both

# public and personal).

#

# The format of the files is simple:

#    Place one E-Mail address on each line.

#    Descriptive comments that should be displayed but NOT included in

#       the address headers may follow the address, separated by a

#       delimiter.

#       The delimiter that is selected must also be configured in the

#       Z-Mail Pro address book's "Advanced" property setting.

#

# Samples (assuming a delimiter of ';'):

#    "Mickey Mouse" <mickey.mouse@disney.com>;Our favorite cartoon

#    job@sackcloth.com;Job under the Juniper tree

#    herod@palace.jerusalem.il;Hateful Herod

#    joseph@egypt.com;Joseph our rags to riches hero

#

# The ADDRESSES environment variable can be used to reference a "public"

# address file. If it exists, a private $HOME/.addresses file will also

# be searched. For convenience, set ADDRESSES in dirserv.d before it

# invokes this script.

#

# Ensure sed, egrep, fgrep, wc are on your path.

#

if [ $# -ne 2 ]

then

    echo "`basename $0`: Expected 2 args, got $#"

    exit 3	# Incorrect arguments

fi

# Uncomment the line below if you want to prevent users from seeing the

# comment information associated with each email address.

#NO_COMMENT="TRUE"

# This field delimiter separates the email address from the comment and

# must match what the Z-Mail Pro client Address Book delimiter is set

# to.

# (Test this delimiter carefully, some characters (or strings) can cause

# problems.  Definitely don't use '&' '.' '!' '<' '>' '%' or '@')

DELIMITER=';'

matches=${TMPDIR-/tmp}/admatch$$

# If a global (public) address book is defined, search it

if [ -n "$ADDRESSES" ]

then

    if [ -n "$NO_COMMENT" ]

    then

        (egrep -i -e "$2" $ADDRESSES || \

         fgrep -i -e "$2" $ADDRESSES) | \

         # strip off the delimiter and comment field

         sed "s/\(.*\)${DELIMITER}\(.*\)/\1/" >> $matches 2>/dev/null

    else

        (egrep -i -e "$2" $ADDRESSES || \

         fgrep -i -e "$2" $ADDRESSES) >> $matches 2>/dev/null

    fi

fi

# If the user has a personal address book, search it

# (if we haven't already)

if [ -r $HOME/.addresses -a "$ADDRESSES" != "$HOME/.addresses" ]

then

    if [ -n "$NO_COMMENT" ]

    then

        (egrep -i -e "$2" $HOME/.addresses || \

         fgrep -i -e "$2" $HOME/.addresses) | \

         # strip off the delimiter and comment field

         sed "s/\(.*\)${DELIMITER}\(.*\)/\1/" >> $matches 2>/dev/null

    else

        (egrep -i -e "$2" $HOME/.addresses || \

         fgrep -i -e "$2" $HOME/.addresses) >> $matches 2>/dev/null

    fi

fi

count=`wc -l < $matches`

EXIT=1	# Execution failure

if [ $count -eq 0 ]

then

    echo "$2"

    EXIT=4	# No matches found

elif [ $count -gt $1 -a $1 -gt 0 ]

then

    echo "Matched $count names (max $1)"

    echo "Use a more specific pattern please."

    EXIT=2	# Too many matches

else

    cat $matches

    if [ $count -eq 1 ]

    then

EXIT=5	# Exactly one match

    else

EXIT=0	# At least one match

    fi

fi

rm -f $matches

exit $EXIT

See Also

Sample Lookup Request Dispatcher, dirserv.d

Sample Perl dirserv.d with Integrated Lookup Service


Sample Perl dirserv.d with Integrated Lookup Service

#!/usr/local/bin/perl

# Perl Open Directory Service routine for Z-Mail, adapted from the

# basic dirserv.d shell script.

#

# Search a text file of addresses for matching entries, then return

# no more than 100 matches.

#

# This script assumes $ADDRBOOK points to a file containing

# email addresses, one per line. E.g.

# joseph@egypt.com

# job@sackcloth.com

# herod@palace.jerusalem.il

#

# Location of address book data – edit as necessary

$ADDRBOOK = “/usr/local/zmail/addrbook.txt”

$total = 0;

($lookupmax, $pattern, $p1, $p2, $p3, $p4) = split(" ", <STDIN>);

$pattern =~ s/\./\.\*/g;

$pattern = $pattern.".*".$p1 if $p1 ne "";

$pattern = $pattern.".*".$p2 if $p2 ne "";

$pattern = $pattern.".*".$p3 if $p3 ne "";

$pattern = $pattern.".*".$p4 if $p4 ne "";

$pattern =~ s/\.\./\./g;

$pattern =~ s/\"//g;

open (DIR, '/usr/bin/grep -Ei "' . $pattern . '” '. $ADDRBOOK |');

while(<DIR>) {

    chop;

    if (m!$pattern!i)

    {

  $total++;

  if($total <= 100 || $total < $lookupmax)

        {

      push (@results,"$_");

      push (@results, "\r\n");

  }

    }

}

close(DIR);

if ($total == 0)

{

    print "4\r\n$pattern\r\n";

}

elsif ($total > 100)

{

    print "2\r\nMore than 100 matches found.\r\n";

    print "Please use a more specific pattern.\r\n";

}

else

{

    if ($total == 1)

    {

print "5\r\n";

    } else

    {

print "0\r\n";

    }

    foreach $entry (@results)

    {

print $entry;

    }

}

exit(0);

See Also

Sample Lookup Request Dispatcher, dirserv.d

Sample Lookup Service Program, lookup.flat