]> andersk Git - moira.git/blobdiff - gen/mailhub.pc
Only active hosts, please.
[moira.git] / gen / mailhub.pc
index cd0f8b2892df95427862cb447276ee106e79fb87..6e531aa5e306d5d25f683f969e67e3af0c54a027 100644 (file)
@@ -292,14 +292,7 @@ void get_info(void)
       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->mailman_server = strdup(strtrim(mailman_server));
       l->m = NULL;
       if (hash_store(lists, id, l) < 0)
        {
@@ -372,12 +365,16 @@ void output_login(int dummy, void *user, void *out)
 }
 
 int line_width, alias_width;
+static const char *mailman_suffixes[] = { "-admin", "-owner", "-request",
+                                         "-bounces", "-confirm", "-join",
+                                         "-leave", "-subscribe",
+                                         "-unsubscribe", NULL };
 
 void output_mlist(int id, void *list, void *out)
 {
   struct list *l = list, *l1;
   struct user *u;
-  int len = strlen(l->name);
+  int len = strlen(l->name), i;
 
   if (!l->maillist || !check_string(l->name))
     return;
@@ -390,15 +387,13 @@ void output_mlist(int id, void *list, void *out)
 
   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,
+      for (i = 0; mailman_suffixes[i]; i++)
+       fprintf(out, "%s%s: %s%s@%s\n", l->name, mailman_suffixes[i], l->name,
+               mailman_suffixes[i], l->mailman_server);
+      fprintf(out, "owner-%s: %s-owner@%s\n", l->name, l->name,
              l->mailman_server);
     }
-
-  if (l->acl_t ==  'L' && (l1 = hash_lookup(lists, l->acl_id)))
+  else if (l->acl_t ==  'L' && (l1 = hash_lookup(lists, l->acl_id)))
     {
       fprintf(out, "owner-%s: ", l->name);
       if ((l1->maillist) && (strcmp(l->name, l1->name)))
This page took 0.047903 seconds and 4 git commands to generate.