char *description;
char acl_t;
int acl_id;
+ char mailman;
+ char *mailman_server;
struct member *m;
};
void get_info(void)
{
EXEC SQL BEGIN DECLARE SECTION;
- int id, pid, iid, bid, cnt, maillistp, acl, mid;
+ int id, pid, iid, bid, cnt, maillistp, acl, mid, mailman;
char mname[MACHINE_NAME_SIZE], str[STRINGS_STRING_SIZE];
char login[USERS_LOGIN_SIZE], potype[USERS_POTYPE_SIZE];
char lname[LIST_NAME_SIZE], desc[LIST_DESCRIPTION_SIZE];
- char type[LIST_ACL_TYPE_SIZE];
+ char type[LIST_ACL_TYPE_SIZE], mailman_server[MACHINE_NAME_SIZE];
EXEC SQL END DECLARE SECTION;
char *s;
struct user *u;
lists = create_hash(15000);
EXEC SQL DECLARE l_cursor CURSOR FOR
- SELECT list_id, name, maillist, description, acl_type, acl_id
- FROM list
- WHERE active != 0
+ SELECT l.list_id, l.name, l.maillist, l.description, l.acl_type, l.acl_id,
+ l.mailman, m.name
+ FROM list l, machine m
+ WHERE active != 0 AND l.mailman_id = m.mach_id
ORDER BY list_id;
EXEC SQL OPEN l_cursor;
while (1)
{
- EXEC SQL FETCH l_cursor INTO :id, :lname, :maillistp, :desc, :type, :acl;
+ EXEC SQL FETCH l_cursor INTO :id, :lname, :maillistp, :desc, :type, :acl,
+ :mailman, :mailman_server;
if (sqlca.sqlcode)
break;
l = malloc(sizeof(struct list));
l->description = strdup(strtrim(desc));
l->acl_t = type[0];
l->acl_id = acl;
+ l->mailman = mailman;
+ if ((s = strchr(mailman_server, '.')))
+ *s = '\0';
+ else
+ strtrim(mailman_server);
+#ifdef ATHENA
+ strcat(mailman_server, ".LOCAL");
+#endif
+ l->mailman_server = strdup(mailman_server);
l->m = NULL;
if (hash_store(lists, id, l) < 0)
{
put_fill(out, l->description);
+ if (l->mailman && strcmp(l->mailman_server, "[NONE]"))
+ {
+ fprintf(out, "%s-admin: %s-admin@%s\n", l->name, l->name,
+ l->mailman_server);
+ fprintf(out, "%s-owner: %s-owner@%s\n", l->name, l->name,
+ l->mailman_server);
+ fprintf(out, "%s-request: %s-request@%s\n", l->name, l->name,
+ l->mailman_server);
+ fprintf(out, "%s: %s@%s\n", l->name, l->name, l->mailman_server);
+ incount++;
+ return;
+ }
+
if (l->acl_t == 'L' && (l1 = hash_lookup(lists, l->acl_id)))
{
fprintf(out, "owner-%s: ", l->name);