Added experimental support for MsgEd

This commit is contained in:
Michiel Broek 2002-11-06 20:38:51 +00:00
parent b4d817cb15
commit 5112d57589
4 changed files with 115 additions and 43 deletions

View File

@ -50,6 +50,8 @@ v0.35.05 19-Oct-2002
In node setup the pack netmail switch is renamed and is now In node setup the pack netmail switch is renamed and is now
for all mail. Default for new records is Yes. for all mail. Default for new records is Yes.
Added length check when importing taglines. Added length check when importing taglines.
Now writes also ~/etc/msg.txt for MsgEd after messagebase is
updated.
mbfido: mbfido:
With ticfile processing, the KeepDate setup setting now works. With ticfile processing, the KeepDate setup setting now works.

View File

@ -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) void gold_areas(FILE *fp)
{ {
char *temp, *aka; char *temp, *aka;

View File

@ -1,6 +1,7 @@
#ifndef _MAREA_H #ifndef _MAREA_H
#define _MAREA_H #define _MAREA_H
/* $Id$ */
int OpenMsgarea(void); int OpenMsgarea(void);
void CloseMsgarea(int); void CloseMsgarea(int);
@ -10,6 +11,7 @@ int CountMsgarea(void);
void EditMsgarea(void); void EditMsgarea(void);
void InitMsgarea(void); void InitMsgarea(void);
void gold_areas(FILE *); void gold_areas(FILE *);
void msged_areas(FILE *);
int mail_area_doc(FILE *, FILE *, int); int mail_area_doc(FILE *, FILE *, int);
char *PickMsgarea(char *); char *PickMsgarea(char *);

View File

@ -84,54 +84,69 @@ int init = FALSE; /* Run init only */
static void die(int onsig) static void die(int onsig)
{ {
FILE *fp; FILE *fp;
char *temp; char *temp;
int i; int i;
signal(onsig, SIG_IGN); signal(onsig, SIG_IGN);
if (!init) if (!init)
screen_stop(); screen_stop();
if (exp_golded && (config_read() != -1)) { if (exp_golded && (config_read() != -1)) {
temp = calloc(128, sizeof(char)); temp = calloc(PATH_MAX, sizeof(char));
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); * Export ~/etc/msg.txt for MsgEd.
fprintf(fp, "; Basic information\n;\n"); */
if (strlen(CFG.sysop_name) && CFG.akavalid[0] && CFG.aka[0].zone) { sprintf(temp, "%s/etc/msg.txt", getenv("MBSE_ROOT"));
fprintf(fp, "USERNAME %s\n\n", CFG.sysop_name); if ((fp = fopen(temp, "w")) != NULL) {
fprintf(fp, "ADDRESS %s\n", aka2str(CFG.aka[0])); msged_areas(fp);
for (i = 1; i < 40; i++) fclose(fp);
if (CFG.akavalid[i]) Syslog('+', "Created new %s", temp);
fprintf(fp, "AKA %s\n", aka2str(CFG.aka[i])); } else {
fprintf(fp, "\n"); WriteError("$Could not create %s", temp);
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)) * Export ~/etc/golded.inc for GoldED
WriteError("MBSETUP finished on signal %s", SigName[onsig]); */
else sprintf(temp, "%s/etc/golded.inc", getenv("MBSE_ROOT"));
Syslog(' ', "MBSETUP finished"); if ((fp = fopen(temp, "w")) != NULL) {
ExitClient(onsig); 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);
} }