{
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
*
* 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
char *address, *uname;
int c, setflag, prevpop, status;
- c = setflag = prevpop = 0;
+ setflag = prevpop = 0;
address = uname = NULL;
if ((whoami = strrchr(argv[0], '/')) == NULL)
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;
}