[comp.unix.misc] SUMMARY: BSD rmail Sources

joe@acmis.cmis.co.at (Johannes Rupp) (11/23/90)

Some days ago I posted the following request:

>I am using an AT&T 3B2 with UNIX V Rel 3.0 and the Wollogong WIN/3B TCP/IP.
>My problem is that any mail which comes in by uucp which uses domain
>addressing is not delivered properly because my version of rmail
>(the UNIX V version) doesn't understand domain addressing.
>The WIN/3B TCP/IP manuals also just tell me to replace the existing rmail
>by a BSD version of rmail which understands domain addressing.
>Unfortunately the manuals won't tell me where I could get a copy of the
>sources of BSD rmail.
>Has anybody any idea where I could get a copy of the sources (USENET/EUNET
>and anonymous FTP are both OK).
>Please don't send me the sources right away to keep the network bandwidth
>low. I will contact the site with the available sources from my side.


To let anybody else who has the same problem participate on the feedback
I received here are a summary of the answers which offer a solution to
my problem.


1.) Get deliver (an rmail replacement for UNIX V rmail) via
    anonymous FTP from host ucsd.edu in the u3b2 directory. It is an
    UNIX V rmail replacement.

2.) Get rmail source of any archive which has a BSD distribution. The
    required files are:

    -r--r--r--  1 rickert       75 May 11  1990 Makefile
    -rw-r--r--  1 rickert     1194 Jun 25 09:49 paths.h
    -r--r--r--  1 rickert     1608 May 31 22:39 rmail.1
    -r--r--r--  1 rickert     5956 May 31 22:38 rmail.c


3.) Get smail3 from
       comp.sources.unix archives or
       anonymous FTP archives on uunet.uu.net or
       uunet in the directory /usr/spool/ftp/networking.

4.) An /bin/mail replacement sent to me by Wolf Paul. I have appended this
    tiny program (about 60 lines of source code) at the end of this article.


I for myself have solved the problem with the deliver program 1) which
compiled and installed without any problems. It's a tiny program and
does exactly what I needed. It comes in a shar file of about 18k Bytes
uncompressed. The installation process was just typing 'make'.

Thanks to Bruce Walker, Scott Campbell, Gary Heston, John F. Woods, Dave Platt,
Jean Marie Diaz and Wolf N. Paul for their feedback.

-------- cut here ----------- cut here --------------------------------------
W.N.Paul, Int. Institute f. Applied Systems Analysis, A-2361 Laxenburg--Austria
PHONE: +43-2236-71521-465            INTERNET: wnp%iiasa@relay.eu.net
FAX:   +43-2236-71313                UUCP:     uunet!iiasa!wnp
HOME:  +43-2236-618514               BITNET:   tuvie!iiasa!wnp@awiuni01.BITNET

Replacement for AT&T "/bin/mail"

Installation:
(as root)

1. cc binmail.c -o binmail

2. mv /bin/mail /bin/lmail
   rm /bin/rmail

3. cp binmail /bin/mail
   chown bin /bin/mail
   chgrp mail /bin/mail
   ln /bin/mail /bin/rmail

Finished!

SOURCE CODE:
/* @(#)binmail.c	1.3 7/22/88 02:33:39 */
/* This program will be used in place of /bin/mail on SVR2 sites.
 * It looks at the arguments and decides whether to call
 * SENDMAIL for sending mail, or LMAIL for reading mail.
 *
 * before installing as /bin/mail, move the stock /bin/mail to /bin/lmail
 *
 */

#include <stdio.h>

#ifndef LMAIL
#define LMAIL "/bin/lmail"
#endif

#ifndef SENDMAIL
#define SENDMAIL "/usr/lib/sendmail"
#endif

#define TRUE 1
#define FALSE 0

char *program;

void	perror(), exit(), usage();

main(argc, argv)
int argc;
char *argv[];
{
	int i, j, c;		/* indexes */
	int reading = FALSE;	/* TRUE => user read mail, run LMAIL */
	int sending = FALSE;	/* TRUE => sending mail, call Sendmail directly */
	extern int optind;
	extern char *optarg;

	/*
	 * parse args
	 */
	program = argv[0];
	if(argc == 1) {
		/* no args means just a user wanting to read their mail */
		reading = TRUE;
	} else {
		while((c = getopt(argc, argv, "epqrtf:")) != EOF) {
			switch(c) {
			case 'e':
			case 'p':
			case 'q':
			case 'r':
			case 'f':
				reading = TRUE;
				break;
			case 't':
				sending = TRUE;
				break;
			default:
				usage();
				exit(1);
			}
		}
	}
	/* any arguments left over -> sending */
	if(argc > optind) {
		sending = TRUE;
	}
	if((reading == TRUE) && (sending == TRUE)) {
		usage();
		exit(1);
	}

	/*
	 * form arguments
	 */
	if(sending == TRUE) {
		argv[0] = SENDMAIL;
		for(i = 1, j = optind; i < argc; i++, j++) {
			argv[i] = argv[j];
		}
		argv[i] = NULL;
	} else {
		argv[0] = LMAIL;
		/*argv[1] = NULL;*/
	}

	/*
	 * exec our real program
	 */
	(void) execv(argv[0], argv);
	(void) fprintf(stderr, "%s: execv(\"%s\", argv) failed: ",
		program, argv[0]);
	perror("");
	exit(1);
}

void
usage()
{
	(void) fprintf(stderr, "usage: %s [ -epqr ] [ -f file ]\n", program);
	(void) fprintf(stderr, "or usage: %s [ -t ] persons\n", program);
}

-- 
+------------------------------------------------------------------------+
| CMIS Austria                |      Voice:  (++43-222) 98 109  Ext. 110 |
| NIELSEN Austria             |      Voice:  (++43-222) 98 110  Ext. 110 |
| Moeringgasse 20             |      Fax:    (++43-222) 98 110 77        |
| A-1150 Vienna, Austria      |      E-Mail: joe@acmis.cmis.co.at        | 
|                             |              ...!mcsun!tuvie!acmis!joe   |
+------------------------------------------------------------------------+
-- 
+------------------------------------------------------------------------+
| CMIS Austria                |      Voice:  (++43-222) 98 109  Ext. 110 |
| NIELSEN Austria             |      Voice:  (++43-222) 98 110  Ext. 110 |
| Moeringgasse 20             |      Fax:    (++43-222) 98 110 77        |

andyc@bucky.intel.com (Andy Crump) (11/29/90)

SVR4 version of rmail has domain address support.  Just adding to your list.
--

    -- Andy Crump

    ...!tektronix!reed!littlei!andyc | andyc@littlei.intel.com
    ...!uunet!littlei!andyc          | andyc@littlei.uu.net

Disclaimer: Any opinions expressed here are my own and 
            not representive of Intel Corportation.