]> andersk Git - moira.git/blobdiff - server/qfollow.pc
Support EXCHANGE poboxes.
[moira.git] / server / qfollow.pc
index 5a84ba349d6300f5c965ecd84fe17a168cc83a29..4bf66ea8e70066d1f23787af769198eb6aef14de 100644 (file)
@@ -394,7 +394,7 @@ int followup_gpob(struct query *q, struct save_queue *sq, struct validate *v,
   char *ptype, *p;
   int mid, sid, status, i;
   EXEC SQL BEGIN DECLARE SECTION;
-  int users_id, pid, iid, bid;
+  int users_id, pid, iid, bid, eid;
   char mach[MACHINE_NAME_SIZE], fs[FILESYS_LABEL_SIZE];
   char str[STRINGS_STRING_SIZE];
   EXEC SQL END DECLARE SECTION;
@@ -421,7 +421,7 @@ int followup_gpob(struct query *q, struct save_queue *sq, struct validate *v,
 
          /* If SMTP, don't bother fetching IMAP and POP boxes. */
          if (ptype[1] == 'M')
-           pid = iid = 0;
+           pid = iid = eid = 0;
        }
       if (iid)
        {
@@ -440,12 +440,20 @@ int followup_gpob(struct query *q, struct save_queue *sq, struct validate *v,
          if (sqlca.sqlcode)
            return MR_MACHINE;
        }
+      if (eid)
+       {
+         /* EXCHANGE, or SPLIT with EXCHANGE */
+         EXEC SQL SELECT m.name INTO :mach FROM machine m, users u
+           WHERE u.users_id = :users_id AND u.exchange_id = m.mach_id;
+         if (sqlca.sqlcode)
+           return MR_MACHINE;
+       }
 
       free(argv[2]);
       free(argv[3]);
 
       /* Now assemble the right answer. */
-      if (!strcmp(ptype, "POP"))
+      if (!strcmp(ptype, "POP") || !strcmp(ptype, "EXCHANGE"))
        {
          argv[2] = xstrdup(strtrim(mach));
          argv[3] = xmalloc(strlen(argv[0]) + strlen(argv[2]) + 2);
This page took 0.047985 seconds and 4 git commands to generate.