+ /* Plow through the instructions looking for 'remote' directives and
+ * a status of 0 (no delivery yet attempted) or 3 (transient errors
+ * were experienced and it's time to try again)
+ */
+ lines = num_tokens(instr, '\n');
+ for (i=0; i<lines; ++i) {
+ extract_token(buf, instr, i, '\n');
+ extract(key, buf, 0);
+ extract(addr, buf, 1);
+ status = extract_int(buf, 2);
+ extract(dsn, buf, 3);
+ if ( (!strcasecmp(key, "remote"))
+ && ((status==0)||(status==3)) ) {
+ remove_token(instr, i, '\n');
+ --i;
+ --lines;
+ lprintf(9, "SMTP: Trying <%s>\n", addr);
+ smtp_try(key, addr, &status, dsn);
+ if (status != 2) {
+ if (results == NULL) {
+ results = mallok(1024);
+ memset(results, 0, 1024);
+ }
+ else {
+ results = reallok(results,
+ strlen(results) + 1024);
+ }
+ sprintf(&results[strlen(results)],
+ "%s|%s|%d|%s\n",
+ key, addr, status, dsn);
+ }
+ }
+ }