From pckizer@gonzo.tamu.edu Tue Apr 23 19:52:59 1996 From: pckizer@tamu.edu (Philip Kizer) Reply-To: pckizer@tamu.edu diff -c sendpage-7a/config.c sendpage/config.c *** sendpage-7a/config.c Wed Feb 14 03:49:18 1996 --- sendpage/config.c Tue Apr 23 18:01:55 1996 *************** *** 1245,1250 **** --- 1245,1256 ---- cbuf->bufused -= 1; x -= 1; + /* To decrease confusion, increment + * number of lines even on escaped + * newline. Not yet right, but + * closer. */ + ++*lineno; + continue; } diff -c sendpage-7a/io.c sendpage/io.c *** sendpage-7a/io.c Sun Feb 11 00:02:55 1996 --- sendpage/io.c Tue Apr 23 18:03:07 1996 *************** *** 63,74 **** * */ ! #ifdef sun ! #ifdef __svr4__ ! #define sunos5 #endif - #endif - #include #include --- 63,73 ---- * */ ! #if defined(sun) ! # if defined(__SVR4) && !defined(sunos5) ! # define sunos5 ! # endif #endif #include #include *************** *** 176,181 **** --- 175,186 ---- t.c_cflag = pcinfo->databits|pcinfo->parity|pcinfo->stopbits| CREAD|C_FLAG; + /* Is there a more portable way to do this? First need to clear + * out all speed bits, otherwise speed can be set to indeterminate + * value when just blindly ORing desired speed into the structure + */ + t.c_cflag &= (~31L); + t.c_cflag |= pcinfo->speed; /* local flags: *************** *** 940,946 **** break; } /* if */ #ifdef DEBUG ! if (debug > 2) report (LOG_INFO, "pet=%d, matchflag=%d, pet_lookup[].msglen=%d, pet_goodbytes[]=%d", pet, matchflag, pet_lookup[pet].msglen, pet_goodbytes[pet]); --- 945,951 ---- break; } /* if */ #ifdef DEBUG ! if (debug > 80) report (LOG_INFO, "pet=%d, matchflag=%d, pet_lookup[].msglen=%d, pet_goodbytes[]=%d", pet, matchflag, pet_lookup[pet].msglen, pet_goodbytes[pet]); *************** *** 959,965 **** goodbytes = pet_goodbytes[j]; #ifdef DEBUG ! if (debug > 2) report (LOG_INFO, "matchflag=%d, x=%d, bufused=%d, goodbytes=%d pet=%d", matchflag, x, cbuf->bufused, goodbytes, pet); #endif /* DEBUG */ --- 964,970 ---- goodbytes = pet_goodbytes[j]; #ifdef DEBUG ! if (debug > 40) report (LOG_INFO, "matchflag=%d, x=%d, bufused=%d, goodbytes=%d pet=%d", matchflag, x, cbuf->bufused, goodbytes, pet); #endif /* DEBUG */ diff -c sendpage-7a/queue.c sendpage/queue.c *** sendpage-7a/queue.c Tue Apr 23 17:47:41 1996 --- sendpage/queue.c Tue Apr 23 18:03:50 1996 *************** *** 176,181 **** --- 176,187 ---- entry->messagelen = strlen(message); entry->emailCCLen = strlen(emailCC); + /* Remove trailing whitespace (including NL) */ + while(entry->messagelen>1 && ( message[entry->messagelen-1]==' ' + || message[entry->messagelen-1]=='\n')) { + message[--entry->messagelen]='\0'; + } + /* construct prototype temp file */ sprintf(qfname, "%s%luXXXXXX", QUEUE_HEAD, entry->queuetime); *************** *** 1947,1953 **** int ret, err; DBT dbkey, dbval; char *c; ! int *trData; err = 1; /* bad */ --- 1953,1959 ---- int ret, err; DBT dbkey, dbval; char *c; ! int trData[256]; err = 1; /* bad */ *************** *** 1964,1970 **** if (!ret) { /* lookup success */ ! trData = dbval.data; for (c = msg; *c; ++c) *c = trData[*c]; --- 1970,1981 ---- if (!ret) { /* lookup success */ ! /* trData = dbval.data; /* Old */ ! /* Inefficient, but I have yet to figure out why Sun won't ! * let me access the memory area pointed to by dbval.data, ! * even when doing explicit casts. Alignment problems? ! */ ! memcpy(trData,dbval.data,256*sizeof(int)); for (c = msg; *c; ++c) *c = trData[*c]; diff -c sendpage-7a/sendpage.c sendpage/sendpage.c *** sendpage-7a/sendpage.c Wed Feb 14 00:43:26 1996 --- sendpage/sendpage.c Tue Apr 23 17:49:18 1996 *************** *** 98,104 **** --- 98,108 ---- char *sendpage_env[] = { + #if defined(solaris2) + "PATH=/usr/bin:/sbin:/usr/sbin", + #else "PATH=/bin:/usr/bin:/usr/ucb:", + #endif /* solaris2 */ "SHELL=/bin/sh", 0 }; diff -c sendpage-7a/sendpage.h sendpage/sendpage.h *** sendpage-7a/sendpage.h Wed Feb 14 04:46:30 1996 --- sendpage/sendpage.h Tue Apr 23 18:14:55 1996 *************** *** 14,22 **** #include ! #ifndef LINUX #include ! #endif /* LINUX */ #define PATH_SENDPAGE_CONFIG "/etc/sendpage.cf" #define PATH_SENDMAIL "/usr/lib/sendmail" --- 14,22 ---- #include ! #if !defined(LINUX) && !(defined(sun) && defined(__SVR4)) #include ! #endif /* LINUX & sunos5 */ #define PATH_SENDPAGE_CONFIG "/etc/sendpage.cf" #define PATH_SENDMAIL "/usr/lib/sendmail" *************** *** 25,31 **** #define QUEUE_HEAD "sendpageQ" /* define this to include the Remedy ARSystem notifier client gateway */ ! #define ARSYSTEM_NOTIFIER /* If the paging central server seems to drop carrier if you attempt to * negotiate a connection too quickly, then define the following. */ --- 25,31 ---- #define QUEUE_HEAD "sendpageQ" /* define this to include the Remedy ARSystem notifier client gateway */ ! /* #define ARSYSTEM_NOTIFIER /* ARSystem */ /* If the paging central server seems to drop carrier if you attempt to * negotiate a connection too quickly, then define the following. */ *************** *** 38,56 **** /* #define NEED_BZERO /**/ /* does your system support SYSV_MALLOC style mallinfo()? */ ! #define SYSV_MALLOC /* #define SYSV_MALLOC /* (No for IRIX, no for Solaris, no for Linux) no for BSDI */ /* does your system require malloc.h? */ #define NEED_MALLOC_H /* No for Linux */ ! /* does your system require ioctl.h -- (yes for AIX, yes for Digital UNIX) */ ! /* #define NEED_IOCTL_H */ ! /* does your system support posix style signals -- specifically sigaction()? */ ! #define POSIX_SIGNALS ! /* does your system use a posix style open -- yes for AIX4, yes for Linux */ ! /* #define POSIX_OPEN /**/ /* how long in seconds to wait between queue runs if the queue is not empty */ /* ie, the modem was busy so the queue run failed how long should it wait --- 38,56 ---- /* #define NEED_BZERO /**/ /* does your system support SYSV_MALLOC style mallinfo()? */ ! /* #define SYSV_MALLOC /* #define SYSV_MALLOC /* (No for IRIX, no for Solaris, no for Linux) no for BSDI */ /* does your system require malloc.h? */ #define NEED_MALLOC_H /* No for Linux */ ! /* does your system require ioctl.h -- (yes for AIX, yes for Digital UNIX, * yes for Solaris) */ ! #define NEED_IOCTL_H /**/ ! /* does your system support posix style signals -- specifically sigaction()? (yes for Solaris) */ ! #define POSIX_SIGNALS /**/ ! /* does your system use a posix style open -- yes for AIX4, yes for Linux, yes for Solaris */ ! #define POSIX_OPEN /**/ /* how long in seconds to wait between queue runs if the queue is not empty */ /* ie, the modem was busy so the queue run failed how long should it wait *************** *** 68,74 **** #define PIPE_READ_SECONDS 30 /* a few extra lines in the e-mail response */ ! /* #define VERBOSE_MAIL_REPLY */ /* use a less strict lookup table for the pet protocol, this shouldn't /* hurt anything */ --- 68,74 ---- #define PIPE_READ_SECONDS 30 /* a few extra lines in the e-mail response */ ! #define VERBOSE_MAIL_REPLY /* */ /* use a less strict lookup table for the pet protocol, this shouldn't /* hurt anything */ *************** *** 77,88 **** /* Define to syslog facility to use. Defaults to LOG_DEAMON if it exists on your machine. No syslogging otherwise. */ #ifdef LOG_DAEMON ! #define LOG_SENDPAGE LOG_MAIL #endif /* Use this value as the default maximum length of a page message if neither your "pc" or "profile" defines a maxMsgSize. */ ! #define DEFAULT_MAX_PAGELEN 60 /* enable uucp style locking? Doing this requires you to have sendpage --- 77,88 ---- /* Define to syslog facility to use. Defaults to LOG_DEAMON if it exists on your machine. No syslogging otherwise. */ #ifdef LOG_DAEMON ! #define LOG_SENDPAGE LOG_LOCAL5 #endif /* Use this value as the default maximum length of a page message if neither your "pc" or "profile" defines a maxMsgSize. */ ! #define DEFAULT_MAX_PAGELEN 75 /* enable uucp style locking? Doing this requires you to have sendpage *************** *** 93,100 **** be a root account (look for things like a root crontab running uucp owned accounting scripts) */ ! /* #define UUCP_LOCKING */ ! /* #define TTY_LOCKDIR "/usr/spool/locks/" /* define this to ignore reply addresses with | or / in them. Both /* these characters will be interpreted by sendmail, and could allow --- 93,100 ---- be a root account (look for things like a root crontab running uucp owned accounting scripts) */ ! #define UUCP_LOCKING /**/ ! #define TTY_LOCKDIR "/usr/spool/locks/" /**/ /* define this to ignore reply addresses with | or / in them. Both /* these characters will be interpreted by sendmail, and could allow *************** *** 122,138 **** */ /* defaults */ ! #define MODEM_DEV "/dev/ttyb" /* #define MODEM_DEV "/dev/ttyh0" /* Sun ALM-II */ /* #define MODEM_DEV "/dev/tty00" /* HP/UX */ /* #define MODEM_DEV "/dev/modem" /* Linux */ /* Note: Interesting "gotcha": since the modem may be in echo mode when the following string is sent, and since the code expects "0\r" as the ack, do NOT end the following string with a "0". */ /* #define MODEM_INIT "AT&FE0&C1&D1L1M1Q0V0H0X4" /* GVC 14.4K complete */ /* #define MODEM_INIT "at&F&C1&D1EL3M1QVX4H" /**/ ! #define MODEM_INIT "ATEQVX4HS7=120" /* Simple */ /* #define MODEM_INIT "at&F&C1&D1EL3M1QVX4H" /* MultiModem V32 */ /* c_cflag hardware settings... set to 0 for none */ /* see io.c */ --- 122,140 ---- */ /* defaults */ ! /* #define MODEM_DEV "/dev/ttyb" /* Default */ /* #define MODEM_DEV "/dev/ttyh0" /* Sun ALM-II */ /* #define MODEM_DEV "/dev/tty00" /* HP/UX */ /* #define MODEM_DEV "/dev/modem" /* Linux */ + #define MODEM_DEV "/dev/cua/a" /* Solaris */ /* Note: Interesting "gotcha": since the modem may be in echo mode when the following string is sent, and since the code expects "0\r" as the ack, do NOT end the following string with a "0". */ /* #define MODEM_INIT "AT&FE0&C1&D1L1M1Q0V0H0X4" /* GVC 14.4K complete */ /* #define MODEM_INIT "at&F&C1&D1EL3M1QVX4H" /**/ ! /* #define MODEM_INIT "ATEQVX4HS7=120" /* Simple */ /* #define MODEM_INIT "at&F&C1&D1EL3M1QVX4H" /* MultiModem V32 */ + #define MODEM_INIT "ATEQVX4L1HS7=120S11=55" /* Simple + Shorter DTMF */ /* c_cflag hardware settings... set to 0 for none */ /* see io.c */ diff -c sendpage-7a/testpet.c sendpage/testpet.c *** sendpage-7a/testpet.c Fri Feb 9 03:18:25 1996 --- sendpage/testpet.c Tue Apr 23 12:08:01 1996 *************** *** 229,232 **** fprintf(stderr, "usage: testpet -p phone -r recipient -m message [-d debuglevel]\n"); fprintf(stderr, "\nexample: testpet -p \"98465504\" -r 999999 -m \"take a vacation\" -d99\n\n"); ! }; --- 229,232 ---- fprintf(stderr, "usage: testpet -p phone -r recipient -m message [-d debuglevel]\n"); fprintf(stderr, "\nexample: testpet -p \"98465504\" -r 999999 -m \"take a vacation\" -d99\n\n"); ! } -philip ____________________________________________________________ Philip Kizer ___ Texas A&M CIS Operating Systems Group, Unix ( 409.862.4120 ) pckizer@tamu.edu "When even one American--who has done nothing wrong--is forced by fear to shut his mind and close his mouth, then all Americans are in peril." Harry Truman