]> andersk Git - moira.git/commitdiff
deal with new get_pobox output
authordanw <danw>
Wed, 17 Nov 1999 18:36:26 +0000 (18:36 +0000)
committerdanw <danw>
Wed, 17 Nov 1999 18:36:26 +0000 (18:36 +0000)
clients/moira/pobox.c
clients/passwd/chpobox.c

index d410686a831a23ab7d4ddb7213d3e28384e8ac62..112af264884e93ba184f8a9226666d33af7e1cc5 100644 (file)
@@ -39,11 +39,21 @@ static void PrintPOBox(char **info)
 {
   char buf[BUFSIZ];
 
-  sprintf(buf, "Address: %-10s Box: %-35s Type: %s", info[PO_NAME],
+  sprintf(buf, "User: %-10s Box: %-35s Type: %s", info[PO_NAME],
          info[PO_BOX], info[PO_TYPE]);
   Put_message(buf);
-  sprintf(buf, MOD_FORMAT, info[4], info[3], info[5]);
-  Put_message(buf);
+  if (info[6])
+    {
+      sprintf(buf, "Address: %s", info[PO_ADDR]);
+      Put_message(buf);
+      sprintf(buf, MOD_FORMAT, info[5], info[4], info[6]);
+      Put_message(buf);
+    }
+  else
+    {
+      sprintf(buf, MOD_FORMAT, info[4], info[3], info[5]);
+      Put_message(buf);
+    }
 }
 
 /*     Function Name: RealPrintPOMachines
index 08dcef220e455a2bf3cde23f1f5b81eef1fd36c9..823423e3362189a7042ee3d1d495e01a919688c6 100644 (file)
@@ -5,9 +5,9 @@
  *
  * chpobox with no modifiers reports the current mailbox.
  *
- * chpobox -s [address] means set the mailbox to this address.
+ * chpobox -s address means set the mailbox to this address.
  *
- * chpobox -p restores the pobox to a previous POP box, if there was one.
+ * chpobox -p restores the pobox to a previous POP/IMAP box, if there was one.
  *
  * chpobox -u [user] is needed if you are logged in as one user, but
  * are trying to change the email address of another.  You must have
@@ -46,7 +46,7 @@ int main(int argc, char *argv[])
   char *address, *uname;
   int c, setflag, prevpop, status;
 
-  c = setflag = prevpop = 0;
+  setflag = prevpop = 0;
   address = uname = NULL;
 
   if ((whoami = strrchr(argv[0], '/')) == NULL)
@@ -150,13 +150,23 @@ show:
 
 int get_pobox(int argc, char **argv, void *callarg)
 {
-  if (!strcmp(argv[1], "POP"))
-    printf("User %s, Type %s, Box: %s@%s\n",
-          argv[0], argv[1], argv[0], argv[2]);
+  if (!strcmp(argv[1], "SMTP"))
+    {
+      printf("User %s, Type %s, Box: %s\n",
+            argv[0], argv[1], argv[2]);
+    }
+  else if (argc == 7)
+    {
+      printf("User %s, Type %s, Box: %s (%s)\n",
+          argv[0], argv[1], argv[2], argv[3]);
+    }
   else
-    printf("User %s, Type %s, Box: %s\n",
-          argv[0], argv[1], argv[2]);
-  printf("  Modified by %s on %s with %s\n", argv[4], argv[3], argv[5]);
+    {
+      printf("User %s, Type %s, Box: %s@%s\n",
+            argv[0], argv[1], argv[0], argv[2]);
+    }
+  printf("  Modified by %s on %s with %s\n",
+        argv[argc - 2], argv[argc - 3], argv[argc - 1]);
   return 0;
 }
 
This page took 0.040879 seconds and 5 git commands to generate.