Skip to content

Commit 28b04f5

Browse files
author
Peter McCluskey
committed
changes from Rick van der Zwet about spamify, dates, alignment
1 parent 713e25c commit 28b04f5

File tree

7 files changed

+21
-14
lines changed

7 files changed

+21
-14
lines changed

src/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ MAILOBJS= mail.o ../libcgi/libcgi.a
6161
all: pcre/.libs/libpcre.a @FNV_DEP@ hypermail$(SUFFIX) mail$(SUFFIX) lang$(SUFFIX)
6262

6363
pcre/.libs/libpcre.a:
64-
@cd pcre; $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" ; rm .libs/lib*.so*
64+
@cd pcre; $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" ; rm -f .libs/lib*.so*
6565

6666
fnv/libfnv.a:
6767
@cd fnv; $(MAKE) libfnv.a CC="$(CC)" CFLAGS="$(CFLAGS)"

src/date.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ char *getdateindexdatestr(time_t yearsecs)
210210

211211
/* store the previous dateformat */
212212
previous_dateformat = set_dateformat;
213-
set_dateformat = "%A, %e %B";
213+
set_dateformat = "%A, %e %B %Y";
214214
date = getdatestr (yearsecs);
215215
/* restore the previous dateformat */
216216
set_dateformat = previous_dateformat;

src/getname.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ static int blankstring(char *str)
1515
}
1616

1717
char *spamify(char *input)
18+
{
19+
if (set_antispamdomain) {
20+
return spamify_replacedomain(input, set_antispamdomain);
21+
}
22+
else {
23+
return spamify_small(input);
24+
}
25+
}
26+
27+
char *spamify_small(char *input)
1828
{
1929
int insertlen = strlen(set_antispam_at);
2030
/* we should replace the @-letter in the email address */

src/getname.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
void getname(char *, char **, char **);
22
char *spamify(char *input);
3+
char *spamify_small(char *input);
34
char *spamify_replacedomain(char *input, char *antispamdomain);

src/parse.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ void crossindexthread2(int num)
417417
for (rp = ep->replylist; rp != NULL; rp = rp->next) {
418418
if (!(rp->data->flags & USED_THREAD)) {
419419
rp->data->flags |= USED_THREAD;
420-
if (0) printf("add thread.b %d %d %d\n", num, rp->data->msgnum, rp->msgnum);
420+
if (0) fprintf(stderr, "add thread.b %d %d %d\n", num, rp->data->msgnum, rp->msgnum);
421421
threadlist = addreply(threadlist, num, rp->data, 0,
422422
&threadlist_end);
423423
printedlist = markasprinted(printedthreadlist, rp->msgnum);
@@ -1500,18 +1500,11 @@ int parsemail(char *mbox, /* file name */
15001500
else if (!strncasecmp(head->line, "From:", 5)) {
15011501
getname(head->line, &namep, &emailp);
15021502
head->parsedheader = TRUE;
1503-
if (set_spamprotect) {
1504-
if (set_antispamdomain) {
1505-
emailp=spamify_replacedomain(emailp,set_antispamdomain);
1506-
/* we need to "fix" the name as well, as sometimes
1507-
the email ends up in the name part */
1508-
namep=spamify_replacedomain(namep,set_antispamdomain);
1509-
} else {
1503+
if (set_spamprotect) {
15101504
emailp=spamify(emailp);
15111505
/* we need to "fix" the name as well, as sometimes
15121506
the email ends up in the name part */
15131507
namep=spamify(namep);
1514-
}
15151508
}
15161509
}
15171510
else if (!strncasecmp(head->line, "Message-Id:", 11)) {

src/print.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2265,6 +2265,8 @@ void writearticles(int startnum, int maxnum)
22652265
if (hashnumlookup(num, &e3)) {
22662266
#ifdef FASTREPLYCODE
22672267
hashnumlookup(get_new_reply_to(), &e4);
2268+
if(0)
2269+
fprintf(stderr, "update reply %2d %2d \n", get_new_reply_to(), num);
22682270
replylist = addreply2(replylist, e4, e3, 0, &replylist_end);
22692271
#else
22702272
replylist = addreply(replylist, get_new_reply_to(), e3, 0, &replylist_end);
@@ -3152,7 +3154,7 @@ void write_toplevel_indices(int amountmsgs)
31523154
char *index_title;
31533155
char *filename;
31543156
char *saved_set_dateformat;
3155-
char *abbr_dateformat = "%e %b %Y";
3157+
char *abbr_dateformat = "%d %b %Y";
31563158
char *verbose_dateformat = "%A, %e %B %Y";
31573159

31583160
char *tmpstr;
@@ -3301,7 +3303,7 @@ void write_toplevel_indices(int amountmsgs)
33013303
}
33023304
}
33033305
if (started_line && fp)
3304-
fprintf(fp, " <td align=\"center\" class=\"count\">%d</td>\n </tr>\n", sd->count);
3306+
fprintf(fp, " <td align=\"right\" class=\"count\">%d</td>\n </tr>\n", sd->count);
33053307
}
33063308
set_dateformat = saved_set_dateformat;
33073309

src/struct.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ int rbs_bigtime = 0;
2929
#include "setup.h"
3030
#include "struct.h"
3131
#include "parse.h"
32+
#include "getname.h"
3233

3334
#define HAVE_PCRE
3435
#ifdef HAVE_PCRE
@@ -728,7 +729,7 @@ struct body *addbody(struct body *bp, struct body **lp, /* points to the last po
728729
if (!(flags & BODY_CONTINUE)) {
729730
newnode = (struct body *)emalloc(sizeof(struct body));
730731
memset(newnode, 0, sizeof(struct body));
731-
newnode->line = strsav(line);
732+
newnode->line = spamify(strsav(line));
732733
newnode->html = (flags & BODY_HTMLIZED) ? 1 : 0;
733734
newnode->header = (flags & BODY_HEADER) ? 1 : 0;
734735
newnode->attached = (flags & BODY_ATTACHED) ? 1 : 0;

0 commit comments

Comments
 (0)