Added experimental support for MsgEd
This commit is contained in:
parent
b4d817cb15
commit
5112d57589
@ -50,6 +50,8 @@ v0.35.05 19-Oct-2002
|
||||
In node setup the pack netmail switch is renamed and is now
|
||||
for all mail. Default for new records is Yes.
|
||||
Added length check when importing taglines.
|
||||
Now writes also ~/etc/msg.txt for MsgEd after messagebase is
|
||||
updated.
|
||||
|
||||
mbfido:
|
||||
With ticfile processing, the KeepDate setup setting now works.
|
||||
|
@ -1615,6 +1615,59 @@ int NodeInMarea(fidoaddr A)
|
||||
|
||||
|
||||
|
||||
void msged_areas(FILE *fp)
|
||||
{
|
||||
char *temp, *aka;
|
||||
FILE *no;
|
||||
int i = 0;
|
||||
|
||||
temp = calloc(PATH_MAX, sizeof(char));
|
||||
sprintf(temp, "%s/etc/mareas.data", getenv("MBSE_ROOT"));
|
||||
if ((no = fopen(temp, "r")) == NULL)
|
||||
return;
|
||||
|
||||
fread(&msgshdr, sizeof(msgshdr), 1, no);
|
||||
fseek(no, 0, SEEK_SET);
|
||||
fread(&msgshdr, msgshdr.hdrsize, 1, no);
|
||||
|
||||
while (fread(&msgs, msgshdr.recsize, 1, no) == 1) {
|
||||
|
||||
i++;
|
||||
if (msgs.Active) {
|
||||
|
||||
fprintf(fp, "Jam ");
|
||||
|
||||
switch (msgs.Type) {
|
||||
case LOCALMAIL: fprintf(fp, "l"); break;
|
||||
case NETMAIL: fprintf(fp, "mp"); break;
|
||||
case ECHOMAIL: fprintf(fp, "e"); break;
|
||||
case NEWS: fprintf(fp, "e"); break;
|
||||
}
|
||||
|
||||
if (((msgs.Type == NEWS) || (msgs.Type == ECHOMAIL)) && strlen(msgs.Tag) && strlen(msgs.Newsgroup)) {
|
||||
fprintf(fp, "u");
|
||||
}
|
||||
fprintf(fp, "8");
|
||||
fprintf(fp, " \"%s\" %s", msgs.Name, msgs.Base);
|
||||
if (msgs.Type == ECHOMAIL)
|
||||
fprintf(fp, " %s", msgs.Tag);
|
||||
if (msgs.Type != LOCALMAIL) {
|
||||
aka = xstrcpy(strtok(aka2str(msgs.Aka), "@"));
|
||||
fprintf(fp, " %s", aka);
|
||||
free(aka);
|
||||
}
|
||||
fprintf(fp, "\n");
|
||||
}
|
||||
fseek(no, msgshdr.syssize, SEEK_CUR);
|
||||
}
|
||||
|
||||
fclose(no);
|
||||
free(temp);
|
||||
fprintf(fp, "\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
void gold_areas(FILE *fp)
|
||||
{
|
||||
char *temp, *aka;
|
||||
|
@ -1,6 +1,7 @@
|
||||
#ifndef _MAREA_H
|
||||
#define _MAREA_H
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
int OpenMsgarea(void);
|
||||
void CloseMsgarea(int);
|
||||
@ -10,6 +11,7 @@ int CountMsgarea(void);
|
||||
void EditMsgarea(void);
|
||||
void InitMsgarea(void);
|
||||
void gold_areas(FILE *);
|
||||
void msged_areas(FILE *);
|
||||
int mail_area_doc(FILE *, FILE *, int);
|
||||
char *PickMsgarea(char *);
|
||||
|
||||
|
@ -84,54 +84,69 @@ int init = FALSE; /* Run init only */
|
||||
|
||||
static void die(int onsig)
|
||||
{
|
||||
FILE *fp;
|
||||
char *temp;
|
||||
int i;
|
||||
FILE *fp;
|
||||
char *temp;
|
||||
int i;
|
||||
|
||||
signal(onsig, SIG_IGN);
|
||||
if (!init)
|
||||
screen_stop();
|
||||
signal(onsig, SIG_IGN);
|
||||
if (!init)
|
||||
screen_stop();
|
||||
|
||||
if (exp_golded && (config_read() != -1)) {
|
||||
temp = calloc(128, sizeof(char));
|
||||
sprintf(temp, "%s/etc/golded.inc", getenv("MBSE_ROOT"));
|
||||
if (exp_golded && (config_read() != -1)) {
|
||||
temp = calloc(PATH_MAX, sizeof(char));
|
||||
|
||||
if ((fp = fopen(temp, "w")) != NULL) {
|
||||
fprintf(fp, "; GoldED.inc -- Automatic created by mbsetup %s -- Do not edit!\n\n", VERSION);
|
||||
fprintf(fp, "; Basic information\n;\n");
|
||||
if (strlen(CFG.sysop_name) && CFG.akavalid[0] && CFG.aka[0].zone) {
|
||||
fprintf(fp, "USERNAME %s\n\n", CFG.sysop_name);
|
||||
fprintf(fp, "ADDRESS %s\n", aka2str(CFG.aka[0]));
|
||||
for (i = 1; i < 40; i++)
|
||||
if (CFG.akavalid[i])
|
||||
fprintf(fp, "AKA %s\n", aka2str(CFG.aka[i]));
|
||||
fprintf(fp, "\n");
|
||||
|
||||
gold_akamatch(fp);
|
||||
fprintf(fp, "; JAM MessageBase Setup\n;\n");
|
||||
fprintf(fp, "JAMPATH %s/tmp/\n", getenv("MBSE_ROOT"));
|
||||
fprintf(fp, "JAMHARDDELETE NO\n\n");
|
||||
|
||||
fprintf(fp, "; Semaphore files\n;\n");
|
||||
fprintf(fp, "SEMAPHORE NETSCAN %s/sema/mailout\n", getenv("MBSE_ROOT"));
|
||||
fprintf(fp, "SEMAPHORE ECHOSCAN %s/sema/mailout\n\n", getenv("MBSE_ROOT"));
|
||||
|
||||
gold_areas(fp);
|
||||
}
|
||||
Syslog('+', "Created new %s", temp);
|
||||
} else {
|
||||
WriteError("$Could not create %s", temp);
|
||||
}
|
||||
|
||||
free(temp);
|
||||
/*
|
||||
* Export ~/etc/msg.txt for MsgEd.
|
||||
*/
|
||||
sprintf(temp, "%s/etc/msg.txt", getenv("MBSE_ROOT"));
|
||||
if ((fp = fopen(temp, "w")) != NULL) {
|
||||
msged_areas(fp);
|
||||
fclose(fp);
|
||||
Syslog('+', "Created new %s", temp);
|
||||
} else {
|
||||
WriteError("$Could not create %s", temp);
|
||||
}
|
||||
|
||||
umask(oldmask);
|
||||
if (onsig && (onsig <= NSIG))
|
||||
WriteError("MBSETUP finished on signal %s", SigName[onsig]);
|
||||
else
|
||||
Syslog(' ', "MBSETUP finished");
|
||||
ExitClient(onsig);
|
||||
/*
|
||||
* Export ~/etc/golded.inc for GoldED
|
||||
*/
|
||||
sprintf(temp, "%s/etc/golded.inc", getenv("MBSE_ROOT"));
|
||||
if ((fp = fopen(temp, "w")) != NULL) {
|
||||
fprintf(fp, "; GoldED.inc -- Automatic created by mbsetup %s -- Do not edit!\n\n", VERSION);
|
||||
fprintf(fp, "; Basic information\n;\n");
|
||||
if (strlen(CFG.sysop_name) && CFG.akavalid[0] && CFG.aka[0].zone) {
|
||||
fprintf(fp, "USERNAME %s\n\n", CFG.sysop_name);
|
||||
fprintf(fp, "ADDRESS %s\n", aka2str(CFG.aka[0]));
|
||||
for (i = 1; i < 40; i++)
|
||||
if (CFG.akavalid[i])
|
||||
fprintf(fp, "AKA %s\n", aka2str(CFG.aka[i]));
|
||||
fprintf(fp, "\n");
|
||||
|
||||
gold_akamatch(fp);
|
||||
fprintf(fp, "; JAM MessageBase Setup\n;\n");
|
||||
fprintf(fp, "JAMPATH %s/tmp/\n", getenv("MBSE_ROOT"));
|
||||
fprintf(fp, "JAMHARDDELETE NO\n\n");
|
||||
|
||||
fprintf(fp, "; Semaphore files\n;\n");
|
||||
fprintf(fp, "SEMAPHORE NETSCAN %s/sema/mailout\n", getenv("MBSE_ROOT"));
|
||||
fprintf(fp, "SEMAPHORE ECHOSCAN %s/sema/mailout\n\n", getenv("MBSE_ROOT"));
|
||||
|
||||
gold_areas(fp);
|
||||
}
|
||||
Syslog('+', "Created new %s", temp);
|
||||
} else {
|
||||
WriteError("$Could not create %s", temp);
|
||||
}
|
||||
|
||||
free(temp);
|
||||
}
|
||||
|
||||
umask(oldmask);
|
||||
if (onsig && (onsig <= NSIG))
|
||||
WriteError("MBSETUP finished on signal %s", SigName[onsig]);
|
||||
else
|
||||
Syslog(' ', "MBSETUP finished");
|
||||
ExitClient(onsig);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user