fixes for mbfido news

This commit is contained in:
Michiel Broek 2004-04-13 19:09:17 +00:00
parent 3e2f009cb3
commit c07e6d4fe0
3 changed files with 65 additions and 61 deletions

View File

@ -17,6 +17,10 @@ v0.51.4 11-Apr-2004
Added loging of virus scanner results. Added loging of virus scanner results.
When a new echomail area is auto created, the creation date and When a new echomail area is auto created, the creation date and
the newsgroup name will be set. 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: mbnntp:
New program, news server to read echomail with a news client. New program, news server to read echomail with a news client.

View File

@ -282,7 +282,7 @@ void ScanFull()
if (Link.aka.zone) if (Link.aka.zone)
ExportEcho(Link, Number, &sbl); ExportEcho(Link, Number, &sbl);
} }
if (strlen(msgs.Newsgroup)) if (strlen(msgs.Newsgroup) && (msgs.Type == NEWS))
ExportNews(Number, &sbl); ExportNews(Number, &sbl);
tidy_falist(&sbl); tidy_falist(&sbl);
@ -439,7 +439,7 @@ void ScanOne(char *path, unsigned long MsgNum)
ExportEcho(Link, MsgNum, &sbl); ExportEcho(Link, MsgNum, &sbl);
} }
} }
if (strlen(msgs.Newsgroup)) if (strlen(msgs.Newsgroup) && (msgs.Type == NEWS))
ExportNews(MsgNum, &sbl); ExportNews(MsgNum, &sbl);
tidy_falist(&sbl); tidy_falist(&sbl);

View File

@ -174,71 +174,71 @@ void Marker(void)
*/ */
void ScanNews(void) void ScanNews(void)
{ {
List *art = NULL; List *art = NULL;
POverview tmp, old; POverview tmp, old;
FILE *pAreas; FILE *pAreas;
char *sAreas; char *sAreas;
struct msgareashdr Msgshdr; struct msgareashdr Msgshdr;
struct msgareas Msgs; struct msgareas Msgs;
IsDoing((char *)"Scan News"); IsDoing((char *)"Scan News");
if (nntp_connect() == -1) { if (nntp_connect() == -1) {
WriteError("Can't connect to newsserver"); WriteError("Can't connect to newsserver");
return; return;
} }
if (get_xoverview()) { if (get_xoverview()) {
return; return;
} }
if (!do_quiet) { if (!do_quiet) {
colour(10, 0); colour(10, 0);
printf("Scan for new news articles\n"); printf("Scan for new news articles\n");
} }
sAreas = calloc(PATH_MAX, sizeof(char)); sAreas = calloc(PATH_MAX, sizeof(char));
sprintf(sAreas, "%s/etc/mareas.data", getenv("MBSE_ROOT")); sprintf(sAreas, "%s/etc/mareas.data", getenv("MBSE_ROOT"));
if(( pAreas = fopen (sAreas, "r")) == NULL) { if(( pAreas = fopen (sAreas, "r")) == NULL) {
WriteError("$Can't open Messages Areas File."); WriteError("$Can't open Messages Areas File.");
return; return;
} }
fread(&Msgshdr, sizeof(Msgshdr), 1, pAreas); fread(&Msgshdr, sizeof(Msgshdr), 1, pAreas);
while (fread(&Msgs, Msgshdr.recsize, 1, pAreas) == 1) { while (fread(&Msgs, Msgshdr.recsize, 1, pAreas) == 1) {
fseek(pAreas, Msgshdr.syssize, SEEK_CUR); fseek(pAreas, Msgshdr.syssize, SEEK_CUR);
if ((Msgs.Active) && strlen(Msgs.Newsgroup)) { if ((Msgs.Active) && strlen(Msgs.Newsgroup) && (msgs.Type == NEWS)) {
if (IsSema((char *)"upsalarm")) { if (IsSema((char *)"upsalarm")) {
Syslog('+', "Detected upsalarm semafore, aborting newsscan"); Syslog('+', "Detected upsalarm semafore, aborting newsscan");
break; break;
} }
Syslog('m', "Scan newsgroup: %s", Msgs.Newsgroup); Syslog('m', "Scan newsgroup: %s", Msgs.Newsgroup);
if (!do_quiet) { if (!do_quiet) {
colour(3, 0); colour(3, 0);
printf("\r%-40s", Msgs.Newsgroup); printf("\r%-40s", Msgs.Newsgroup);
fflush(stdout); fflush(stdout);
} }
Nopper(); Nopper();
if (do_one_group(&art, Msgs.Newsgroup, Msgs.Tag, Msgs.MaxArticles) == RETVAL_ERROR) if (do_one_group(&art, Msgs.Newsgroup, Msgs.Tag, Msgs.MaxArticles) == RETVAL_ERROR)
break; break;
/* /*
* To be safe, update the dupes database after each area. * To be safe, update the dupes database after each area.
*/ */
CloseDupes(); CloseDupes();
}
} }
fclose(pAreas); }
free(sAreas); fclose(pAreas);
free(sAreas);
for (tmp = xoverview; tmp; tmp = old) { for (tmp = xoverview; tmp; tmp = old) {
old = tmp->next; old = tmp->next;
if (tmp->header) if (tmp->header)
free(tmp->header); free(tmp->header);
if (tmp->field) if (tmp->field)
free(tmp->field); free(tmp->field);
free(tmp); free(tmp);
} }
do_flush = TRUE; do_flush = TRUE;
if (!do_quiet) if (!do_quiet)
printf("\r \r"); printf("\r \r");
} }