- %text T%
text from the file named T in the listdir/text directory; the name may only
- include letters and digits; note that there is an unformatted version of
- this directive
+ include letters, digits, underscore, dot and hyphen; note that there is an
+ unformatted version of this directive
- %control C%
- the contents of the control file named C in listir/control; the name may
- only include letters and digits; note that there is an unformatted version
- of this directive
+ the contents of the control file named C in listir/control; the name may only
+ include letters, digits, underscore, dot and hyphen; note that there is an
+ unformatted version of this directive
- %originalmail%
- %originalmail N%
- $control C$
the contents of the control file named C in listdir/control, with its final
- newline stripped; the name may only include letters and digits; note that
- there is a formatted version of this directive
+ newline stripped; the name may only include letters, digits, underscore, dot
+ and hyphen; note that there is a formatted version of this directive
- $digestfirst$
(available only in digest)
- $text T$
text from the file named T in the listdir/text directory, with its final
- newline stripped; the name may only include letters and digits; note that
- there is a formatted version of this directive
+ newline stripped; the name may only include letters, digits, underscore, dot
+ and hyphen; note that there is a formatted version of this directive
- $$
a single $
};
-static char *alphanum_token(char *token) {
+static char *filename_token(char *token) {
char *pos;
if (*token == '\0') return NULL;
for(pos = token; *pos != '\0'; pos++) {
if(*pos >= '0' && *pos <= '9') continue;
if(*pos >= 'A' && *pos <= 'Z') continue;
if(*pos >= 'a' && *pos <= 'z') continue;
+ if(*pos == '_') continue;
+ if(*pos == '-') continue;
+ if(*pos == '.') continue;
break;
}
if (*pos != '\0') return NULL;
value = concatstr(4, listname, listdelim, "subscribe-nomail@",
fqdn);
} else if(strncmp(token, "control ", 8) == 0) {
- token = alphanum_token(token + 8);
+ token = filename_token(token + 8);
if (token != NULL) value = ctrlcontent(listdir, token);
} else if(strncmp(token, "text ", 5) == 0) {
- token = alphanum_token(token + 5);
+ token = filename_token(token + 5);
if (token != NULL) value = textcontent(listdir, token);
} else if(data) {
for(i = 0; i < datacount; i++) {
*pos_p = pos;
return;
} else if(strncmp(token, "control ", 8) == 0) {
- token = alphanum_token(token + 8);
+ token = filename_token(token + 8);
if (token != NULL) {
filename = concatstr(3, listdir, "/control/", token);
begin_new_source_file(txt, line_p, pos_p, filename);
return;
}
} else if(strncmp(token, "text ", 5) == 0) {
- token = alphanum_token(token + 5);
+ token = filename_token(token + 5);
if (token != NULL) {
filename = concatstr(3, listdir, "/text/", token);
begin_new_source_file(txt, line_p, pos_p, filename);