struct list {
char *name;
char maillist;
+ char *description;
char acl_t;
int acl_id;
struct member *m;
*/
EXEC SQL WHENEVER SQLERROR GOTO sqlerr;
+ /* Get Locks */
+
EXEC SQL SELECT modtime INTO :buf FROM users WHERE users_id = 0;
EXEC SQL SELECT modtime INTO :buf FROM list WHERE list_id = 0;
cnt = 0;
- machines = create_hash(10);
+ machines = create_hash(1000);
EXEC SQL DECLARE m_cursor CURSOR FOR
SELECT mach_id, name
FROM machine
+ WHERE status=1
ORDER BY mach_id;
EXEC SQL OPEN m_cursor;
while (1) {
lists = create_hash(15000);
EXEC SQL DECLARE l_cursor CURSOR FOR
- SELECT list_id, name, maillist, acl_type, acl_id
+ SELECT list_id, name, maillist, description, acl_type, acl_id
FROM list
WHERE active != 0
ORDER BY list_id;
EXEC SQL OPEN l_cursor;
while (1) {
- EXEC SQL FETCH l_cursor INTO :id, :name, :maillistp, :type, :acl;
+ EXEC SQL FETCH l_cursor INTO :id, :name, :maillistp, :buf, :type, :acl;
if (sqlca.sqlcode != 0) break;
l = (struct list *) perm_malloc(sizeof(struct list));
l->name = pstrsave(strtrim(name));
l->maillist = maillistp;
+ l->description = pstrsave(strtrim(buf));
l->acl_t = type[0];
l->acl_id = acl;
l->m = (struct member *) NULL;
return;
sqlerr:
com_err(whoami, MR_INGRES_ERR, " code %d\n", sqlca.sqlcode);
- critical_alert("DCM", "Hesiod build encountered DATABASE ERROR %d",
+ critical_alert("DCM", "Mailhub build encountered DATABASE ERROR %d",
sqlca.sqlcode);
exit(MR_INGRES_ERR);
}
}
-/* Illegal chars: ! " % ( ) , . / : ; < = > @ [ \ ] ^ { | } */
+/* Illegal chars: ! " % ( ) , / : ; < = > @ [ \ ] ^ { | } */
static int illegalchars[] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* ^@ - ^O */
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* ^P - ^_ */
- 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, /* SPACE - / */
+ 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, /* SPACE - / */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, /* 0 - ? */
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* @ - O */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, /* P - _ */
register struct member *m;
register struct user *u;
+ put_fill(out, l->description);
if (l->acl_t == 'L' &&
(l1 = (struct list *) hash_lookup(lists, l->acl_id)))
fprintf(out, "owner-%s: %s\n%s: ", l->name, l1->name, l->name);
{
register wwid;
static int cont = 1;
+ char str[8];
wwid = strlen(s);
if (!bol && awid + wwid + 2 > AL_MAX_WID) {
- fprintf(out, ",\n\tcontinuation-%d\ncontinuation-%d: ", cont, cont);
+ sprintf(str, "%c%c%c%c%c%c", random() % 26 + 97, random() % 26 + 97,
+ random() % 26 + 97, random() % 26 + 97,
+ random() % 26 + 97, random() % 26 + 97);
+ str[6] = '\0';
+ fprintf(out, ",\n\tcont%d-%s\ncont%d-%s: ", cont, str, cont, str);
cont++;
awid = lwid = 17 + wwid;
fputs(s, out);
}
+put_fill(aliases, string)
+FILE *aliases;
+register char *string;
+{
+ register char *c;
+ register int lwid;
+ register int wwid;
+
+ if (string == 0 || *string == 0) return;
+ fputs("# ", aliases);
+ lwid = 3;
+
+ while (1) {
+ while (*string && *string == ' ') string++;
+ c = (char *)index(string, ' ');
+ if (c == 0) {
+ wwid = strlen(string);
+ } else {
+ wwid = c - string;
+ *c = 0;
+ }
+
+ if ((lwid + wwid) > ML_WID) {
+ fputs("\n# ", aliases);
+ lwid = 3;
+ fputs(string, aliases);
+ } else {
+ fputs(string, aliases);
+ }
+
+ if (c == (char *)0) break;
+ /* add a space after the word */
+ (void) fputc(' ', aliases);
+ wwid++;
+ lwid += wwid;
+ string += wwid;
+ /* add another if after a period */
+ if (*--c == '.') {
+ (void) fputc(' ', aliases);
+ lwid++;
+ }
+ }
+
+ (void) fputc('\n', aliases);
+}
+
+
do_people()
{
incount = 0;
}
ret = pool;
pool += size;
- pool = (char *)(((unsigned) (pool + 1)) & ~1);
+ pool = (char *)(((unsigned) (pool + 3)) & ~3);
pool_size -= (pool - ret);
return(ret);
}