Freedom to Mail from Your 3000, for Free
Do it yourselfers can put these freeware solutions to work
on their systems
By Andreas Schmidt,
with Mark Bixby, and Jens von Bülow
Having already enabled the Internet Services on an HP 3000, you may think to use this box for incoming and outgoing e-mails as well. This is possible for free using a collection of software recently ported to the HP 3000, bundled with the HP 3000, or available in the public domain:
Sendmail/iX, the mail transport agent well known on HP-UX that has been recently ported to MPE/iX;
Syslog/iX, the event logging subsystem required by Sendmail/iX;
MAILX.HPBIN.SYS, the mail reader, and;
Qpopper, the POP3 protocol for downloading.
Sendmail/iX and Syslog/iX have been ported from the Unix world to MPE by Mark Bixby. [Editors note: Bixby recently joined HP 3000 labs in its Internet and Interoperability team, but did his porting while working at a California college as a system administrator.] Qpopper has been ported by HP 3000 channel partner Neil Harvey & Associates . MAILX.HPBIN.SYS is part of the Posix shell, which has been bundled into each MPE/iX Operating system since version 4.5.
The combination of all four utilities will enable your HP 3000 to
receive Internet e-mails sent to e.g. USER.ACCOUNT@host.domain;
send Internet e-mails into intra- or extranets, and;
be used as an incoming and outgoing e-mail Server for a PC based Internet Browser (e.g. Netscape Communicator or Microsoft Internet Explorer). The combination with Apache/iX, the MPE/iX ported Web server, offers new possibilities to enhance the communication.
This article describes how to establish these functions. It is based on documentation from Mark Bixby, Jens von Bülow, and HP, as well as my own experience using these tools.
Syslog is the standard event logging subsystem for Unix. It consists of a server daemon, a client function library, and a client command line utility. It is possible to log to files, terminal devices logged on users, or forward to other syslog systems. Syslog can accept data from the local system via an AF_UNIX socket, or from any system on the network via an AIF_INET UDP socket on port 514. The sendmail mail transport package is one of the Internet tools which log to syslog. Syslog/iX is bundled with MPE/iX 6.0 and is fully supported by HP. But HP does not support the freeware version for MPE/iX 5.0 or later that can be downloaded from Mark Bixbys web page.
To download and install it, just follow Mark Bixbys short and to the point installation guide at www.bixby.org/mark/syslogix.html . The entry in SERVICES.NET.SYS will reserve port 514 for this service, and the file /SYSLOG/PUB/syslog.conf is the configuration file you can adapt to your needs. This easy installation is the first step before installing Sendmail/iX.
Sendmail is a mail transport agent for Unix. It accepts fully formatted e-mail messages from local host system users, queues the messages, and then delivers the messages to local or remote users. It listens on TCP port 25 for incoming SMTP messages from remote systems, and delivers these messages to local host system users by appending the message text to the users mailbox file.
Sendmail is NOT a mail user agent. It does not have the ability to compose or to read e-mail. To cover this functionality, HP bundled the program /SYS/HPBIN/MAILX into the shell utilities (see below). Sendmail is also not a POP3 server that will enable network clients such as Netscape or Microsoft IE to access Sendmail/iX mailboxes. To cover this functionality, Qualcomms Qpopper has been ported to MPE/iX (see below).
Sendmail/iX can be downloaded from www.bixby.org/mark/sendmailix.html . The installation sounds more complicated than the one for Syslog/iX, but in fact it isnt. But it is a little bit more complicated to add features into the basic configuration files. In particular, a wrong relay setting may create severe security or spamming problems. For more details, you may look to www.sendmail.org , the web site of the Sendmail Consortium of the freeware version of sendmail. The files SERVICES.NET.SYS and /etc/mailx.rc must be edited to reserve port 25/tcp for smtp, and to tell mailx that the delivery program is now Sendmail/iX and not the HP default /bin/tsmail.
This program helps read and send electronic mail messages. It has no built-in facilities for sending messages to other systems. But combined with other programs (a mail routing agent and a transport agent like Sendmail/iX) it can send messages to other systems. MAILX only offers limited support for various message headers (i.e. Subject:, From:, To:, Cc:, etc). If you need to do anything fancy, like MIME headers, youll need to call SENDMAIL.PUB.SENDMAIL directly and pass it a fully formatted message containing all headers and body text.
To read messages from your mailbox in /usr/mail/ type :MAILX.HPBIN.SYS
To send messages use :MAILX.HPBIN.SYS [options] user1 user2 ... An :EOD finishes the message text.
The files in /usr/mail/ are named USER.ACCOUNT and are accessible only for this user. In the example below, an MPE ACD is shown:
/usr/mail  > ls -als total 228 1 drwxrwxrwx 2 MANAGER.SYS 0 416 Jul 5 15:08 . 3 drwxrwxr-x 12 MANAGER.SYS 0 1184 Jun 28 16:19 .. 1 -rw------- 1 MANAGER.SYS SYS 337 Jul 5 14:25 MANAGER.SYS 223 -rw------- 1 THOONER.POP3 POP3 113959 Jul 5 15:00 THOONER.POP3 :LISTFILE /usr/mail/@,-2 PATH= /usr/mail/ ---------ACD ENTRIES------------------- FILENAME $OWNER : R,W,RACD MANAGER.SYS $GROUP_MASK : RACD $GROUP : RACD @.@ : RACD $OWNER : R,W,RACD THOONER.POP3 $GROUP_MASK : RACD $GROUP : RACD @.@ : RACD
To improve the handling of mailx you may use the command files in Figures
Three other more actual commandfiles can be found here
Figure 1: MAILX.XECMD.SYS
COMMENT Invoke MAILX.HPBIN.SYS to read mailboxes in /usr/mail/
COMMENT created via Sendmail/iX
COMMENT written by Andreas Schmidt, CSC, Germany, 05Jan1999
Figure 2: SENDMAIL.XECMD.SYS
COMMENT SendMail/iX COMMENT COMMENT version 1.1 [18MAR1999] by Andreas Schmidt, CSC GIU COMMENT ECHO ECHO Sendmail/iX ECHO IF HPSYSNAME = "XENBH1" OR HPSYSNAME = "XENBH2" THEN SETVAR LOC "NIB" ELSE SETVAR LOC "BHG" ENDIF SETVAR SEND_TO " " SETVAR SEND_NAME "!HPUSER.!HPACCOUNT@!HPSYSNAME.!LOC.DUPONT.COM" SETVAR SEND_MORE "Y" SETVAR SEND_FILE_Y_N "N" SETVAR SEND_EDIT_Y_N "N" SETVAR SEND_NAME_NUM 1 WHILE SEND_NAME_NUM > 0 DO INPUT SEND_NAME;PROMPT="To: [!SEND_NAME] ?" SETVAR SEND_TO "!SEND_TO !SEND_NAME" INPUT SEND_MORE;PROMPT="More names (y/n) [!SEND_MORE]: ?" IF ups("!SEND_MORE") <> "Y" THEN SETVAR SEND_NAME_NUM 0 ENDIF ENDWHILE INPUT SEND_SUBJECT;PROMPT="Subject: " INPUT SEND_FILE_Y_N;PROMPT="Do you have a file to send (Y/N) [!SEND_FILE_Y_N]? " IF ups("!SEND_FILE_Y_N") = "N" THEN ECHO ECHO Type in your message, and finish with a // ECHO (No prompt will be displayed!) ECHO SETVAR SEND_FILE "X!HPLDEVIN" RUN TDP.PUB.SYS;INFO="SET PERMYES;AQ;K X!HPLDEVIN,UNN;E"> $NULL INPUT SEND_EDIT_Y_N;PROMPT="Edit of Message needed (Y/N) [!SEND_EDIT_Y_N]?" IF ups("!SEND_EDIT_Y_N") = "Y" THEN ECHO ECHO You will invoke TDP to edit the message. ECHO Use normal TDP commands to edit your text. ECHO RUN TDP.PUB.SYS;INFO="SET PERMYES;T X!HPLDEVIN,UNN;L ALL" ENDIF ELSE INPUT SEND_FILE;PROMPT="Message Content (File Name): " ENDIF MAILX.HPBIN.SYS "-s '!SEND_SUBJECT' !SEND_TO" < !SEND_FILE ECHO Done.
Figure 3: SENDBACK.XECMD.SYS
PARM SEND_SUBJECT SEND_TO SEND_FILE
COMMENT Intended for batch use.
COMMENT Three parameters in "" are required:
COMMENT - SEND_SUBJECT subject of the message
COMMENT - SEND_TO addreessees
COMMENT - SEND_FILE filename to be sent
COMMENT :SENDBACK "This is my message" COMMENT : "email@example.com
COMMENT :firstname.lastname@example.org" COMMENT : "FILE.GROUP.ACCOUNT"
COMMENT version 1.0 [07Oct1998] by Andreas Schmidt, CSC GIU
MAILX.HPBIN.SYS "-s '!SEND_SUBJECT' !SEND_TO" < !SEND_FILE
Figure 4: MAIL.CMD.NHA
parm to="" subject="" filename="" x1="" x2="" x3="" setvar xto "!to" setvar xsubject "!subject" setvar xfilename "!filename" if ( xto = "?" or xto = "" or xsubject = "") then echo mail.cmd.sys echo echo mail ! mailto! ! subject! [filename] echo echo mailto : email@example.com echo subject: subject of the email message, must be quoted echo filename: any mpe or posix filename (optional) echo escape endif if (xfilename <> "") and (not finfo("!xfilename","EXISTS")) then echo mail.cmd.sys: !xfilename not found escape endif if hpjobname = "NEIL" then setvar fullname "Neil Harvey" setvar xfrom "firstname.lastname@example.org" elseif hpjobname = "JENS" then setvar fullname "Jens von Bulow" setvar xfrom "email@example.com" else setvar fullname dwns("!HPJOBNAME") + "," + dwns("!HPUSER") + "." + dwns("!HPACCOUNT") setvar xfrom "firstname.lastname@example.org" endif echo From: "!FULLNAME" ! > cm echo To: !xto ! >> cm echo Subject: !xsubject >> cm echo MIME-Version: 1.0 >> cm if (!xfilename <> "") then mime64.hpbin.sys "-c !xfilename" >> cm endif sendmail "-f !xfrom !xto" < cm
Figure 5: MAILFILE.CMD.NHA
parm to="" subject="" filename="" remotefilename="" setvar xto "!to" setvar xsubject "!subject" setvar xfilename "!filename" setvar xrfn "!remotefilename" if ( xto = "?" or xto = "" or xsubject = "" or xfilename = "") then echo mailfile.cmd.sys echo echo mailfile ! mailto! ! subject! ! filename! [remotefilename] echo echo mailto : email@example.com echo subject: subject of the email message, must be quoted echo filename: any mpe or posix filename echo remotefilename: name of the file you want to call the attachment echo escape endif if (not finfo("!xfilename","EXISTS")) then echo mail.cmd.sys: !xfilename not found escape endif if ( xrfn = "" ) then setvar xrfn "!xfilename" endif if hpjobname = "NEIL" then setvar fullname "Neil Harvey" setvar xfrom "firstname.lastname@example.org" elseif hpjobname = "JENS" then setvar fullname "Jens von Bulow" setvar xfrom "email@example.com" else setvar fullname dwns("!HPJOBNAME") + "," + dwns("!HPUSER") + "." + dwns("!HPACCOUNT") setvar xfrom "firstname.lastname@example.org" endif file cm;disc=1000000 echo From: "!FULLNAME" ! > *cm echo To: !xto ! >> cm echo Subject: !xsubject >> cm echo MIME-Version: 1.0 >> cm echo Content-Type: multipart/mixed; >> cm echo boundary="---- =_NextPart_000_01BD4835.FE66D2E0" >> cm echo >> cm echo This message is in MIME format. >> cm echo >> cm echo ------ =_NextPart_000_01BD4835.FE66D2E0 >> cm echo >> cm echo >> cm echo ------ =_NextPart_000_01BD4835.FE66D2E0 >> cm echo Content-Disposition: attachment;filename="!xrfn" >> cm mime64.hpbin.sys "!xfilename !xrfn" >> cm echo ------ =_NextPart_000_01BD4835.FE66D2E0-- >> cm echo >> cm sendmail "-f !xfrom !xto" < cm
Figure 6: Purging dead letters in IT/OpenView OpCenter
472) !COMMENT Check and purges dead.letter of Sendmail/iX once a day
473) !IF HPHOUR = 12 AND HPMINUTE <= 16 THEN
474) ! CONTINUE
475) ! PURGE O!HPPIN >$NULL
476) ! BUILD O!HPPIN;REC=-80,,F,ASCII
477) ! FILE OUT=O!HPPIN,OLD
478) ! SETJCW CIERROR 0
479) ! LISTFILE /;NAME=dead.letter;FORMAT=6 > *OUT
480) ! IF CIERROR = 0 AND FINFO('O!HPPIN','EOF') > 0 THEN
481) ! RESET OUT
482) ! RUN TDP.PUB.SYS;&
483) !INFO="SET PERMYES;T O!HPPIN;CIQ1,'PRINT ',ALL;K;E" >$NULL
484) ! CONTINUE
485) ! PURGE X!HPPIN >$NULL
486) ! BUILD X!HPPIN;REC=-80,,F,ASCII;DISC=4000
487) ! FILE OUT=X!HPPIN,OLD
488) ! PRINT O!HPPIN;PAGE=0 >> *OUT
489) ! XEQ O!HPPIN >> *OUT
490) ! OPCMSG normal,SENDMAIL,dead.letter,SysAdmin,&
491) !Sendmail/iX created dead.letter - will be purged.
492) ! SENDBACK "!HPSYSNAME: dead.letter" &
493) !"email@example.com &
494) !firstname.lastname@example.org" &
496) ! RESET OUT
497) ! RUN TDP.PUB.SYS;&
498) !INFO="SET PERMYES;T O!HPPIN;CQ 'PRINT ','PURGE ',ALL;K;E" >$NULL
499) ! XEQ O!HPPIN
500) ! ENDIF
Command file 1 simply invokes mailx to check whether e-mails have been received.
Command 2 looks more complicated, but helps you to write and edit an e-mail.
For example, you want to send the file SERVICES.NET.SYS to a colleague:
To: [MANAGER.SYS@XEBHH2.BHG.DUPONT.COM] ?email@example.com
More names (y/n) [Y]: ?n
Subject: wanted file SERVICES
Do you have a file to send (Y/N) [N]? y
Message Content (File Name): SERVICES.NET.SYS Done.
Here is another example: you want to send a message to your spouse:
To: [MANAGER.SYS@XEBHH2.BHG.DUPONT.COM] ?firstname.lastname@example.org
More names (y/n) [Y]: ?n
Subject: My Dear!
Do you have a file to send (Y/N) [N]? n
Type in your message, and finish with a // (No prompt will be displayed!)
what about the beer in the cooler for this evening? Im pretty dursty right now!
Edit of Message needed (Y/N) [N]?
Command file 3 is the batch version of 2 and needs three parameters. In a
job it could look like
! SENDBACK !HPSYSNAME: dead.letter &
! email@example.com &
! firstname.lastname@example.org &
Command file 4 will e-mail files to clients as an e-mail message, and
command file 5 will e-mail files to clients as an attachment (both written by Jens).
Note:MIME64.HPBIN.SYS is a program that encodes a file using base64 encoding.
You can find a more detailed documentation of mailx on the man pages in the shell on the HP 3000, or in the manual of the Shell commands.
It may happen that so called dead.letters will be created in using mailx. This can happen if an e-mail was not properly finished. A housekeeping job should purge those files from time to time. Figure 6 shows how we do this in our IT/O OpCenter permanent control job once a day.
It may also happen that the mailbox files in mbox have not been kept in
/usr/mail/. This may happen because of a different variable setting for
$HOME. At that point, the files are named mbox and reside in normal
MPE groups. The command
will show the location of these files.
One nice feature is that the HP 3000 can now be used as outgoing SMTP server for your PC based Internet Browser. You need only to configure the setup of the outgoing SMTP server in that way, that the HP 3000 is the outgoing SMTP mail server (no user name required).
Using what we have discussed up to now, the following tasks can be achieved:
Depending on the Sendmail/iX configuration, you can send e-mails to addressees on your box, on your intranet, or worldwide (e.g. using a mail hub and a proper relay setting).
You can use this ability to create such e-mails interactively or via batch (e.g., out of a CGI script out of Apache/iX), or out of your Internet e-mail agent on your PC.
If you want to receive e-mails directly to your PC Internet browser, you need to enrich the HP 3000 with a POP3 server. This can be achieved with Qpopper.
Qpopper is a server that supports the POP3 protocol for downloading Internet e-mail from software clients. Qpopper does not include a message transfer agent or SMTP support but normally works with standard Unix mail transfer agents such as sendmail. On MPE/iX it works therefore perfectly with Sendmail/iX.
Again, no license agreement is required to use this server! The download page here is ftp://ftp.nha.co.za/hp3000/pop3/ , and it contains a short installation procedure as well. The basics are:
The link /usr/local/bin/popper must point to /SYS/ARPA/POPPER.
In SERVICES.NET.SYS, port 110/tcp must be reserved for pop3 service.
INETDCNF.NET.SYS must start this service via pop3 stream tcp nowait MANAGER.SYS /SYS/ARPA/POPPER popper.
For relaying via Sendmail/iX, a file /etc/mail/relay-domains must exit in mode 644 (-rw-rr) owned by MGR.SENDMAIL.
Having successfully installed this (and having passed the tests Jens von Bülow describes in the Qpopper description file), you may now change your Internet browser so that your HP 3000 is the incoming POP3 server. You may do as we did: we created a new account POP3 with plain vanilla users per mailbox. The PC e-mail client needs to be configured in the following way:
Server Name: your POP3-enabled HP 3000
Server Type: POP3 Server,
User Name: USER1.POP3 (e.g., SCHMIDA.POP3)
You may want to remember to set a password and an adequate check time for new e-mail. Its up to you whether you want to download the new messages to the PC and not to keep on the host or not.
A nice feature is the aliasing in Sendmail/iX, which allows you to set an alias of email@example.com to point to JENS.NHA. If you have your POP3 client specify the e-mail address as firstname.lastname@example.org, everything works extremely well. Now your HP 3000 acts as a POP3 and SMTP server for all Internet e-mail software agents.
All the programs we have discussed are freeware. The support happens via the 3000-L newsgroup, or directly by the porters, Mark Bixby and Jens von Bülow. Its your own decision whether to make use of these solutions, or spend money for software packages covering these functions. Feel free to contact the authors via the e-mail addresses below if you have questions regarding this article.
Our site is using this freeware with great results! We hope that this article will encourage you to use the HP 3000 like a Unix or NT box but enjoy the reliability of MPE/iX!
Andreas Schmidt (email@example.com) is a computer technology specialist
working for CSC Ploenzke AG, Germany.
Mark Bixby (firstname.lastname@example.org) was a software systems programmer working for the Coast Community College District in Costa Mesa, California when this article was written, and is now working in HPs 3000 labs.
Jens von Bülow (email@example.com) is a director of Neil Harvey & Associates, South Africas only HP 3000 authorized channel partner.