Fixes for html pages creation
This commit is contained in:
parent
4dba20c64f
commit
7478093023
8
Makefile
8
Makefile
@ -133,6 +133,14 @@ install:
|
||||
${CHOWN} ${OWNER}.${GROUP} ${PREFIX}/ftp/pub/local ; \
|
||||
chmod 0755 ${PREFIX}/ftp/pub/local ; \
|
||||
fi
|
||||
@if [ ! -d ${PREFIX}/ftp/pub/css ] ; then \
|
||||
mkdir ${PREFIX}/ftp/pub/css ; \
|
||||
${CHOWN} ${OWNER}.${GROUP} ${PREFIX}/ftp/pub/css ; \
|
||||
chmod 0755 ${PREFIX}/ftp/pub/css ; \
|
||||
fi
|
||||
@if [ ! -f ${PREFIX}/ftp/pub/css/files.css ]; then \
|
||||
${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0444 files.css ${PREFIX}/ftp/pub/css ; \
|
||||
fi
|
||||
@if [ ! -d ${PREFIX}/var/bso ] ; then \
|
||||
mkdir ${PREFIX}/var/nodelist ; \
|
||||
mkdir ${PREFIX}/var/bso ; \
|
||||
|
149
mbfido/bounce.c
Normal file
149
mbfido/bounce.c
Normal file
@ -0,0 +1,149 @@
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $Id$
|
||||
* Purpose ...............: Bounce Netmail
|
||||
*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1997-2002
|
||||
*
|
||||
* Michiel Broek FIDO: 2:280/2802
|
||||
* Beekmansbos 10
|
||||
* 1971 BV IJmuiden
|
||||
* the Netherlands
|
||||
*
|
||||
* This file is part of MBSE BBS.
|
||||
*
|
||||
* This BBS is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2, or (at your option) any
|
||||
* later version.
|
||||
*
|
||||
* MBSE BBS is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with MBSE BBS; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "../lib/libs.h"
|
||||
#include "../lib/structs.h"
|
||||
#include "../lib/users.h"
|
||||
#include "../lib/records.h"
|
||||
#include "../lib/common.h"
|
||||
#include "../lib/clcomm.h"
|
||||
#include "../lib/msg.h"
|
||||
#include "../lib/msgtext.h"
|
||||
#include "../lib/dbcfg.h"
|
||||
#include "../lib/dbnode.h"
|
||||
#include "../lib/dbtic.h"
|
||||
#include "../lib/dbdupe.h"
|
||||
#include "../lib/dbuser.h"
|
||||
#include "../lib/dbftn.h"
|
||||
#include "sendmail.h"
|
||||
#include "mgrutil.h"
|
||||
#include "postnetmail.h"
|
||||
#include "ping.h"
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* External declarations
|
||||
*/
|
||||
extern int do_quiet;
|
||||
extern char *tearline;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Global variables
|
||||
*/
|
||||
extern int net_in; /* Netmails received */
|
||||
extern int net_out; /* Netmails forwarded */
|
||||
extern int net_bad; /* Bad netmails (tracking errors */
|
||||
extern char *msgid; /* Original message id */
|
||||
|
||||
|
||||
|
||||
int Bounce(faddr *f, faddr *t, FILE *fp, char *reason)
|
||||
{
|
||||
int rc = 0, count = 0;
|
||||
char *Buf;
|
||||
FILE *np;
|
||||
time_t Now;
|
||||
faddr *from;
|
||||
|
||||
Now = time(NULL);
|
||||
if (SearchFidonet(f->zone))
|
||||
f->domain = xstrcpy(fidonet.domain);
|
||||
|
||||
Syslog('+', "Bounce msg from %s", ascfnode(f, 0xff));
|
||||
Buf = calloc(2049, sizeof(char));
|
||||
rewind(fp);
|
||||
|
||||
np = tmpfile();
|
||||
from = bestaka_s(f);
|
||||
from->zone = t->zone;
|
||||
from->net = t->net;
|
||||
from->node = t->node;
|
||||
from->point = t->point;
|
||||
from->name = xstrcpy((char *)"Postmaster");
|
||||
|
||||
if (f->point)
|
||||
fprintf(np, "\001TOPT %d\r", f->point);
|
||||
if (from->point)
|
||||
fprintf(np, "\001FMPT %d\r", from->point);
|
||||
fprintf(np, "\001INTL %d:%d/%d %d:%d/%d\r", f->zone, f->net, f->node, from->zone, from->net, from->node);
|
||||
|
||||
/*
|
||||
* Add MSGID, REPLY and PID
|
||||
*/
|
||||
fprintf(np, "\001MSGID: %s %08lx\r", ascfnode(from, 0x1f), sequencer());
|
||||
while ((fgets(Buf, 2048, fp)) != NULL) {
|
||||
Striplf(Buf);
|
||||
if (strncmp(Buf, "\001MSGID:", 7) == 0) {
|
||||
fprintf(np, "\001REPLY:%s\r", Buf+7);
|
||||
}
|
||||
}
|
||||
fprintf(np, "\001PID: MBSE-FIDO %s\r", VERSION);
|
||||
fprintf(np, "\001TZUTC: %s\r", gmtoffset(Now));
|
||||
|
||||
fprintf(np, " Dear %s\r\r", MBSE_SS(f->name));
|
||||
fprintf(np, "Your message could not be delevered, reason: %s\r\r", reason);
|
||||
fprintf(np, "Here are the first lines of the original message from you:\r\r");
|
||||
fprintf(np, "======================================================================\r");
|
||||
|
||||
rewind(fp);
|
||||
while ((fgets(Buf, 2048, fp)) != NULL) {
|
||||
Striplf(Buf);
|
||||
if (Buf[0] == '\001') {
|
||||
fprintf(np, "^a");
|
||||
fwrite(Buf + 1, strlen(Buf) -1, 1, np);
|
||||
} else {
|
||||
fwrite(Buf, strlen(Buf), 1, np);
|
||||
}
|
||||
fputc('\r', np);
|
||||
count++;
|
||||
if (count == 50)
|
||||
break;
|
||||
}
|
||||
fprintf(np, "======================================================================\r");
|
||||
if (count == 50) {
|
||||
fprintf(np, "\rOnly the first 50 lines are displayed\r");
|
||||
}
|
||||
|
||||
fprintf(np, "\rWith regards, %s\r\r", CFG.sysop_name);
|
||||
fprintf(np, "%s\r", tearline);
|
||||
Now = time(NULL) - (gmt_offset((time_t)0) * 60);
|
||||
rc = postnetmail(np, from, f, NULL, (char *)"Bounced message", Now, 0x0000, FALSE);
|
||||
tidy_faddr(from);
|
||||
|
||||
fclose(np);
|
||||
|
||||
free(Buf);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
9
mbfido/bounce.h
Normal file
9
mbfido/bounce.h
Normal file
@ -0,0 +1,9 @@
|
||||
#ifndef _BOUNCEMGR_H
|
||||
#define _BOUNCEMGR_H
|
||||
|
||||
|
||||
int Bounce(faddr *, faddr *, FILE *, char *);
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -186,7 +186,7 @@ FILE *newpage(char *Name, char *Title)
|
||||
fprintf(fa, "<META http-equiv=\"Content-Type\" content=\"text/html; charset=%s\">\n", CFG.www_charset);
|
||||
fprintf(fa, "<META name=\"%s\" lang=\"en\" content=\"%s\">\n", CFG.www_author, outbuf);
|
||||
fprintf(fa, "<HEAD>\n<TITLE>%s</TITLE>\n", outbuf);
|
||||
fprintf(fa, "<LINK rel=stylesheet HREF=\"%s/css/files.css\">\n", CFG.www_url);
|
||||
fprintf(fa, "<LINK rel=stylesheet HREF=\"%s/%s/css/files.css\">\n", CFG.www_url, CFG.www_link2ftp);
|
||||
fprintf(fa, "<STYLE TYPE=\"text/css\">\n");
|
||||
fprintf(fa, "</STYLE>\n</HEAD>\n<BODY>\n<A NAME=top></A>\n");
|
||||
fprintf(fa, "<H1 align=center>%s</H1><P>\n", Title);
|
||||
|
@ -330,7 +330,7 @@ FILE *newpage(char *Path, char *Name, time_t later, int inArea, int Current)
|
||||
fprintf(fa, "<META http-equiv=\"Content-Type\" content=\"text/html; charset=%s\">\n", CFG.www_charset);
|
||||
fprintf(fa, "<META name=\"%s\" lang=\"en\" content=\"%s\">\n", CFG.www_author, outbuf);
|
||||
fprintf(fa, "<HEAD><TITLE>%s</TITLE>\n", outbuf);
|
||||
fprintf(fa, "<LINK rel=stylesheet HREF=\"%s/css/files.css\">\n", CFG.www_url);
|
||||
fprintf(fa, "<LINK rel=stylesheet HREF=\"%s/%s/css/files.css\">\n", CFG.www_url, CFG.www_link2ftp);
|
||||
fprintf(fa, "<STYLE TYPE=\"text/css\">\n");
|
||||
fprintf(fa, "</STYLE>\n</HEAD>\n<BODY>\n");
|
||||
pagelink(fa, Path, inArea, Current);
|
||||
@ -455,7 +455,7 @@ void Index(void)
|
||||
fprintf(fm, "<META http-equiv=\"Content-Type\" content=\"text/html; charset=%s\">\n", CFG.www_charset);
|
||||
fprintf(fm, "<META name=\"%s\" lang=\"en\" content=\"%s\">\n", CFG.www_author, outbuf);
|
||||
fprintf(fm, "<HEAD><TITLE>%s</TITLE>\n", outbuf);
|
||||
fprintf(fm, "<LINK rel=stylesheet HREF=\"%s/css/files.css\">\n", CFG.www_url);
|
||||
fprintf(fm, "<LINK rel=stylesheet HREF=\"%s/%s/css/files.css\">\n", CFG.www_url, CFG.www_link2ftp);
|
||||
fprintf(fm, "<STYLE TYPE=\"text/css\">\n");
|
||||
fprintf(fm, "</STYLE>\n</HEAD>\n<BODY>\n");
|
||||
fprintf(fm, "<H2 align=center>%s</H2><P>\n", outbuf);
|
||||
|
Reference in New Issue
Block a user