fixes for mbfido news
This commit is contained in:
parent
3e2f009cb3
commit
c07e6d4fe0
@ -17,6 +17,10 @@ v0.51.4 11-Apr-2004
|
||||
Added loging of virus scanner results.
|
||||
When a new echomail area is auto created, the creation date and
|
||||
the newsgroup name will be set.
|
||||
Fixed news command, only real newsgroup areas are fetched from
|
||||
the remote newsserver.
|
||||
You may need to edit or remove /opt/mbse/tmp/newsout to remove
|
||||
postings for the remote newsserver with echomail messages.
|
||||
|
||||
mbnntp:
|
||||
New program, news server to read echomail with a news client.
|
||||
|
@ -282,7 +282,7 @@ void ScanFull()
|
||||
if (Link.aka.zone)
|
||||
ExportEcho(Link, Number, &sbl);
|
||||
}
|
||||
if (strlen(msgs.Newsgroup))
|
||||
if (strlen(msgs.Newsgroup) && (msgs.Type == NEWS))
|
||||
ExportNews(Number, &sbl);
|
||||
|
||||
tidy_falist(&sbl);
|
||||
@ -439,7 +439,7 @@ void ScanOne(char *path, unsigned long MsgNum)
|
||||
ExportEcho(Link, MsgNum, &sbl);
|
||||
}
|
||||
}
|
||||
if (strlen(msgs.Newsgroup))
|
||||
if (strlen(msgs.Newsgroup) && (msgs.Type == NEWS))
|
||||
ExportNews(MsgNum, &sbl);
|
||||
|
||||
tidy_falist(&sbl);
|
||||
|
@ -174,71 +174,71 @@ void Marker(void)
|
||||
*/
|
||||
void ScanNews(void)
|
||||
{
|
||||
List *art = NULL;
|
||||
POverview tmp, old;
|
||||
FILE *pAreas;
|
||||
char *sAreas;
|
||||
struct msgareashdr Msgshdr;
|
||||
struct msgareas Msgs;
|
||||
List *art = NULL;
|
||||
POverview tmp, old;
|
||||
FILE *pAreas;
|
||||
char *sAreas;
|
||||
struct msgareashdr Msgshdr;
|
||||
struct msgareas Msgs;
|
||||
|
||||
IsDoing((char *)"Scan News");
|
||||
if (nntp_connect() == -1) {
|
||||
WriteError("Can't connect to newsserver");
|
||||
return;
|
||||
}
|
||||
if (get_xoverview()) {
|
||||
return;
|
||||
}
|
||||
IsDoing((char *)"Scan News");
|
||||
if (nntp_connect() == -1) {
|
||||
WriteError("Can't connect to newsserver");
|
||||
return;
|
||||
}
|
||||
if (get_xoverview()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!do_quiet) {
|
||||
colour(10, 0);
|
||||
printf("Scan for new news articles\n");
|
||||
}
|
||||
if (!do_quiet) {
|
||||
colour(10, 0);
|
||||
printf("Scan for new news articles\n");
|
||||
}
|
||||
|
||||
sAreas = calloc(PATH_MAX, sizeof(char));
|
||||
sprintf(sAreas, "%s/etc/mareas.data", getenv("MBSE_ROOT"));
|
||||
if(( pAreas = fopen (sAreas, "r")) == NULL) {
|
||||
WriteError("$Can't open Messages Areas File.");
|
||||
return;
|
||||
}
|
||||
fread(&Msgshdr, sizeof(Msgshdr), 1, pAreas);
|
||||
sAreas = calloc(PATH_MAX, sizeof(char));
|
||||
sprintf(sAreas, "%s/etc/mareas.data", getenv("MBSE_ROOT"));
|
||||
if(( pAreas = fopen (sAreas, "r")) == NULL) {
|
||||
WriteError("$Can't open Messages Areas File.");
|
||||
return;
|
||||
}
|
||||
fread(&Msgshdr, sizeof(Msgshdr), 1, pAreas);
|
||||
|
||||
while (fread(&Msgs, Msgshdr.recsize, 1, pAreas) == 1) {
|
||||
fseek(pAreas, Msgshdr.syssize, SEEK_CUR);
|
||||
if ((Msgs.Active) && strlen(Msgs.Newsgroup)) {
|
||||
if (IsSema((char *)"upsalarm")) {
|
||||
Syslog('+', "Detected upsalarm semafore, aborting newsscan");
|
||||
break;
|
||||
}
|
||||
Syslog('m', "Scan newsgroup: %s", Msgs.Newsgroup);
|
||||
if (!do_quiet) {
|
||||
colour(3, 0);
|
||||
printf("\r%-40s", Msgs.Newsgroup);
|
||||
fflush(stdout);
|
||||
}
|
||||
Nopper();
|
||||
if (do_one_group(&art, Msgs.Newsgroup, Msgs.Tag, Msgs.MaxArticles) == RETVAL_ERROR)
|
||||
break;
|
||||
/*
|
||||
* To be safe, update the dupes database after each area.
|
||||
*/
|
||||
CloseDupes();
|
||||
}
|
||||
while (fread(&Msgs, Msgshdr.recsize, 1, pAreas) == 1) {
|
||||
fseek(pAreas, Msgshdr.syssize, SEEK_CUR);
|
||||
if ((Msgs.Active) && strlen(Msgs.Newsgroup) && (msgs.Type == NEWS)) {
|
||||
if (IsSema((char *)"upsalarm")) {
|
||||
Syslog('+', "Detected upsalarm semafore, aborting newsscan");
|
||||
break;
|
||||
}
|
||||
Syslog('m', "Scan newsgroup: %s", Msgs.Newsgroup);
|
||||
if (!do_quiet) {
|
||||
colour(3, 0);
|
||||
printf("\r%-40s", Msgs.Newsgroup);
|
||||
fflush(stdout);
|
||||
}
|
||||
Nopper();
|
||||
if (do_one_group(&art, Msgs.Newsgroup, Msgs.Tag, Msgs.MaxArticles) == RETVAL_ERROR)
|
||||
break;
|
||||
/*
|
||||
* To be safe, update the dupes database after each area.
|
||||
*/
|
||||
CloseDupes();
|
||||
}
|
||||
fclose(pAreas);
|
||||
free(sAreas);
|
||||
}
|
||||
fclose(pAreas);
|
||||
free(sAreas);
|
||||
|
||||
for (tmp = xoverview; tmp; tmp = old) {
|
||||
old = tmp->next;
|
||||
if (tmp->header)
|
||||
free(tmp->header);
|
||||
if (tmp->field)
|
||||
free(tmp->field);
|
||||
free(tmp);
|
||||
}
|
||||
do_flush = TRUE;
|
||||
if (!do_quiet)
|
||||
printf("\r \r");
|
||||
for (tmp = xoverview; tmp; tmp = old) {
|
||||
old = tmp->next;
|
||||
if (tmp->header)
|
||||
free(tmp->header);
|
||||
if (tmp->field)
|
||||
free(tmp->field);
|
||||
free(tmp);
|
||||
}
|
||||
do_flush = TRUE;
|
||||
if (!do_quiet)
|
||||
printf("\r \r");
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user