Added subject line cleaner
This commit is contained in:
parent
abdbbc862e
commit
ccfd32e420
@ -6,6 +6,10 @@ v0.71.3 13-Jun-2005
|
|||||||
upgrade:
|
upgrade:
|
||||||
Check mbsetup 7.n.3.14 and 7.n.3.15 settings.
|
Check mbsetup 7.n.3.14 and 7.n.3.15 settings.
|
||||||
|
|
||||||
|
mbselib.a:
|
||||||
|
Added a function to clean subject lines from garbage, trailing
|
||||||
|
spaces etc. to improve message linking.
|
||||||
|
|
||||||
mbcico:
|
mbcico:
|
||||||
Added support for binkp GZ and BZ2 compression. Can be turned
|
Added support for binkp GZ and BZ2 compression. Can be turned
|
||||||
off per node. Only effective with originating calls. Incoming
|
off per node. Only effective with originating calls. Incoming
|
||||||
@ -14,12 +18,14 @@ v0.71.3 13-Jun-2005
|
|||||||
|
|
||||||
mbsebbs:
|
mbsebbs:
|
||||||
Added logging of remote host and terminal.
|
Added logging of remote host and terminal.
|
||||||
|
Added subject line clean in several places.
|
||||||
|
|
||||||
mbnewuser:
|
mbnewuser:
|
||||||
Added logging of remote host and terminal.
|
Added logging of remote host and terminal.
|
||||||
|
|
||||||
mbfido:
|
mbfido:
|
||||||
Fixed commandline parser for mail recipients.
|
Fixed commandline parser for mail recipients.
|
||||||
|
Added subject line clean in several places.
|
||||||
|
|
||||||
mbsetup:
|
mbsetup:
|
||||||
Added setup switches per node to disable PLZ or GZ and BZ2
|
Added setup switches per node to disable PLZ or GZ and BZ2
|
||||||
|
3
TODO
3
TODO
@ -126,9 +126,6 @@ mbfido:
|
|||||||
|
|
||||||
N: Make mailhistory.html a lot shorter, maybe day or week versions.
|
N: Make mailhistory.html a lot shorter, maybe day or week versions.
|
||||||
|
|
||||||
N: Strip trailing spaces from subject lines to make sure reply linking
|
|
||||||
works.
|
|
||||||
|
|
||||||
mbcico:
|
mbcico:
|
||||||
L: Implement binkp option ND.
|
L: Implement binkp option ND.
|
||||||
|
|
||||||
|
@ -2345,7 +2345,8 @@ unsigned char mbse_Readkey(void); /* Read a translated key */
|
|||||||
*/
|
*/
|
||||||
char *padleft(char *str, int size, char pad);
|
char *padleft(char *str, int size, char pad);
|
||||||
char *tl(char *str);
|
char *tl(char *str);
|
||||||
void Striplf(char *String);
|
void Striplf(char *);
|
||||||
|
void mbse_CleanSubject(char *);
|
||||||
void tlf(char *str);
|
void tlf(char *str);
|
||||||
char *tu(char *str);
|
char *tu(char *str);
|
||||||
char *tlcap(char *);
|
char *tlcap(char *);
|
||||||
|
@ -83,6 +83,35 @@ void Striplf(char *String)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void mbse_CleanSubject(char *String)
|
||||||
|
{
|
||||||
|
int i, fixed = FALSE;
|
||||||
|
|
||||||
|
i = strlen(String) -1;
|
||||||
|
|
||||||
|
while ((isspace(String[i])) && i) {
|
||||||
|
String[i] = '\0';
|
||||||
|
i--;
|
||||||
|
fixed = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((strncasecmp(String, "Re: ", 4) == 0) && (strncmp(String, "Re: ", 4))) {
|
||||||
|
/*
|
||||||
|
* Fix Re:
|
||||||
|
*/
|
||||||
|
String[0] = 'R';
|
||||||
|
String[1] = 'e';
|
||||||
|
String[2] = ':';
|
||||||
|
String[3] = ' ';
|
||||||
|
fixed = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fixed)
|
||||||
|
Syslog('m', "Fixed subj: \"%s\"", printable(String, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Converts first letter to UpperCase
|
* Converts first letter to UpperCase
|
||||||
*/
|
*/
|
||||||
|
@ -50,6 +50,8 @@ int Post(char *To, long Area, char *Subj, char *File, char *Flavor)
|
|||||||
time_t tt;
|
time_t tt;
|
||||||
struct tm *t;
|
struct tm *t;
|
||||||
|
|
||||||
|
mbse_CleanSubject(Subj);
|
||||||
|
|
||||||
if (!do_quiet) {
|
if (!do_quiet) {
|
||||||
mbse_colour(3, 0);
|
mbse_colour(3, 0);
|
||||||
printf("Post \"%s\" to \"%s\" in area %ld\n", File, To, Area);
|
printf("Post \"%s\" to \"%s\" in area %ld\n", File, To, Area);
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Purpose ...............: Import a echomail message
|
* Purpose ...............: Import a echomail message
|
||||||
*
|
*
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 1997-2004
|
* Copyright (C) 1997-2005
|
||||||
*
|
*
|
||||||
* Michiel Broek FIDO: 2:280/2802
|
* Michiel Broek FIDO: 2:280/2802
|
||||||
* Beekmansbos 10
|
* Beekmansbos 10
|
||||||
@ -60,6 +60,8 @@ int storeecho(faddr *f, faddr *t, time_t mdate, int flags, char *subj, char *msg
|
|||||||
unsigned long crc2;
|
unsigned long crc2;
|
||||||
char *buf;
|
char *buf;
|
||||||
|
|
||||||
|
mbse_CleanSubject(subj);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Update import counters
|
* Update import counters
|
||||||
*/
|
*/
|
||||||
@ -144,8 +146,7 @@ int storeecho(faddr *f, faddr *t, time_t mdate, int flags, char *subj, char *msg
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Start write the message
|
* Start write the message
|
||||||
* If not a bad or dupe message, eat the first
|
* If not a bad or dupe message, eat the first line (AREA:tag).
|
||||||
* line (AREA:tag).
|
|
||||||
*/
|
*/
|
||||||
buf = calloc(MAX_LINE_LENGTH +1, sizeof(char));
|
buf = calloc(MAX_LINE_LENGTH +1, sizeof(char));
|
||||||
rewind(fp);
|
rewind(fp);
|
||||||
|
@ -62,6 +62,8 @@ int storenet(faddr *f, faddr *t, time_t mdate, int flags, char *Subj, char *msgi
|
|||||||
unsigned long crc2;
|
unsigned long crc2;
|
||||||
char *Buf;
|
char *Buf;
|
||||||
|
|
||||||
|
mbse_CleanSubject(Subj);
|
||||||
|
|
||||||
if (! SearchNetBoard(t->zone, t->net)) {
|
if (! SearchNetBoard(t->zone, t->net)) {
|
||||||
bad = TRUE;
|
bad = TRUE;
|
||||||
WriteError("Can't find netmail board for %d:%d/%d", t->zone, t->net, t->node);
|
WriteError("Can't find netmail board for %d:%d/%d", t->zone, t->net, t->node);
|
||||||
|
@ -676,6 +676,7 @@ void Reply_Email(int IsReply)
|
|||||||
} else {
|
} else {
|
||||||
sprintf(subj, "%s", Msg.Subject);
|
sprintf(subj, "%s", Msg.Subject);
|
||||||
}
|
}
|
||||||
|
mbse_CleanSubject(subj);
|
||||||
Syslog('m', "Reply msg to %s, subject %s", to, subj);
|
Syslog('m', "Reply msg to %s, subject %s", to, subj);
|
||||||
Syslog('m', "Msgid was %s", Msg.Msgid);
|
Syslog('m', "Msgid was %s", Msg.Msgid);
|
||||||
sprintf(msgid, "%s", Msg.Msgid);
|
sprintf(msgid, "%s", Msg.Msgid);
|
||||||
@ -876,6 +877,7 @@ void Write_Email(void)
|
|||||||
colour(CFG.MsgInputColourF, CFG.MsgInputColourB);
|
colour(CFG.MsgInputColourF, CFG.MsgInputColourB);
|
||||||
alarm_on();
|
alarm_on();
|
||||||
GetstrP(Msg.Subject, 65, 0);
|
GetstrP(Msg.Subject, 65, 0);
|
||||||
|
mbse_CleanSubject(Msg.Subject);
|
||||||
|
|
||||||
if ((strcmp(Msg.Subject, "")) == 0) {
|
if ((strcmp(Msg.Subject, "")) == 0) {
|
||||||
Enter(1);
|
Enter(1);
|
||||||
|
@ -566,6 +566,7 @@ void Post_Msg()
|
|||||||
colour(CFG.MsgInputColourF, CFG.MsgInputColourB);
|
colour(CFG.MsgInputColourF, CFG.MsgInputColourB);
|
||||||
alarm_on();
|
alarm_on();
|
||||||
GetstrP(Msg.Subject, 65, 0);
|
GetstrP(Msg.Subject, 65, 0);
|
||||||
|
mbse_CleanSubject(Msg.Subject);
|
||||||
|
|
||||||
if ((strcmp(Msg.Subject, "")) == 0) {
|
if ((strcmp(Msg.Subject, "")) == 0) {
|
||||||
Enter(1);
|
Enter(1);
|
||||||
@ -1642,6 +1643,7 @@ void Reply_Msg(int IsReply)
|
|||||||
colour(CFG.MsgInputColourF, CFG.MsgInputColourB);
|
colour(CFG.MsgInputColourF, CFG.MsgInputColourB);
|
||||||
GetstrP(subj, 50, x);
|
GetstrP(subj, 50, x);
|
||||||
|
|
||||||
|
mbse_CleanSubject(subj);
|
||||||
if (strlen(subj))
|
if (strlen(subj))
|
||||||
strcpy(Msg.Subject, subj);
|
strcpy(Msg.Subject, subj);
|
||||||
|
|
||||||
|
@ -1588,6 +1588,7 @@ void BlueWave_Fetch()
|
|||||||
strcpy(Msg.From, Upr.from);
|
strcpy(Msg.From, Upr.from);
|
||||||
strcpy(Msg.To, Upr.to);
|
strcpy(Msg.To, Upr.to);
|
||||||
strcpy(Msg.Subject, Upr.subj);
|
strcpy(Msg.Subject, Upr.subj);
|
||||||
|
mbse_CleanSubject(Msg.Subject);
|
||||||
if (Upr.msg_attr & UPL_PRIVATE)
|
if (Upr.msg_attr & UPL_PRIVATE)
|
||||||
Msg.Private = TRUE;
|
Msg.Private = TRUE;
|
||||||
if (msgs.MsgKinds == PRIVATE)
|
if (msgs.MsgKinds == PRIVATE)
|
||||||
|
@ -89,6 +89,7 @@ void retr_msg(int msgnum)
|
|||||||
if (strlen(p) > 109)
|
if (strlen(p) > 109)
|
||||||
p[109] = '\0';
|
p[109] = '\0';
|
||||||
sprintf(Msg.Subject, "%s", p+9);
|
sprintf(Msg.Subject, "%s", p+9);
|
||||||
|
mbse_CleanSubject(Msg.Subject);
|
||||||
}
|
}
|
||||||
if (strncmp(p, "Date: ", 6) == 0)
|
if (strncmp(p, "Date: ", 6) == 0)
|
||||||
Msg.Written = parsedate(p+6, NULL) - (gmt_offset((time_t)0) * 60);
|
Msg.Written = parsedate(p+6, NULL) - (gmt_offset((time_t)0) * 60);
|
||||||
|
Reference in New Issue
Block a user