EXEC SQL DECLARE x CURSOR FOR SELECT
clearid, login
- FROM users WHERE status != 3 AND potype != 'NONE' AND potype != 'SMTP';
+ FROM users WHERE status != 3 AND potype != 'NONE';
EXEC SQL OPEN x;
while (1)
{
EXEC SQL CLOSE x;
- EXEC SQL DECLARE y CURSOR FOR SELECT
- u.clearid, s.string
- FROM users u, strings s
- WHERE u.status != 3 and u.potype = 'SMTP' and u.box_id = s.string_id;
- EXEC SQL OPEN y;
- while (1)
- {
- EXEC SQL FETCH y INTO :id, :string;
- if (sqlca.sqlcode)
- break;
- strtrim(string);
- strtrim(id);
- if (isdigit(id[0]))
- {
- if ((i = strlen(string)) > 7 &&
- !strcasecmp(".local", string + i - 6))
- {
- string[i - 6] = '\0';
- fprintf(out, "%s %s.mit.edu\n", id, string);
- }
- else if (!strchr(string, '@'))
- fprintf(out, "%s %s@mit.edu\n", id, string);
- else
- fprintf(out, "%s %s\n", id, string);
- }
- }
-
- EXEC SQL CLOSE y;
-
EXEC SQL COMMIT;
if (fclose(out))