EXEC SQL DECLARE csr102 CURSOR FOR
SELECT users_id, login, last, first, status, potype, pop_id, box_id,
- modby, fmodby, pmodby, comments, sigwho FROM users
+ imap_id, modby, fmodby, pmodby, comments, sigwho FROM users
ORDER BY users_id;
EXEC SQL OPEN csr102;
while (1)
char login[USERS_LOGIN_SIZE], nbuf[USERS_FIRST_SIZE + USERS_LAST_SIZE];
char last[USERS_LAST_SIZE], first[USERS_FIRST_SIZE];
char potype[USERS_POTYPE_SIZE];
- int users_id, status, pop_id, box_id, modby, fmodby, pmodby;
+ int users_id, status, pop_id, box_id, imap_id, modby, fmodby, pmodby;
int comments, sigwho;
EXEC SQL END DECLARE SECTION;
EXEC SQL FETCH csr102 INTO :users_id, :login, :last, :first,
- :status, :potype, :pop_id, :box_id, :modby, :fmodby, :pmodby,
- :comments, :sigwho;
+ :status, :potype, :pop_id, :box_id, :imap_id, :modby, :fmodby,
+ :pmodby, :comments, :sigwho;
if (sqlca.sqlcode)
break;
/* If potype is SMTP, box_id is a string_id for the strings tbl */
u->pobox_id = box_id;
break;
+ case 'I':
+ u->pobox_id = imap_id;
+ break;
default:
u->pobox_id = 0;
}
void pobox_check(int id, struct user *u)
{
+ struct filesys *fs;
+
switch (u->potype)
{
case 'P':
}
}
break;
+
case 'S':
if (hash_lookup(string_dups, u->pobox_id))
{
}
}
break;
+
+ case 'I':
+ fs = hash_lookup(filesys, u->pobox_id);
+ if (!fs)
+ {
+ printf("User %s(%s) has P.O.Box on non-existant filesystem %d\n",
+ u->login, u->fullname, u->pobox_id);
+ if (single_fix("Delete", 0))
+ {
+ remove_pobox(u->users_id);
+ u->potype = 'N';
+ }
+ }
+ else if (fs->type != 'I')
+ {
+ printf("User %s(%s) has IMAP P.O.Box on non-IMAP filesystem %s\n",
+ u->login, u->fullname, fs->name);
+ if (single_fix("Delete", 0))
+ {
+ remove_pobox(u->users_id);
+ u->potype = 'N';
+ }
+ }
+ break;
+
default:
;
}
}
}
- if (f->type == 'N')
+ if (f->type == 'N' || f->type == 'I')
{
if (!hash_lookup(nfsphys, f->phys_id))
{