Made ftn2rfc more safe
This commit is contained in:
parent
080ece1387
commit
e390e118c3
@ -1,4 +1,4 @@
|
||||
# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
|
||||
# Makefile.in generated automatically by automake 1.4 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
@ -104,7 +104,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
$(ACLOCAL_M4): configure.in acinclude.m4
|
||||
cd $(srcdir) && $(ACLOCAL)
|
||||
|
||||
config.status: $(srcdir)/configure.in $(CONFIG_STATUS_DEPENDENCIES)
|
||||
config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
@ -281,7 +281,7 @@ distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
cp -pr $$/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|
2
aclocal.m4
vendored
2
aclocal.m4
vendored
@ -1,4 +1,4 @@
|
||||
dnl aclocal.m4 generated automatically by aclocal 1.4-p4
|
||||
dnl aclocal.m4 generated automatically by aclocal 1.4
|
||||
|
||||
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
|
388
config.h.in
388
config.h.in
@ -1,33 +1,87 @@
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
/* acconfig.h for the MBSE BBS package */
|
||||
|
||||
#define AUTHOR @COPYRIGHT@
|
||||
/* Define to empty if the keyword does not work. */
|
||||
#undef const
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef gid_t
|
||||
|
||||
/* Define if you don't have vprintf but do have _doprnt. */
|
||||
#undef HAVE_DOPRNT
|
||||
|
||||
/* Define if your system has a working fnmatch function. */
|
||||
#undef HAVE_FNMATCH
|
||||
|
||||
/* Define if your struct stat has st_blksize. */
|
||||
#undef HAVE_ST_BLKSIZE
|
||||
|
||||
/* Define if you have the strftime function. */
|
||||
#undef HAVE_STRFTIME
|
||||
|
||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
#undef HAVE_SYS_WAIT_H
|
||||
|
||||
/* Define if your struct tm has tm_zone. */
|
||||
#undef HAVE_TM_ZONE
|
||||
|
||||
/* Define if you don't have tm_zone but do have the external array
|
||||
tzname. */
|
||||
#undef HAVE_TZNAME
|
||||
|
||||
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
||||
#undef HAVE_UTIME_NULL
|
||||
|
||||
/* Define if you have <vfork.h>. */
|
||||
#undef HAVE_VFORK_H
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
#undef HAVE_VPRINTF
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef mode_t
|
||||
|
||||
/* Define to `long' if <sys/types.h> doesn't define. */
|
||||
#undef off_t
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef pid_t
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
/* Define if the `setpgrp' function takes no argument. */
|
||||
#undef SETPGRP_VOID
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
#undef size_t
|
||||
|
||||
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
|
||||
#undef STAT_MACROS_BROKEN
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#undef TIME_WITH_SYS_TIME
|
||||
|
||||
/* Define if your <sys/time.h> declares struct tm. */
|
||||
#undef TM_IN_SYS_TIME
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef uid_t
|
||||
|
||||
/* Define vfork as fork if vfork does not work. */
|
||||
#undef vfork
|
||||
|
||||
/* Define if lex declares yytext as a char * by default, not a char[]. */
|
||||
#undef YYTEXT_POINTER
|
||||
|
||||
/* Memory debugging */
|
||||
#undef MEMWATCH
|
||||
|
||||
/* Has strcasestr function */
|
||||
#undef HAVE_STRCASESTR
|
||||
|
||||
/* Has mkstemp function */
|
||||
#undef HAVE_MKSTEMP
|
||||
|
||||
/* If you have gettimeofday function */
|
||||
#undef HAVE_DECLARED_TIMEZONE
|
||||
#undef HAVE_TM_GMTOFF
|
||||
|
||||
/* If you don't have pid_t */
|
||||
#undef DONT_HAVE_PID_T
|
||||
|
||||
/* Believe ZFIN */
|
||||
#undef BELEIVE_ZFIN
|
||||
|
||||
/* NOPROTO in lhash.h ??? */
|
||||
#undef NOPROTO
|
||||
|
||||
/* No Hash Comp function */
|
||||
#undef NO_HASH_COMP
|
||||
|
||||
/* News postings */
|
||||
#undef RESTAMP_FUTURE_POSTINGS
|
||||
#undef RESTAMP_OLD_POSTINGS
|
||||
@ -56,270 +110,168 @@
|
||||
#undef PAM
|
||||
#undef SW_CRYPT
|
||||
|
||||
|
||||
/* That's it */
|
||||
|
||||
/* Define if you have the `a64l' function. */
|
||||
/* Define if you have the a64l function. */
|
||||
#undef HAVE_A64L
|
||||
|
||||
/* Define if you have the `c64i' function. */
|
||||
/* Define if you have the c64i function. */
|
||||
#undef HAVE_C64I
|
||||
|
||||
/* Define if you have the <crypt.h> header file. */
|
||||
#undef HAVE_CRYPT_H
|
||||
|
||||
/* Define if you have the <dirent.h> header file, and it defines `DIR'. */
|
||||
#undef HAVE_DIRENT_H
|
||||
|
||||
/* Define if you don't have `vprintf' but do have `_doprnt.' */
|
||||
#undef HAVE_DOPRNT
|
||||
|
||||
/* Define if you have the `fchmod' function. */
|
||||
/* Define if you have the fchmod function. */
|
||||
#undef HAVE_FCHMOD
|
||||
|
||||
/* Define if you have the `fchown' function. */
|
||||
/* Define if you have the fchown function. */
|
||||
#undef HAVE_FCHOWN
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
/* Define if you have the `fdatasync' function. */
|
||||
/* Define if you have the fdatasync function. */
|
||||
#undef HAVE_FDATASYNC
|
||||
|
||||
/* Define if your system has a working `fnmatch' function. */
|
||||
#undef HAVE_FNMATCH
|
||||
|
||||
/* Define if you have the `fsync' function. */
|
||||
/* Define if you have the fsync function. */
|
||||
#undef HAVE_FSYNC
|
||||
|
||||
/* Define if you have the `getcwd' function. */
|
||||
/* Define if you have the getcwd function. */
|
||||
#undef HAVE_GETCWD
|
||||
|
||||
/* Define if you have the `gethostname' function. */
|
||||
/* Define if you have the gethostname function. */
|
||||
#undef HAVE_GETHOSTNAME
|
||||
|
||||
/* Define if you have the `gettimeofday' function. */
|
||||
/* Define if you have the gettimeofday function. */
|
||||
#undef HAVE_GETTIMEOFDAY
|
||||
|
||||
/* Define if you have the `getwd' function. */
|
||||
/* Define if you have the getwd function. */
|
||||
#undef HAVE_GETWD
|
||||
|
||||
/* Define if you have the <gshadow.h> header file. */
|
||||
#undef HAVE_GSHADOW_H
|
||||
|
||||
/* Define if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define if you have the `lckpwdf' function. */
|
||||
/* Define if you have the lckpwdf function. */
|
||||
#undef HAVE_LCKPWDF
|
||||
|
||||
/* Define if you have the <malloc.h> header file. */
|
||||
#undef HAVE_MALLOC_H
|
||||
|
||||
/* Define if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define if you have the `mkdir' function. */
|
||||
/* Define if you have the mkdir function. */
|
||||
#undef HAVE_MKDIR
|
||||
|
||||
/* Define if you have the `mkstemp' function. */
|
||||
/* Define if you have the mkstemp function. */
|
||||
#undef HAVE_MKSTEMP
|
||||
|
||||
/* Define if you have the `mktime' function. */
|
||||
/* Define if you have the mktime function. */
|
||||
#undef HAVE_MKTIME
|
||||
|
||||
/* Define if you have the <ndir.h> header file, and it defines `DIR'. */
|
||||
#undef HAVE_NDIR_H
|
||||
|
||||
/* Define if you have the <netinet/in.h> header file. */
|
||||
#undef HAVE_NETINET_IN_H
|
||||
|
||||
/* Define if you have the `putenv' function. */
|
||||
/* Define if you have the putenv function. */
|
||||
#undef HAVE_PUTENV
|
||||
|
||||
/* Define if you have the `putpwent' function. */
|
||||
/* Define if you have the putpwent function. */
|
||||
#undef HAVE_PUTPWENT
|
||||
|
||||
/* Define if you have the `regcmp' function. */
|
||||
#undef HAVE_REGCMP
|
||||
|
||||
/* Define if you have the `regcomp' function. */
|
||||
#undef HAVE_REGCOMP
|
||||
|
||||
/* Define if you have the <regex.h> header file. */
|
||||
#undef HAVE_REGEX_H
|
||||
|
||||
/* Define if you have the `re_comp' function. */
|
||||
/* Define if you have the re_comp function. */
|
||||
#undef HAVE_RE_COMP
|
||||
|
||||
/* Define if you have the `rmdir' function. */
|
||||
/* Define if you have the regcmp function. */
|
||||
#undef HAVE_REGCMP
|
||||
|
||||
/* Define if you have the regcomp function. */
|
||||
#undef HAVE_REGCOMP
|
||||
|
||||
/* Define if you have the rmdir function. */
|
||||
#undef HAVE_RMDIR
|
||||
|
||||
/* Define if you have the `select' function. */
|
||||
/* Define if you have the select function. */
|
||||
#undef HAVE_SELECT
|
||||
|
||||
/* Define if you have the <shadow.h> header file. */
|
||||
#undef HAVE_SHADOW_H
|
||||
|
||||
/* Define if you have the `socket' function. */
|
||||
/* Define if you have the socket function. */
|
||||
#undef HAVE_SOCKET
|
||||
|
||||
/* Define if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define if you have the `strcasestr' function. */
|
||||
/* Define if you have the strcasestr function. */
|
||||
#undef HAVE_STRCASESTR
|
||||
|
||||
/* Define if you have the `strcspn' function. */
|
||||
/* Define if you have the strcspn function. */
|
||||
#undef HAVE_STRCSPN
|
||||
|
||||
/* Define if you have the `strdup' function. */
|
||||
/* Define if you have the strdup function. */
|
||||
#undef HAVE_STRDUP
|
||||
|
||||
/* Define if you have the `strerror' function. */
|
||||
/* Define if you have the strerror function. */
|
||||
#undef HAVE_STRERROR
|
||||
|
||||
/* Define if you have the `strftime' function. */
|
||||
#undef HAVE_STRFTIME
|
||||
|
||||
/* Define if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define if you have the `strspn' function. */
|
||||
/* Define if you have the strspn function. */
|
||||
#undef HAVE_STRSPN
|
||||
|
||||
/* Define if you have the `strstr' function. */
|
||||
/* Define if you have the strstr function. */
|
||||
#undef HAVE_STRSTR
|
||||
|
||||
/* Define if you have the `strtol' function. */
|
||||
/* Define if you have the strtol function. */
|
||||
#undef HAVE_STRTOL
|
||||
|
||||
/* Define if you have the `strtoul' function. */
|
||||
/* Define if you have the strtoul function. */
|
||||
#undef HAVE_STRTOUL
|
||||
|
||||
/* Define if `st_blksize' is member of `struct stat'. */
|
||||
#undef HAVE_STRUCT_STAT_ST_BLKSIZE
|
||||
|
||||
/* Define if `tm_zone' is member of `struct tm'. */
|
||||
#undef HAVE_STRUCT_TM_TM_ZONE
|
||||
|
||||
/* Define if your `struct stat' has `st_blksize'. Deprecated, use
|
||||
`HAVE_STRUCT_STAT_ST_BLKSIZE' instead. */
|
||||
#undef HAVE_ST_BLKSIZE
|
||||
|
||||
/* Define if you have the <syslog.h> header file. */
|
||||
#undef HAVE_SYSLOG_H
|
||||
|
||||
/* Define if you have the <sys/dir.h> header file, and it defines `DIR'. */
|
||||
#undef HAVE_SYS_DIR_H
|
||||
|
||||
/* Define if you have the <sys/file.h> header file. */
|
||||
#undef HAVE_SYS_FILE_H
|
||||
|
||||
/* Define if you have the <sys/ioctl.h> header file. */
|
||||
#undef HAVE_SYS_IOCTL_H
|
||||
|
||||
/* Define if you have the <sys/ndir.h> header file, and it defines `DIR'. */
|
||||
#undef HAVE_SYS_NDIR_H
|
||||
|
||||
/* Define if you have the <sys/resource.h> header file. */
|
||||
#undef HAVE_SYS_RESOURCE_H
|
||||
|
||||
/* Define if you have the <sys/time.h> header file. */
|
||||
#undef HAVE_SYS_TIME_H
|
||||
|
||||
/* Define if you have the <sys/vfs.h> header file. */
|
||||
#undef HAVE_SYS_VFS_H
|
||||
|
||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
#undef HAVE_SYS_WAIT_H
|
||||
|
||||
/* Define if you have the <termios.h> header file. */
|
||||
#undef HAVE_TERMIOS_H
|
||||
|
||||
/* Define if your `struct tm' has `tm_zone'. Deprecated, use
|
||||
`HAVE_STRUCT_TM_TM_ZONE' instead. */
|
||||
#undef HAVE_TM_ZONE
|
||||
|
||||
/* Define if you don't have `tm_zone' but do have the external array `tzname'.
|
||||
*/
|
||||
#undef HAVE_TZNAME
|
||||
|
||||
/* Define if you have the <ulimit.h> header file. */
|
||||
#undef HAVE_ULIMIT_H
|
||||
|
||||
/* Define if you have the `uname' function. */
|
||||
/* Define if you have the uname function. */
|
||||
#undef HAVE_UNAME
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
/* Define if you have the <crypt.h> header file. */
|
||||
#undef HAVE_CRYPT_H
|
||||
|
||||
/* Define if you have the <dirent.h> header file. */
|
||||
#undef HAVE_DIRENT_H
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
/* Define if you have the <gshadow.h> header file. */
|
||||
#undef HAVE_GSHADOW_H
|
||||
|
||||
/* Define if you have the <malloc.h> header file. */
|
||||
#undef HAVE_MALLOC_H
|
||||
|
||||
/* Define if you have the <ndir.h> header file. */
|
||||
#undef HAVE_NDIR_H
|
||||
|
||||
/* Define if you have the <netinet/in.h> header file. */
|
||||
#undef HAVE_NETINET_IN_H
|
||||
|
||||
/* Define if you have the <regex.h> header file. */
|
||||
#undef HAVE_REGEX_H
|
||||
|
||||
/* Define if you have the <shadow.h> header file. */
|
||||
#undef HAVE_SHADOW_H
|
||||
|
||||
/* Define if you have the <sys/dir.h> header file. */
|
||||
#undef HAVE_SYS_DIR_H
|
||||
|
||||
/* Define if you have the <sys/file.h> header file. */
|
||||
#undef HAVE_SYS_FILE_H
|
||||
|
||||
/* Define if you have the <sys/ioctl.h> header file. */
|
||||
#undef HAVE_SYS_IOCTL_H
|
||||
|
||||
/* Define if you have the <sys/ndir.h> header file. */
|
||||
#undef HAVE_SYS_NDIR_H
|
||||
|
||||
/* Define if you have the <sys/resource.h> header file. */
|
||||
#undef HAVE_SYS_RESOURCE_H
|
||||
|
||||
/* Define if you have the <sys/time.h> header file. */
|
||||
#undef HAVE_SYS_TIME_H
|
||||
|
||||
/* Define if you have the <sys/vfs.h> header file. */
|
||||
#undef HAVE_SYS_VFS_H
|
||||
|
||||
/* Define if you have the <syslog.h> header file. */
|
||||
#undef HAVE_SYSLOG_H
|
||||
|
||||
/* Define if you have the <termios.h> header file. */
|
||||
#undef HAVE_TERMIOS_H
|
||||
|
||||
/* Define if you have the <ulimit.h> header file. */
|
||||
#undef HAVE_ULIMIT_H
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define if you have the <usersec.h> header file. */
|
||||
/* Define if you have the <usersec.h> header file. */
|
||||
#undef HAVE_USERSEC_H
|
||||
|
||||
/* Define if you have the <utime.h> header file. */
|
||||
/* Define if you have the <utime.h> header file. */
|
||||
#undef HAVE_UTIME_H
|
||||
|
||||
/* Define if `utime(file, NULL)' sets file's timestamp to the present. */
|
||||
#undef HAVE_UTIME_NULL
|
||||
|
||||
/* Define if you have the <vfork.h> header file. */
|
||||
#undef HAVE_VFORK_H
|
||||
|
||||
/* Define if you have the `vprintf' function. */
|
||||
#undef HAVE_VPRINTF
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define as the return type of signal handlers (`int' or `void'). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
/* Define if the `setpgrp' function takes no argument. */
|
||||
#undef SETPGRP_VOID
|
||||
|
||||
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
|
||||
#undef STAT_MACROS_BROKEN
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#undef TIME_WITH_SYS_TIME
|
||||
|
||||
/* Define if your <sys/time.h> declares `struct tm'. */
|
||||
#undef TM_IN_SYS_TIME
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Define if `lex' declares `yytext' as a `char *' by default, not a `char[]'.
|
||||
*/
|
||||
#undef YYTEXT_POINTER
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
#undef const
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef gid_t
|
||||
|
||||
/* Define to `int' if <sys/types.h> does not define. */
|
||||
#undef mode_t
|
||||
|
||||
/* Define to `long' if <sys/types.h> does not define. */
|
||||
#undef off_t
|
||||
|
||||
/* Define to `int' if <sys/types.h> does not define. */
|
||||
#undef pid_t
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> does not define. */
|
||||
#undef size_t
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef uid_t
|
||||
|
||||
/* Define as `fork' if `vfork' does not work. */
|
||||
#undef vfork
|
||||
|
606
mbfido/ftn2rfc.c
606
mbfido/ftn2rfc.c
@ -2,7 +2,7 @@
|
||||
*
|
||||
* File ..................: mbfido/ftn2rfc.c
|
||||
* Purpose ...............: Gate netmail->email or echomail->news
|
||||
* Last modification date : 27-Oct-2001
|
||||
* Last modification date : 29-Oct-2001
|
||||
*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1997-2001
|
||||
@ -266,21 +266,13 @@ void substitute(char *buf)
|
||||
/*
|
||||
* Lines to send, if it is a newsarticle, the Message-Id is checked.
|
||||
*/
|
||||
void Send(int, const char *, ...);
|
||||
void Send(int newsmode, const char *format, ...)
|
||||
void Send(int, char *);
|
||||
void Send(int newsmode, char *outstr)
|
||||
{
|
||||
char *outstr, *p;
|
||||
va_list va_ptr;
|
||||
char *p;
|
||||
unsigned long crc;
|
||||
|
||||
outstr = calloc(2048, sizeof(char));
|
||||
|
||||
va_start(va_ptr, format);
|
||||
vsprintf(outstr, format, va_ptr);
|
||||
va_end(va_ptr);
|
||||
|
||||
fwrite(outstr, 1, strlen(outstr), nfp);
|
||||
|
||||
if (newsmode) {
|
||||
Striplf(outstr);
|
||||
if (strncmp(outstr, (char*)"Message-ID: ", 12) == 0) {
|
||||
@ -332,7 +324,7 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl
|
||||
struct utsname utsbuf;
|
||||
char MailFrom[128], MailTo[128];
|
||||
|
||||
temp = calloc(2048, sizeof(char));
|
||||
temp = calloc(32768, sizeof(char));
|
||||
tmsg = &kmsg;
|
||||
tear_off = orig_off = via_off = 0L;
|
||||
rbuf = NULL;
|
||||
@ -812,7 +804,9 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl
|
||||
q = xstrcat(q, p);
|
||||
} else
|
||||
q = xstrcat(q, (char *)"not-for-mail");
|
||||
Send(newsmode, "%s\n", q);
|
||||
sprintf(temp, "%s\n", q);
|
||||
Send(newsmode, temp);
|
||||
free(q);
|
||||
|
||||
if ((p = hdr((char *)"Newsgroups",msg))) {
|
||||
/*
|
||||
@ -833,40 +827,54 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl
|
||||
if (p) {
|
||||
while (*p && isspace(*p))
|
||||
p++;
|
||||
Send(newsmode,"Newsgroups: %s\n",newsgroup);
|
||||
Send(newsmode,"X-Origin-Newsgroups: %s",p);
|
||||
} else
|
||||
Send(newsmode,"Newsgroups: %s\n",newsgroup);
|
||||
|
||||
if ((p=hdr((char *)"Distribution",msg)))
|
||||
Send(newsmode,"Distribution:%s",p);
|
||||
else if ((p=hdr((char *)"RFC-Distribution",kmsg)))
|
||||
Send(newsmode,"Distribution: %s",p);
|
||||
else if ((p=hdr((char *)"Distribution",kmsg)))
|
||||
Send(newsmode,"Distribution: %s",p);
|
||||
else if (distribution)
|
||||
Send(newsmode,"Distribution: %s\n",distribution);
|
||||
sprintf(temp,"Newsgroups: %s\n",newsgroup);
|
||||
Send(newsmode, temp);
|
||||
sprintf(temp,"X-Origin-Newsgroups: %s",p);
|
||||
Send(newsmode, temp);
|
||||
} else {
|
||||
sprintf(temp,"Newsgroups: %s\n",newsgroup);
|
||||
Send(newsmode, temp);
|
||||
}
|
||||
|
||||
if ((p=hdr((char *)"Distribution",msg))) {
|
||||
sprintf(temp,"Distribution:%s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"RFC-Distribution",kmsg))) {
|
||||
sprintf(temp,"Distribution: %s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"Distribution",kmsg))) {
|
||||
sprintf(temp,"Distribution: %s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if (distribution) {
|
||||
sprintf(temp,"Distribution: %s\n",distribution);
|
||||
Send(newsmode, temp);
|
||||
}
|
||||
|
||||
p = hdr((char *)"Comment-To",msg);
|
||||
if (p == NULL)
|
||||
p=hdr((char *)"X-Comment-To",msg);
|
||||
if (p == NULL)
|
||||
p=hdr((char *)"To",msg);
|
||||
if ((p) && (strcasecmp(p,"All\n")))
|
||||
Send(newsmode,"X-Comment-To:%s",hdrconv(p,outcode,incode));
|
||||
else {
|
||||
if ((p) && (strcasecmp(p,"All\n"))) {
|
||||
sprintf(temp,"X-Comment-To:%s",hdrconv(p,outcode,incode));
|
||||
Send(newsmode, temp);
|
||||
} else {
|
||||
if (p == NULL)
|
||||
p=hdr((char *)"RFC-X-Comment-To",kmsg);
|
||||
if (p == NULL)
|
||||
p=hdr((char *)"RFC-Comment-To",kmsg);
|
||||
if (p == NULL)
|
||||
p=hdr((char *)"RFC-To",kmsg);
|
||||
if ((p) && (strcasecmp(p,"All\n")))
|
||||
Send(newsmode,"X-Comment-To: %s",hdrconv(p,outcode,incode));
|
||||
else if ((t) && (t->name) && (strcasecmp(t->name,"All")))
|
||||
Send(newsmode,"X-Comment-To: %s\n",hdrconv(t->name,outcode,incode));
|
||||
else
|
||||
Send(newsmode,"X-Comment-To: All\n");
|
||||
if ((p) && (strcasecmp(p,"All\n"))) {
|
||||
sprintf(temp,"X-Comment-To: %s",hdrconv(p,outcode,incode));
|
||||
Send(newsmode, temp);
|
||||
} else if ((t) && (t->name) && (strcasecmp(t->name,"All"))) {
|
||||
sprintf(temp,"X-Comment-To: %s\n",hdrconv(t->name,outcode,incode));
|
||||
Send(newsmode, temp);
|
||||
} else {
|
||||
sprintf(temp,"X-Comment-To: All\n");
|
||||
Send(newsmode, temp);
|
||||
}
|
||||
}
|
||||
|
||||
// for (tmpml=approve;tmpml;tmpml=tmpml->next) {
|
||||
@ -877,14 +885,19 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl
|
||||
// }
|
||||
// }
|
||||
|
||||
if ((p=hdr((char *)"Approved",msg)))
|
||||
Send(newsmode,"Approved:%s",p);
|
||||
else if ((p=hdr((char *)"RFC-Approved",kmsg)))
|
||||
Send(newsmode,"Approved: %s",p);
|
||||
else if ((p=hdr((char *)"Approved",kmsg)))
|
||||
Send(newsmode,"Approved: %s",p);
|
||||
else if (modtype==2)
|
||||
Send(newsmode,"Approved: %s\n",moderator);
|
||||
if ((p=hdr((char *)"Approved",msg))) {
|
||||
sprintf(temp,"Approved:%s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"RFC-Approved",kmsg))) {
|
||||
sprintf(temp,"Approved: %s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"Approved",kmsg))) {
|
||||
sprintf(temp,"Approved: %s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if (modtype==2) {
|
||||
sprintf(temp,"Approved: %s\n",moderator);
|
||||
Send(newsmode, temp);
|
||||
}
|
||||
|
||||
} else { /* if newsmode */
|
||||
time(&now);
|
||||
@ -893,24 +906,39 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl
|
||||
* Probaly not needed as messages for systems without ISP never get here.
|
||||
* Perhaps only news to moderators.
|
||||
*/
|
||||
Send(FALSE, "From: %s!", ascinode(f,0x3f));
|
||||
Send(FALSE, "%s %s", ascinode(f,0x40), ctime(&mdate));
|
||||
sprintf(temp, "From %s!%s %s", ascinode(f,0x3f), ascinode(f,0x40), ctime(&mdate));
|
||||
Send(FALSE, temp);
|
||||
}
|
||||
for (qmsg = kmsg; qmsg; qmsg = qmsg->next)
|
||||
if (!strcasecmp(qmsg->key,"RFC-Received"))
|
||||
Send(FALSE, "%s: %s", qmsg->key+4, qmsg->val);
|
||||
for (qmsg = msg; qmsg; qmsg = qmsg->next)
|
||||
if (!strcasecmp(qmsg->key,"Received"))
|
||||
Send(FALSE, "%s:%s", qmsg->key, qmsg->val);
|
||||
|
||||
if ((p=hdr((char *)"Apparently-To",msg)))
|
||||
Send(FALSE, "Apparently-To: %s\n",p);
|
||||
else if ((p=hdr((char *)"RFC-Apparently-To",kmsg)))
|
||||
Send(FALSE, "Apparently-To: %s\n",p);
|
||||
else if ((p=hdr((char *)"Apparently-To",kmsg)))
|
||||
Send(FALSE, "Apparently-To: %s\n",p);
|
||||
else if ((is_local(t)))
|
||||
Send(FALSE, "Apparently-To: %s\n",buf);
|
||||
sprintf(temp, "Received: from %s by %s\n", ascinode(f,0x3f), ascinode(bestaka,0x3f));
|
||||
Send(FALSE, temp);
|
||||
sprintf(temp, "\twith FTN (mbfido v.%s) id AA%u; %s\n", VERSION, getpid(), rfcdate(now));
|
||||
Send(FALSE, temp);
|
||||
|
||||
for (qmsg = kmsg; qmsg; qmsg = qmsg->next)
|
||||
if (!strcasecmp(qmsg->key,"RFC-Received")) {
|
||||
sprintf(temp, "%s: %s", qmsg->key+4, qmsg->val);
|
||||
Send(FALSE, temp);
|
||||
}
|
||||
for (qmsg = msg; qmsg; qmsg = qmsg->next)
|
||||
if (!strcasecmp(qmsg->key,"Received")) {
|
||||
sprintf(temp, "%s:%s", qmsg->key, qmsg->val);
|
||||
Send(FALSE, temp);
|
||||
}
|
||||
|
||||
if ((p=hdr((char *)"Apparently-To",msg))) {
|
||||
sprintf(temp, "Apparently-To: %s\n",p);
|
||||
Send(FALSE, temp);
|
||||
} else if ((p=hdr((char *)"RFC-Apparently-To",kmsg))) {
|
||||
sprintf(temp, "Apparently-To: %s\n",p);
|
||||
Send(FALSE, temp);
|
||||
} else if ((p=hdr((char *)"Apparently-To",kmsg))) {
|
||||
sprintf(temp, "Apparently-To: %s\n",p);
|
||||
Send(FALSE, temp);
|
||||
} else if ((is_local(t))) {
|
||||
sprintf(temp, "Apparently-To: %s\n",buf);
|
||||
Send(FALSE, temp);
|
||||
}
|
||||
|
||||
if (flags & M_RRQ)
|
||||
rrq=TRUE;
|
||||
@ -920,7 +948,8 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl
|
||||
!hdr((char *)"Return-Receipt-To",msg) &&
|
||||
!hdr((char *)"RFC-Notice-Requested-Upon-Delivery-To",kmsg) &&
|
||||
!hdr((char *)"Notice-Requested-Upon-Delivery-To",msg)) {
|
||||
Send(FALSE,"Notice-Requested-Upon-Delivery-To: %s\n",buf);
|
||||
sprintf(temp,"Notice-Requested-Upon-Delivery-To: %s\n",buf);
|
||||
Send(FALSE, temp);
|
||||
}
|
||||
|
||||
if (t->name == NULL)
|
||||
@ -929,7 +958,8 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl
|
||||
if (p == NULL)
|
||||
p=hdr((char *)"To",msg);
|
||||
if (p) {
|
||||
Send(FALSE,"To:%s",p);
|
||||
sprintf(temp,"To:%s",p);
|
||||
Send(FALSE, temp);
|
||||
} else {
|
||||
if (p == NULL)
|
||||
p=hdr((char *)"RFC-Resent-To",kmsg);
|
||||
@ -937,36 +967,44 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl
|
||||
p=hdr((char *)"RFC-To",kmsg);
|
||||
if (p) {
|
||||
Syslog('m', "2");
|
||||
Send(FALSE,"To: %s\n",p);
|
||||
} else if (modtype == 1)
|
||||
Send(FALSE,"To: %s\n",moderator);
|
||||
else if (is_local(t)) {
|
||||
sprintf(temp,"To: %s\n",p);
|
||||
Send(FALSE, temp);
|
||||
} else if (modtype == 1) {
|
||||
sprintf(temp,"To: %s\n",moderator);
|
||||
Send(FALSE, temp);
|
||||
} else if (is_local(t)) {
|
||||
Syslog('m', "3");
|
||||
Send(FALSE, "To: %s <%s>\n", t->name, buf);
|
||||
sprintf(temp, "To: %s <%s>\n", t->name, buf);
|
||||
Send(FALSE, temp);
|
||||
} else {
|
||||
Syslog('m', "4");
|
||||
Send(FALSE,"To: %s\n",ascinode(t,0xff));
|
||||
sprintf(temp,"To: %s\n",ascinode(t,0xff));
|
||||
Send(FALSE, temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((p = hdr((char *)"From",msg))) {
|
||||
Send(newsmode, "From:%s", hdrconv(p,outcode,incode));
|
||||
sprintf(temp, "From:%s", hdrconv(p,outcode,incode));
|
||||
Send(FALSE, temp);
|
||||
} else if ((p = hdr((char *)"RFC-From",kmsg))) {
|
||||
Syslog('m', "b");
|
||||
Send(newsmode, "From: %s", hdrconv(p,outcode,incode));
|
||||
sprintf(temp, "From: %s", hdrconv(p,outcode,incode));
|
||||
Send(FALSE, temp);
|
||||
} else if ((p = hdr((char *)"From\n",kmsg))) {
|
||||
Syslog('m', "c");
|
||||
Send(newsmode, "From: %s", hdrconv(p,outcode,incode));
|
||||
sprintf(temp, "From: %s", hdrconv(p,outcode,incode));
|
||||
Send(FALSE, temp);
|
||||
} else if ((p = hdr((char *)"X-PcBoard-FROM",msg))) {
|
||||
if (f->name) {
|
||||
while (isspace(*p))
|
||||
p++;
|
||||
p[strlen(p)-1] = '\0';
|
||||
Send(newsmode,"From: %s <%s>\n", hdrconv(f->name,outcode,incode), p);
|
||||
sprintf(temp,"From: %s <%s>\n", hdrconv(f->name,outcode,incode), p);
|
||||
} else {
|
||||
Send(newsmode,"From:%s\n", p);
|
||||
sprintf(temp,"From:%s\n", p);
|
||||
}
|
||||
Send(FALSE, temp);
|
||||
} else if ((hdr((char *)"REPLYADDR",kmsg)) && (p=xstrcpy(hdr((char *)"REPLYADDR",kmsg)))) {
|
||||
if (*(r=p+strlen(p)-1) == '\n')
|
||||
*(r--)='\0';
|
||||
@ -991,86 +1029,109 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl
|
||||
*r--='\0';
|
||||
}
|
||||
Syslog('m', "d");
|
||||
Send(newsmode,"From: \"%s\" <%s>\n",hdrconv(l,outcode,incode),p);
|
||||
sprintf(temp,"From: \"%s\" <%s>\n",hdrconv(l,outcode,incode),p);
|
||||
Send(FALSE, temp);
|
||||
free(q);
|
||||
} else if (f->name) {
|
||||
Syslog('m', "e");
|
||||
Send(newsmode,"From: \"%s\" <%s>\n",hdrconv(f->name,outcode,incode),p);
|
||||
sprintf(temp,"From: \"%s\" <%s>\n",hdrconv(f->name,outcode,incode),p);
|
||||
Send(FALSE, temp);
|
||||
} else {
|
||||
Syslog('m', "f");
|
||||
Send(newsmode,"From: %s\n",p);
|
||||
sprintf(temp,"From: %s\n",p);
|
||||
Send(FALSE, temp);
|
||||
}
|
||||
free(p);
|
||||
}
|
||||
|
||||
if (p)
|
||||
Send(newsmode,"X-FTN-Sender: %s\n",hdrconv(ascinode(f,0xff),outcode,incode));
|
||||
sprintf(temp,"X-FTN-Sender: %s\n",hdrconv(ascinode(f,0xff),outcode,incode));
|
||||
else
|
||||
Send(newsmode,"From: %s\n",hdrconv(ascinode(f,0xff),outcode,incode));
|
||||
sprintf(temp,"From: %s\n",hdrconv(ascinode(f,0xff),outcode,incode));
|
||||
Send(newsmode, temp);
|
||||
|
||||
if ((p=hdr((char *)"Reply-To",msg)))
|
||||
Send(newsmode,"Reply-To:%s",p);
|
||||
else if ((p=hdr((char *)"RFC-Reply-To",kmsg)))
|
||||
Send(newsmode,"Reply-To: %s",p);
|
||||
else if ((p=hdr((char *)"Reply-To",kmsg)))
|
||||
Send(newsmode,"Reply-To: %s",p);
|
||||
else if (((p=backalias(f))) && strlen(CFG.sysdomain))
|
||||
Send(newsmode,"Reply-To: %s@%s\n",p,CFG.sysdomain);
|
||||
else if ((p=hdr((char *)"REPLYADDR",kmsg)))
|
||||
Send(newsmode,"Reply-To: %s",p);
|
||||
else if ((p=hdr((char *)"REPLYTO",kmsg)))
|
||||
Send(newsmode,"Reply-To: %s\n",ascinode(parsefaddr(p),0xff));
|
||||
|
||||
if ((p=hdr((char *)"Date",msg)))
|
||||
Send(newsmode,"Date:%s",p);
|
||||
else if ((p=hdr((char *)"RFC-Date",kmsg)))
|
||||
Send(newsmode,"Date: %s",p);
|
||||
else if ((p=hdr((char *)"Date",kmsg)))
|
||||
Send(newsmode,"Date: %s",p);
|
||||
else if (newsmode) {
|
||||
if ((p=hdr((char *)"Reply-To",msg))) {
|
||||
sprintf(temp,"Reply-To:%s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"RFC-Reply-To",kmsg))) {
|
||||
sprintf(temp,"Reply-To: %s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"Reply-To",kmsg))) {
|
||||
sprintf(temp,"Reply-To: %s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if (((p=backalias(f))) && strlen(CFG.sysdomain)) {
|
||||
sprintf(temp,"Reply-To: %s@%s\n",p,CFG.sysdomain);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"REPLYADDR",kmsg))) {
|
||||
sprintf(temp,"Reply-To: %s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"REPLYTO",kmsg))) {
|
||||
sprintf(temp,"Reply-To: %s\n",ascinode(parsefaddr(p),0xff));
|
||||
Send(newsmode, temp);
|
||||
}
|
||||
|
||||
if ((p=hdr((char *)"Date",msg))) {
|
||||
sprintf(temp,"Date:%s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"RFC-Date",kmsg))) {
|
||||
sprintf(temp,"Date: %s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"Date",kmsg))) {
|
||||
sprintf(temp,"Date: %s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if (newsmode) {
|
||||
/*
|
||||
* Restamp future postings
|
||||
*/
|
||||
if(mdate > time(&now)) {
|
||||
Syslog('+', "Future posting: %s", rfcdate(mdate));
|
||||
Send(newsmode,"Date: %s\n", rfcdate(now));
|
||||
Send(newsmode,"X-Origin-Date: %s\n", rfcdate(mdate));
|
||||
sprintf(temp,"Date: %s\n", rfcdate(now));
|
||||
Send(newsmode, temp);
|
||||
sprintf(temp,"X-Origin-Date: %s\n", rfcdate(mdate));
|
||||
Send(newsmode, temp);
|
||||
} else if((mdate < time(&now)-14*24*60*60) && (mdate > time(&now)-RESTAMP_OLD_POSTINGS*24*60*60)) {
|
||||
/*
|
||||
* Restamp old postings
|
||||
*/
|
||||
Syslog('+', "Article too old, restamped: %s", rfcdate(mdate));
|
||||
Send(newsmode,"Date: %s\n", rfcdate(now));
|
||||
Send(newsmode,"X-Origin-Date: %s\n", rfcdate(mdate));
|
||||
} else
|
||||
Send(newsmode,"Date: %s\n",rfcdate(mdate));
|
||||
} else
|
||||
Send(newsmode,"Date: %s\n",rfcdate(mdate));
|
||||
sprintf(temp,"Date: %s\n", rfcdate(now));
|
||||
Send(newsmode, temp);
|
||||
sprintf(temp,"X-Origin-Date: %s\n", rfcdate(mdate));
|
||||
Send(newsmode, temp);
|
||||
} else {
|
||||
sprintf(temp,"Date: %s\n",rfcdate(mdate));
|
||||
Send(newsmode, temp);
|
||||
}
|
||||
} else {
|
||||
sprintf(temp,"Date: %s\n",rfcdate(mdate));
|
||||
Send(newsmode, temp);
|
||||
}
|
||||
|
||||
if ((p = hdr((char *)"Subject",msg)))
|
||||
Send(newsmode, "Subject:%s", hdrconv(p,outcode,incode));
|
||||
sprintf(temp, "Subject:%s", hdrconv(p,outcode,incode));
|
||||
else if ((p = hdr((char *)"RFC-Subject",kmsg)))
|
||||
Send(newsmode, "Subject: %s", hdrconv(p,outcode,incode));
|
||||
sprintf(temp, "Subject: %s", hdrconv(p,outcode,incode));
|
||||
else if ((p = hdr((char *)"Subject",kmsg)))
|
||||
Send(newsmode, "Subject: %s", hdrconv(p,outcode,incode));
|
||||
sprintf(temp, "Subject: %s", hdrconv(p,outcode,incode));
|
||||
else if ((p = hdr((char *)"X-PcBoard-SUBJECT",msg)))
|
||||
Send(newsmode, "Subject:%s", hdrconv(p,outcode,incode));
|
||||
sprintf(temp, "Subject:%s", hdrconv(p,outcode,incode));
|
||||
else if (subj && (strspn(subj," \t\n\r") != strlen(subj)))
|
||||
Send(newsmode, "Subject: %s\n", hdrconv(subj,outcode,incode));
|
||||
sprintf(temp, "Subject: %s\n", hdrconv(subj,outcode,incode));
|
||||
else
|
||||
Send(newsmode, "Subject: <none>\n");
|
||||
sprintf(temp, "Subject: <none>\n");
|
||||
Send(newsmode, temp);
|
||||
|
||||
if ((p=hdr((char *)"Message-ID",msg)))
|
||||
Send(newsmode,"Message-ID:%s",p);
|
||||
sprintf(temp,"Message-ID:%s",p);
|
||||
else if ((p=hdr((char *)"RFC-Message-ID",kmsg)))
|
||||
Send(newsmode,"Message-ID: %s",p);
|
||||
sprintf(temp,"Message-ID: %s",p);
|
||||
else if ((p=hdr((char *)"Message-ID",kmsg)))
|
||||
Send(newsmode,"Message-ID: %s",p);
|
||||
sprintf(temp,"Message-ID: %s",p);
|
||||
else if ((p=hdr((char *)"RFCID",kmsg)))
|
||||
if ((p[0]=='<')) {
|
||||
/* "^aRFCID: <local@machine>" */
|
||||
if ((p[strlen(p)-2]=='>'))
|
||||
Send(newsmode,"Message-ID: %s",p);
|
||||
sprintf(temp,"Message-ID: %s",p);
|
||||
/* "^aRFCID: <local@machine" */
|
||||
/* I saw it on some IntToss gated articles
|
||||
* it seems to be a bug on the program or something
|
||||
@ -1079,122 +1140,162 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl
|
||||
*/
|
||||
else {
|
||||
p[strlen(p)-1]='\0';
|
||||
Send(newsmode,"Message-ID: %s>\n",p);
|
||||
sprintf(temp,"Message-ID: %s>\n",p);
|
||||
}
|
||||
}
|
||||
/* "^aRFCID: local@machine" */
|
||||
else {
|
||||
p[strlen(p)-1]='\0';
|
||||
Send(newsmode,"Message-ID: <%s>\n",p);
|
||||
} else if ((p=hdr((char *)"ORIGID",kmsg)))
|
||||
Send(newsmode,"Message-ID: %s",p);
|
||||
else if ((p = hdr((char *)"MSGID",kmsg))) {
|
||||
q = rfcmsgid(p, bestaka);
|
||||
Send(newsmode,"Message-ID: %s\n", q);
|
||||
free(q);
|
||||
} else
|
||||
Send(newsmode,"Message-ID: <%lu@%s.ftn>\n", mdate^(subj?str_crc32(subj):0L), ascinode(f,0x1f));
|
||||
/* "^aRFCID: local@machine" */
|
||||
} else {
|
||||
p[strlen(p)-1]='\0';
|
||||
sprintf(temp,"Message-ID: <%s>\n",p);
|
||||
} else if ((p=hdr((char *)"ORIGID",kmsg))) {
|
||||
sprintf(temp,"Message-ID: %s",p);
|
||||
} else if ((p = hdr((char *)"MSGID",kmsg))) {
|
||||
q = rfcmsgid(p, bestaka);
|
||||
sprintf(temp,"Message-ID: %s\n", q);
|
||||
free(q);
|
||||
} else
|
||||
sprintf(temp,"Message-ID: <%lu@%s.ftn>\n", mdate^(subj?str_crc32(subj):0L), ascinode(f,0x1f));
|
||||
Send(newsmode, temp);
|
||||
|
||||
if (newsmode) {
|
||||
if ((p=hdr((char *)"References",msg)))
|
||||
Send(newsmode,"References:%s",p);
|
||||
else if ((p=hdr((char *)"RFC-References",kmsg)))
|
||||
Send(newsmode,"References: %s",p);
|
||||
else if ((p=hdr((char *)"References",kmsg)))
|
||||
Send(newsmode,"References: %s",p);
|
||||
else if ((p=hdr((char *)"ORIGREF",kmsg)))
|
||||
Send(newsmode,"References: %s",p);
|
||||
else if ((p=hdr((char *)"REPLY",kmsg))) {
|
||||
if ((p=hdr((char *)"References",msg))) {
|
||||
sprintf(temp,"References:%s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"RFC-References",kmsg))) {
|
||||
sprintf(temp,"References: %s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"References",kmsg))) {
|
||||
sprintf(temp,"References: %s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"ORIGREF",kmsg))) {
|
||||
sprintf(temp,"References: %s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"REPLY",kmsg))) {
|
||||
q = rfcmsgid(p, bestaka);
|
||||
Send(newsmode,"References: %s\n", q);
|
||||
sprintf(temp,"References: %s\n", q);
|
||||
Send(newsmode, temp);
|
||||
free(q);
|
||||
}
|
||||
} else {
|
||||
if ((p=hdr((char *)"In-Reply-To",msg)))
|
||||
Send(newsmode,"In-Reply-To:%s",p);
|
||||
else if ((p=hdr((char *)"RFC-In-Reply-To",kmsg)))
|
||||
Send(newsmode,"In-Reply-To: %s",p);
|
||||
else if ((p=hdr((char *)"REPLY",kmsg))) {
|
||||
if ((p=hdr((char *)"In-Reply-To",msg))) {
|
||||
sprintf(temp,"In-Reply-To:%s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"RFC-In-Reply-To",kmsg))) {
|
||||
sprintf(temp,"In-Reply-To: %s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"REPLY",kmsg))) {
|
||||
q = rfcmsgid(p,bestaka);
|
||||
Send(newsmode,"In-Reply-To: %s\n", q);
|
||||
sprintf(temp,"In-Reply-To: %s\n", q);
|
||||
Send(newsmode, temp);
|
||||
free(q);
|
||||
}
|
||||
}
|
||||
|
||||
if ((p=hdr((char *)"Organization",msg)))
|
||||
Send(newsmode,"Organization:%s",hdrconv(p,outcode,incode));
|
||||
else if ((p=hdr((char *)"Organisation",msg)))
|
||||
Send(newsmode,"Organization:%s",hdrconv(p,outcode,incode));
|
||||
else if ((p=hdr((char *)"RFC-Organization",kmsg)))
|
||||
Send(newsmode,"Organization: %s",hdrconv(p,outcode,incode));
|
||||
else if ((p=hdr((char *)"RFC-Organisation",kmsg)))
|
||||
Send(newsmode,"Organization: %s",hdrconv(p,outcode,incode));
|
||||
else if ((p=hdr((char *)"Organization",kmsg)))
|
||||
Send(newsmode,"Organization: %s",hdrconv(p,outcode,incode));
|
||||
else if ((p=hdr((char *)"Organisation",kmsg)))
|
||||
Send(newsmode,"Organization: %s",hdrconv(p,outcode,incode));
|
||||
else if (origline)
|
||||
Send(newsmode,"Organization: %s\n",hdrconv(origline,outcode,incode));
|
||||
|
||||
if ((p=hdr((char *)"Supersedes",msg)))
|
||||
Send(newsmode,"Supersedes:%s",p);
|
||||
else if ((p=hdr((char *)"RFC-Supersedes",kmsg)))
|
||||
Send(newsmode,"Supersedes: %s",p);
|
||||
else if ((p=hdr((char *)"Supersedes",kmsg)))
|
||||
Send(newsmode,"Supersedes: %s",p);
|
||||
else if ((p=hdr((char *)"ACUPDATE",kmsg)) && (strstr(p,"MODIFY"))) {
|
||||
if ((p=hdr((char *)"Organization",msg))) {
|
||||
sprintf(temp,"Organization:%s",hdrconv(p,outcode,incode));
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"Organisation",msg))) {
|
||||
sprintf(temp,"Organization:%s",hdrconv(p,outcode,incode));
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"RFC-Organization",kmsg))) {
|
||||
sprintf(temp,"Organization: %s",hdrconv(p,outcode,incode));
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"RFC-Organisation",kmsg))) {
|
||||
sprintf(temp,"Organization: %s",hdrconv(p,outcode,incode));
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"Organization",kmsg))) {
|
||||
sprintf(temp,"Organization: %s",hdrconv(p,outcode,incode));
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"Organisation",kmsg))) {
|
||||
sprintf(temp,"Organization: %s",hdrconv(p,outcode,incode));
|
||||
Send(newsmode, temp);
|
||||
} else if (origline) {
|
||||
sprintf(temp,"Organization: %s\n",hdrconv(origline,outcode,incode));
|
||||
Send(newsmode, temp);
|
||||
}
|
||||
|
||||
if ((p=hdr((char *)"Supersedes",msg))) {
|
||||
sprintf(temp,"Supersedes:%s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"RFC-Supersedes",kmsg))) {
|
||||
sprintf(temp,"Supersedes: %s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"Supersedes",kmsg))) {
|
||||
sprintf(temp,"Supersedes: %s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"ACUPDATE",kmsg)) && (strstr(p,"MODIFY"))) {
|
||||
q = rfcmsgid(p+8,bestaka);
|
||||
Send(newsmode,"Supersedes: %s\n", q);
|
||||
sprintf(temp,"Supersedes: %s\n", q);
|
||||
Send(newsmode, temp);
|
||||
free(q);
|
||||
}
|
||||
|
||||
if (CFG.allowcontrol) {
|
||||
if ((p=hdr((char *)"Control",msg)))
|
||||
Send(newsmode,"Control:%s",p);
|
||||
else if ((p=hdr((char *)"RFC-Control",kmsg)))
|
||||
Send(newsmode,"Control: %s",p);
|
||||
else if ((p=hdr((char *)"Control",kmsg)))
|
||||
Send(newsmode,"Control: %s",p);
|
||||
else if ((p=hdr((char *)"ACUPDATE",kmsg)) && (strstr(p,"DELETE"))) {
|
||||
if ((p=hdr((char *)"Control",msg))) {
|
||||
sprintf(temp,"Control:%s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"RFC-Control",kmsg))) {
|
||||
sprintf(temp,"Control: %s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"Control",kmsg))) {
|
||||
sprintf(temp,"Control: %s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"ACUPDATE",kmsg)) && (strstr(p,"DELETE"))) {
|
||||
q = rfcmsgid(p+8,bestaka);
|
||||
Send(newsmode,"Control: cancel %s\n", q);
|
||||
sprintf(temp,"Control: cancel %s\n", q);
|
||||
Send(newsmode, temp);
|
||||
free(q);
|
||||
}
|
||||
}
|
||||
|
||||
Send(newsmode, "X-FTN-CHRS: %s\n", getchrs(incode));
|
||||
if (incode != outcode)
|
||||
Send(newsmode, "X-FTN-ORIGCHRS: %s\n", getchrs(outcode));
|
||||
sprintf(temp, "X-FTN-CHRS: %s\n", getchrs(incode));
|
||||
Send(newsmode, temp);
|
||||
if (incode != outcode) {
|
||||
sprintf(temp, "X-FTN-ORIGCHRS: %s\n", getchrs(outcode));
|
||||
Send(newsmode, temp);
|
||||
}
|
||||
charset = getcharset(incode);
|
||||
|
||||
if ((p=hdr((char *)"Mime-Version",msg)))
|
||||
Send(newsmode,(char *)"Mime-Version:%s",p);
|
||||
else if ((p=hdr((char *)"RFC-Mime-Version",kmsg)))
|
||||
Send(newsmode,(char *)"Mime-Version: %s",p);
|
||||
else if ((p=hdr((char *)"Mime-Version",kmsg)))
|
||||
Send(newsmode,(char *)"Mime-Version: %s",p);
|
||||
else if ((charset) && (incode != CHRS_NOTSET))
|
||||
Send(newsmode,"Mime-Version: 1.0\n");
|
||||
|
||||
temp[0] = '\0';
|
||||
if ((p=hdr((char *)"Content-Type",msg)))
|
||||
Send(newsmode,"Content-Type:%s",p);
|
||||
else if ((p=hdr((char *)"RFC-Content-Type",kmsg)))
|
||||
Send(newsmode,"Content-Type: %s",p);
|
||||
else if ((p=hdr((char *)"Content-Type",kmsg)))
|
||||
Send(newsmode,"Content-Type: %s",p);
|
||||
else if ((charset) && (incode != CHRS_NOTSET)) {
|
||||
if ((p=hdr((char *)"FSCHTML",kmsg)) || (p=hdr((char *)"HTML",kmsg)))
|
||||
Send(newsmode,"Content-Type: text/html; charset=%s\n",charset);
|
||||
else
|
||||
Send(newsmode,"Content-Type: text/plain; charset=%s\n",charset);
|
||||
if ((p=hdr((char *)"Mime-Version",msg))) {
|
||||
sprintf(temp,(char *)"Mime-Version:%s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"RFC-Mime-Version",kmsg))) {
|
||||
sprintf(temp,(char *)"Mime-Version: %s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"Mime-Version",kmsg))) {
|
||||
sprintf(temp,(char *)"Mime-Version: %s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((charset) && (incode != CHRS_NOTSET)) {
|
||||
sprintf(temp,"Mime-Version: 1.0\n");
|
||||
Send(newsmode, temp);
|
||||
}
|
||||
|
||||
if ((p=hdr((char *)"Content-Length",msg)))
|
||||
Send(newsmode,"Content-Length%s",p);
|
||||
else if ((p=hdr((char *)"RFC-Content-Length",kmsg)))
|
||||
Send(newsmode,"Content-Length: %s",p);
|
||||
else if ((p=hdr((char *)"Content-Length",kmsg)))
|
||||
Send(newsmode,"Content-Length: %s",p);
|
||||
if ((p=hdr((char *)"Content-Type",msg))) {
|
||||
sprintf(temp,"Content-Type:%s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"RFC-Content-Type",kmsg))) {
|
||||
sprintf(temp,"Content-Type: %s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"Content-Type",kmsg))) {
|
||||
sprintf(temp,"Content-Type: %s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((charset) && (incode != CHRS_NOTSET)) {
|
||||
if ((p=hdr((char *)"FSCHTML",kmsg)) || (p=hdr((char *)"HTML",kmsg)))
|
||||
sprintf(temp,"Content-Type: text/html; charset=%s\n",charset);
|
||||
else
|
||||
sprintf(temp,"Content-Type: text/plain; charset=%s\n",charset);
|
||||
Send(newsmode, temp);
|
||||
}
|
||||
|
||||
if ((p=hdr((char *)"Content-Length",msg))) {
|
||||
sprintf(temp,"Content-Length%s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"RFC-Content-Length",kmsg))) {
|
||||
sprintf(temp,"Content-Length: %s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"Content-Length",kmsg))) {
|
||||
sprintf(temp,"Content-Length: %s",p);
|
||||
Send(newsmode, temp);
|
||||
}
|
||||
|
||||
temp[0] = '\0';
|
||||
if ((p=hdr((char *)"Content-Transfer-Encoding",msg)))
|
||||
@ -1217,23 +1318,33 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl
|
||||
Send(newsmode, temp);
|
||||
|
||||
if (newsmode) {
|
||||
if ((p=hdr((char *)"X-Newsreader",msg)))
|
||||
Send(newsmode,"X-Newsreader: %s",p);
|
||||
else if ((p=hdr((char *)"RFC-X-Newsreader",kmsg)))
|
||||
Send(newsmode,"X-Newsreader: %s",p);
|
||||
else if ((p=hdr((char *)"X-Newsreader",kmsg)))
|
||||
Send(newsmode,"X-Newsreader: %s",p);
|
||||
else if ((p=hdr((char *)"PID",kmsg)))
|
||||
Send(newsmode,"X-Newsreader: %s",p);
|
||||
if ((p=hdr((char *)"X-Newsreader",msg))) {
|
||||
sprintf(temp,"X-Newsreader: %s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"RFC-X-Newsreader",kmsg))) {
|
||||
sprintf(temp,"X-Newsreader: %s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"X-Newsreader",kmsg))) {
|
||||
sprintf(temp,"X-Newsreader: %s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"PID",kmsg))) {
|
||||
sprintf(temp,"X-Newsreader: %s",p);
|
||||
Send(newsmode, temp);
|
||||
}
|
||||
} else {
|
||||
if ((p=hdr((char *)"X-Mailer",msg)))
|
||||
Send(newsmode,"X-Mailer:%s",p);
|
||||
else if ((p=hdr((char *)"RFC-X-Mailer",kmsg)))
|
||||
Send(newsmode,"X-Mailer: %s",p);
|
||||
else if ((p=hdr((char *)"X-Mailer",kmsg)))
|
||||
Send(newsmode,"X-Mailer: %s",p);
|
||||
else if ((p=hdr((char *)"PID",kmsg)))
|
||||
Send(newsmode,"X-Mailer: %s",p);
|
||||
if ((p=hdr((char *)"X-Mailer",msg))) {
|
||||
sprintf(temp,"X-Mailer:%s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"RFC-X-Mailer",kmsg))) {
|
||||
sprintf(temp,"X-Mailer: %s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"X-Mailer",kmsg))) {
|
||||
sprintf(temp,"X-Mailer: %s",p);
|
||||
Send(newsmode, temp);
|
||||
} else if ((p=hdr((char *)"PID",kmsg))) {
|
||||
sprintf(temp,"X-Mailer: %s",p);
|
||||
Send(newsmode, temp);
|
||||
}
|
||||
}
|
||||
|
||||
for (qmsg=msg;qmsg;qmsg=qmsg->next) {
|
||||
@ -1267,12 +1378,15 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl
|
||||
strcasecmp(qmsg->key,"Apparently-To") &&
|
||||
strcasecmp(qmsg->key,"Distribution") &&
|
||||
strcasecmp(qmsg->key,"Approved") &&
|
||||
strcasecmp(qmsg->key,"Message-ID"))
|
||||
Send(newsmode,"%s:%s",qmsg->key,hdrconv(qmsg->val,outcode,incode));
|
||||
strcasecmp(qmsg->key,"Message-ID")) {
|
||||
sprintf(temp,"%s:%s",qmsg->key,hdrconv(qmsg->val,outcode,incode));
|
||||
Send(newsmode, temp);
|
||||
}
|
||||
}
|
||||
|
||||
if ((p=compose_flags(flags,hdr((char *)"FLAGS",kmsg)))) {
|
||||
Send(newsmode,"X-FTN-FLAGS:%s\n",p);
|
||||
sprintf(temp,"X-FTN-FLAGS:%s\n",p);
|
||||
Send(newsmode, temp);
|
||||
free(p);
|
||||
}
|
||||
|
||||
@ -1344,16 +1458,22 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl
|
||||
strcasecmp(qmsg->key,"RFC-Distribution") &&
|
||||
strcasecmp(qmsg->key,"RFC-Approved") &&
|
||||
strcasecmp(qmsg->key,"RFC-Message-ID")) {
|
||||
if (!strncmp(qmsg->key,"RFC-",4))
|
||||
Send(newsmode,"%s: %s",qmsg->key+4,hdrconv(qmsg->val,outcode,incode));
|
||||
else if ((!strncasecmp(qmsg->key,"X-",2)) || (!strncasecmp(qmsg->key,"NNTP-",5)))
|
||||
Send(newsmode,"%s: %s",qmsg->key,hdrconv(qmsg->val,outcode,incode));
|
||||
else if ((!strncasecmp(qmsg->key,"ZC-",3)))
|
||||
Send(newsmode,"X-%s: %s",qmsg->key,qmsg->val);
|
||||
else if ((!strcasecmp(qmsg->key,"Origin")) || (!strcasecmp(qmsg->key,"MOOD")))
|
||||
Send(newsmode,"X-FTN-%s: %s",qmsg->key,hdrconv(qmsg->val,outcode,incode));
|
||||
else
|
||||
Send(newsmode,"X-FTN-%s: %s",qmsg->key,qmsg->val);
|
||||
if (!strncmp(qmsg->key,"RFC-",4)) {
|
||||
sprintf(temp,"%s: %s",qmsg->key+4,hdrconv(qmsg->val,outcode,incode));
|
||||
Send(newsmode, temp);
|
||||
} else if ((!strncasecmp(qmsg->key,"X-",2)) || (!strncasecmp(qmsg->key,"NNTP-",5))) {
|
||||
sprintf(temp,"%s: %s",qmsg->key,hdrconv(qmsg->val,outcode,incode));
|
||||
Send(newsmode, temp);
|
||||
} else if ((!strncasecmp(qmsg->key,"ZC-",3))) {
|
||||
sprintf(temp,"X-%s: %s",qmsg->key,qmsg->val);
|
||||
Send(newsmode, temp);
|
||||
} else if ((!strcasecmp(qmsg->key,"Origin")) || (!strcasecmp(qmsg->key,"MOOD"))) {
|
||||
sprintf(temp,"X-FTN-%s: %s",qmsg->key,hdrconv(qmsg->val,outcode,incode));
|
||||
Send(newsmode, temp);
|
||||
} else {
|
||||
sprintf(temp,"X-FTN-%s: %s",qmsg->key,qmsg->val);
|
||||
Send(newsmode, temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1383,7 +1503,8 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl
|
||||
seenlen+=strlen(sbe);
|
||||
if (seenlen > MAXPATH) {
|
||||
seenlen=0;
|
||||
Send(newsmode, "%s\n", q);
|
||||
sprintf(temp, "%s\n", q);
|
||||
Send(newsmode, temp);
|
||||
free(q);
|
||||
q = xstrcpy((char *)"X-FTN-PATH:");
|
||||
sprintf(sbe," %u/%u",tmpl->addr->net, tmpl->addr->node);
|
||||
@ -1391,12 +1512,15 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl
|
||||
}
|
||||
q = xstrcat(q, sbe);
|
||||
}
|
||||
Send(newsmode,"%s\n", q);
|
||||
sprintf(temp,"%s\n", q);
|
||||
Send(newsmode, temp);
|
||||
free(q);
|
||||
tidy_falist(&ptl);
|
||||
|
||||
if ((hdr((char *)"X-FTN-SPTH", msg)))
|
||||
Send(newsmode,"X-FTN-SPTH: %s\n", ascfnode(bestaka,0x1f));
|
||||
if ((hdr((char *)"X-FTN-SPTH", msg))) {
|
||||
sprintf(temp,"X-FTN-SPTH: %s\n", ascfnode(bestaka,0x1f));
|
||||
Send(newsmode, temp);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1425,7 +1549,7 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl
|
||||
|
||||
if ((p=hdr((char *)"X-Body-Start",msg))) {
|
||||
lines++;
|
||||
Send(newsmode, "%s", strkconv(p, outcode, incode));
|
||||
Send(newsmode, strkconv(p, outcode, incode));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user