|
Freedom to Mail from Your 3000, for Free Do it
yourselfers can put these freeware solutions to work on their
systems 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/iX 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.cccd.edu/~markb/sy slogix.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/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.cccd.edu/~markb/ 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. MAILX.HPBIN.SYS 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:
To improve the
handling of mailx you may use the command files in Figures 1-5. 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.
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 : user@domain.co.za 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 "neil@nha.co.za" elseif hpjobname = "JENS" then setvar fullname "Jens von Bulow" setvar xfrom "jens@nha.co.za" else setvar fullname dwns("!HPJOBNAME") + "," + dwns("!HPUSER") + "." + dwns("!HPACCOUNT") setvar xfrom "ops@nha.co.za" 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
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 : user@nha.co.za 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 "neil@nha.co.za" elseif hpjobname = "JENS" then setvar fullname "Jens von Bulow" setvar xfrom "jens@nha.co.za" else setvar fullname dwns("!HPJOBNAME") + "," + dwns("!HPUSER") + "." + dwns("!HPACCOUNT") setvar xfrom "ops@nha.co.za" 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
Command file 3 is the
batch version of 2 and needs three parameters. In a job it could look
like 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 :LISTFILE /;NAME=mbox;FORMAT=6 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 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/pop 3/, 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 jens@hp3000.nha.co.za to point to JENS.NHA. If you have your POP3 client specify the e-mail address as jens@hp3000.nha.co.za, 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 (aschmid4@csc.com) is a computer technology specialist
working for CSC Ploenzke AG, Germany. Mark Bixby (markb@cccd.edu) 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
(jens@nha.co.za) is a director of Neil Harvey & Associates, South
Africas only HP 3000 authorized channel partner.
|