Thread View: news.software.nn
6 messages
6 total messages
Started by Vic Rice
Sun, 24 Jun 1990 05:53
Can't MAIL from nn
Author: Vic Rice
Date: Sun, 24 Jun 1990 05:53
Date: Sun, 24 Jun 1990 05:53
11 lines
1092 bytes
1092 bytes
I have nn 6.4.5 installed on SCO ODT. I am also using Cnews. I can not get MAIL to work from within nn. I have tried REC_MAIL = sendmail, as sendmail is supplied (although not used by default) with SCO. I have also tried /usr/lib/mail/execmail for REC_MAIL. Neither of these worked. Both resulted in additions to my dead.letter file. Is anyone using both nn and Cnews on SCO UNIX with a successful nn MAIL command ? I would appreciate any help I can get. -- Dr. Victor L. Rice Litwin Process Automation
Re: Can't MAIL from nn
Author: Kim F. Storm
Date: Mon, 25 Jun 1990 09:12
Date: Mon, 25 Jun 1990 09:12
16 lines
1221 bytes
1221 bytes
vlr@dynsim2.uucp (Vic Rice) writes: >I have nn 6.4.5 installed on SCO ODT. I am also using Cnews. I can >not get MAIL to work from within nn. I have tried REC_MAIL = sendmail, It should be "sendmail -t" if you use sendmail. >Is anyone using both nn and Cnews on SCO UNIX with a successful nn MAIL >command ? I would appreciate any help I can get. There are two recmail replacements in the contrib directory - they may need a little tuning to run in your environment, but it should be trivial to get either of them running. -- Kim F. Storm <storm@texas.dk> No news is good news, Texas Instruments A/S, Denmark but nn is better!
Re: Can't MAIL from nn
Author: Vic Rice
Date: Wed, 27 Jun 1990 01:52
Date: Wed, 27 Jun 1990 01:52
21 lines
1561 bytes
1561 bytes
storm@texas.dk (Kim F. Storm) writes: >It should be "sendmail -t" if you use sendmail. That's what I did. I didn't exactly spell this out in my first post. I simply uncommented the sendmail line in config.h : #define REC_MAIL "/usr/lib/sendmail -t" /* sendmail */ >There are two recmail replacements in the contrib directory - they may >need a little tuning to run in your environment, but it should be >trivial to get either of them running. ^^^^^^^ All in the eye of the beholder !! (;-) I am not a MTA expert, nor do I have a desire to be. I might add the default MTA for SCO is MMDF. Rather than install smail, or whatever, I am guessing someone out there has jumped thru the requisite hoops to utilize MMDF for mailing from within nn. If not, I'll sit down for several hours (if I am lucky) and figure it out myself. In lieu of that, I am here (begging on my knees) for help. -- Dr. Victor L. Rice Litwin Process Automation
Re: Can't MAIL from nn
Author: Paul Davison (postmaster)
Date: Thu, 28 Jun 1990 12:55
Date: Thu, 28 Jun 1990 12:55
280 lines
8092 bytes
8092 bytes
In <1990Jun27.015255.6268@dynsim2.uucp> vlr@dynsim2.uucp (Vic Rice) writes:
>I am not a MTA expert, nor do I have a desire to be. I might add the
>default MTA for SCO is MMDF. Rather than install smail, or
>whatever, I am guessing someone out there has jumped thru the requisite
>hoops to utilize MMDF for mailing from within nn. If not, I'll sit
>down for several hours (if I am lucky) and figure it out myself. In
>lieu of that, I am here (begging on my knees) for help.
We run MMDF, and I fudged it to work. Change config.h to use the
"recmail" program, then install a recmail in /usr/lib/news that uses the
fake sendmail that MMDF provides. I had to change recmail to get it work
- I have no patches handy so here's the program. It is quite small.
------
/*
* This software is Copyright (c) 1986 by Rick Adams.
*
* Permission is hereby granted to copy, reproduce, redistribute or
* otherwise use this software as long as: there is no monetary
* profit gained specifically from the use or reproduction or this
* software, it is not sold, rented, traded or otherwise marketed, and
* this copyright notice is included prominently in any copy
* made.
*
* The author make no claims as to the fitness or correctness of
* this software for any use whatsoever, and it is provided as is.
* Any use of this software is at the user's own risk.
*
* recmail: read a mail message on stdin, grab all addresses in To and Cc
* lines, and pass the full message to all addressees. This is useful to
* send the output of a recently edited mail message (with headers edited too).
* It is similar to sendmail -t, but only assumes /bin/mail.
* To use your own mailer, e. g. nmail, compile with -DMAILER=my_mailer.
*/
#ifdef SCCSID
static char *SccsId = "@(#)recmail.c 1.16 9/24/87";
#endif /* SCCSID */
#include "params.h"
#define MAILER "/usr/lib/sendmail"
#ifndef MAILER
#define MAILER "/bin/mail"
#endif
char mailer[] = MAILER;
#define MAXRECIPS 100
char *recips[MAXRECIPS];
int nrecips = 0;
main()
{
FILE *fd;
char *tmpf;
FILE *errfd;
char *errf;
char linebuf[1024];
int i, pid, wpid;
int exstat;
char *mypath;
int goodcnt, badcnt;
char *mktemp(), *getenv();
tmpf = mktemp("/tmp/rmXXXXXX");
(void) close(creat(tmpf,0666));
fd = fopen(tmpf, "w");
errf = mktemp("/tmp/rmXXXXXX");
(void) close(creat(errf,0666));
errfd = fopen(errf, "w");
fprintf(errfd, "Subject: Returned mail\n");
fprintf(errfd, "\n ----- Transcript of session follows -----\n");
(void) fflush(errfd);
goodcnt = badcnt = 0;
while (fgets(linebuf, sizeof linebuf, stdin) != NULL) {
if ((strncmp(linebuf, "Bcc: ", 5) == 0 ||
strncmp(linebuf, "bcc: ", 5) == 0 ||
strncmp(linebuf, "BCC: ", 5) == 0)) {
if (linebuf[5] != '\n')
addrecips(linebuf+5);
}
else if (fputs(linebuf, fd) == EOF)
goto werror;
if (linebuf[0] == '\n')
break;
if ((strncmp(linebuf, "To: ", 4) == 0 ||
strncmp(linebuf, "to: ", 4) == 0 ||
strncmp(linebuf, "TO: ", 4) == 0 ||
strncmp(linebuf, "Cc: ", 4) == 0 ||
strncmp(linebuf, "cc: ", 4) == 0 ||
strncmp(linebuf, "CC: ", 4) == 0) &&
linebuf[4] != '\n')
addrecips(linebuf+4);
}
if (!feof(stdin)) {
while (fgets(linebuf, sizeof linebuf, stdin) != NULL) {
if (fputs(linebuf, fd) == EOF) {
werror:
printf("write error on temp file\n");
exit(2);
}
}
}
/*
* Append the contents of the .signature file (if it exists) to
* the end of the mail message
*/
{
char sigbuf[BUFSIZ];
register c;
register char *p = getenv("HOME");
FILE *infp;
if (p) {
(void) sprintf(sigbuf, "%s/%s", p, ".signature");
if (infp = fopen(sigbuf, "r")) {
fprintf(fd,"---\n");
while ((c = getc(infp)) != EOF)
putc(c,fd);
(void) fclose(infp);
}
}
}
(void) fclose(fd);
/*
* Force the path to only consider /bin and /usr/bin, since
* that's the version of mail we want (not /usr/ucb/mail)
*/
if (mailer[0] != '/') {
register int e;
extern char **environ;
for (e = 0; environ[e] != NULL; ++e)
if (strncmp(environ[e], "PATH=", 5) == 0) {
environ[e] = "PATH=/bin:/usr/bin";
break;
}
}
mypath = getenv("PATH");
if (mypath)
strcpy(mypath, "/bin:/usr/bin");
/*
* We send the copies out separately, because of a bug in
* USG's /bin/mail which will generate ANOTHER To: line,
* even though we already have one, if there are at least
* two recipients.
*/
for (i=0; i<nrecips; i++) {
/*
* mail recips[i] < tmpf
*/
pid = mailto(tmpf, errfd, recips[i]);
exstat = -1;
while ((wpid = wait(&exstat)) >= 0 && wpid != pid)
;
if (exstat == 0)
goodcnt++;
else
badcnt++;
}
if (badcnt) {
mailback(errfd, tmpf, errf);
(void) unlink(tmpf);
(void) unlink(errf);
exit(1);
} else if (goodcnt == 0) {
fprintf(errfd, "recmail: no 'To:' line\n");
mailback(errfd, tmpf, errf);
(void) unlink(tmpf);
(void) unlink(errf);
exit (1);
}
(void) unlink(tmpf);
(void) unlink(errf);
exit (0);
}
#define isok(c) (isprint(c) && (c) != ' ' && c != ',')
addrecips(line)
char *line;
{
char *front, *back, *tail;
char *malloc();
tail = line + strlen(line);
for (front=line; front < tail; ) {
while (!isok(*front) && front < tail)
front++;
if (front >= tail)
break; /* skip end of line garbage */
for (back=front; isok(*back); back++)
;
*back=0;
if (nrecips >= MAXRECIPS) {
printf("Too many destinations\n");
exit(2);
}
if ((recips[nrecips] = malloc(strlen(front) + 1)) == NULL) {
printf("Out of space\n");
exit(2);
}
(void) strcpy(recips[nrecips], front);
nrecips++;
front = back+1;
}
}
int
mailto(tmpf, errfd, recip)
char *tmpf;
FILE *errfd;
char *recip;
{
register int pid;
/*
* mail recips < tmpf
*/
while ((pid = vfork()) == -1) {
fprintf(stderr, "fork failed, waiting...\r\n");
sleep(60);
}
if (pid == 0) {
(void) close(0);
(void) open(tmpf, 0);
if (errfd != NULL) {
(void) close(1);
(void) dup(fileno(errfd));
(void) fclose(errfd);
(void) close(2);
(void) dup(1);
}
execlp(mailer, mailer, recip, (char *)0);
perror(mailer);
exit(1);
}
return pid;
}
mailback(errfd, tmpf, errf)
register FILE *errfd;
char *tmpf;
char *errf;
{
register FILE *fd;
register int c;
int exstat;
register int pid, wpid;
char *logn;
char *getlogin(), *getenv();
register struct passwd *pwd;
if ((fd = fopen(tmpf, "r")) != NULL) {
fprintf(errfd, "\n ----- Unsent message follows -----\n");
while ((c = getc(fd)) != EOF)
putc(c, errfd);
(void) fclose(fd);
}
(void) fclose(errfd);
if ((logn = getlogin()) == NULL && (logn = getenv("USER")) == NULL) {
if ((pwd = getpwuid(getuid())) == NULL)
return;
logn = pwd->pw_name;
}
pid = mailto(errf, (FILE *)NULL, logn);
while ((wpid = wait(&exstat)) >= 0 && wpid != pid)
;
}
--
Paul Davison (postmaster for uk.ac.qmw.cs)
UUCP: pd@qmw-cs.uucp | Computer Science Dept
Internet: pd%cs.qmw.ac.uk@nsfnet-relay.ac.uk | QMW, University of London
JANET: pd@uk.ac.qmw.cs | Mile End Road
Voice: +44 71 975 5250 (Direct Dial) | London E1 4NS
Re: Can't MAIL from nn
Author: Vic Rice
Date: Fri, 29 Jun 1990 03:34
Date: Fri, 29 Jun 1990 03:34
43 lines
2676 bytes
2676 bytes
pd@cs.qmw.ac.uk (Paul Davison (postmaster)) writes: >In <1990Jun27.015255.6268@dynsim2.uucp> vlr@dynsim2.uucp (Vic Rice) writes: >>I am not a MTA expert, nor do I have a desire to be. I might add the >>default MTA for SCO is MMDF. Rather than install smail, or >>whatever, I am guessing someone out there has jumped thru the requisite >>hoops to utilize MMDF for mailing from within nn. If not, I'll sit >>down for several hours (if I am lucky) and figure it out myself. In >>lieu of that, I am here (begging on my knees) for help. >We run MMDF, and I fudged it to work. Change config.h to use the >"recmail" program, then install a recmail in /usr/lib/news that uses the >fake sendmail that MMDF provides. I had to change recmail to get it work >- I have no patches handy so here's the program. It is quite small. Paul, thanks for the code. It works, ----but. I discovered another problem which may have prevented any of my previous attempts from working. I installed you recmail per your instructions. However, still no success. Since I figured your stuff should work, I decided to test it by hand. That is, type "recmail < stuff.txt" at the UNIX prompt. It worked !!! The stuff.txt file was mailed correctly. I think this is the setgid problem I have run into with several programs (e.g. ELM). I have never totally understood it. There is apparently a pecularity with SCO UNIX or generic SYS V/386 which prevents this from working as advertised. In the case of ELM, I needed to answer the following question with a NO : "Am I going to be running as a setgid program ?" A yes answer to the above prevented ELM from delivering mail. I can not find a similar configuration parameter for nn. (In case my above analysis is totally bogus, let me restate my symptoms ...) The bottom line is "recmail" will work fine when used manually, but will not work when invoked from within nn. Any ideas ??? -- Dr. Victor L. Rice Litwin Process Automation
Re: Can't MAIL from nn
Author: Paul Davison (postmaster)
Date: Fri, 29 Jun 1990 10:44
Date: Fri, 29 Jun 1990 10:44
30 lines
2283 bytes
2283 bytes
In <1990Jun29.033447.3512@dynsim2.uucp> vlr@dynsim2.uucp (Vic Rice) writes: >The bottom line is "recmail" will work fine when used manually, but will >not work when invoked from within nn. Any ideas ??? I think the setgid issue is a bit of a red herring for you. As I recall, elm may run as setgid "mail" so that it can access a /usr/spool/mail that is inaccessable to normal users. Whether you need setgid rather depends on how you have set that up. For elm to work with mmdf it shouldn't be setgid because (educated guess) it knows to look for ~vlr/.mail instead of /usr/spool/mail and so needs to have its user and group permissions the same as you. My /usr/lib/sendmail is setuid to the MMDF login, and no other programs are setuid or setgid. If I were you, my next action in debugging this would be to turn on MMDF logging (in the tailor file) and see what "submit" is saying about the attempt. I have heard that the SCO MMDF is slightly perverted from the "standard", so perhaps there are issues that we aren't aware of. I do have a mind to write a proper recmail that uses the normal MMDF "submit" mechanism instead of the awful fake sendmail. If/when I do this, I'll let you know. -- Paul Davison (postmaster for uk.ac.qmw.cs) UUCP: pd@qmw-cs.uucp | Computer Science Dept Internet: pd%cs.qmw.ac.uk@nsfnet-relay.ac.uk | QMW, University of London JANET: pd@uk.ac.qmw.cs | Mile End Road Voice: +44 71 975 5250 (Direct Dial) | London E1 4NS
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads