1 /* Gateway kernel - User Request Processor
5 * Revision 1.33 1995/05/03 16:34:19 adam
6 * CCL def command, i.e. user definitions - saved as resource files.
8 * Revision 1.32 1995/05/03 07:37:46 adam
9 * CCL commands stop/continue implemented. New functions gw_res_{int,bool}
10 * are used when possible.
12 * Revision 1.31 1995/05/01 12:43:38 adam
13 * First work on resource monitor program.
15 * Revision 1.30 1995/04/20 16:10:47 adam
16 * Modified to work with non-blocking zass-api. Not using non-blocking
19 * Revision 1.29 1995/04/19 16:01:58 adam
20 * Some hacks to get the FIFO communication work!! Isn't reliable.
21 * Resource gw.account added - default account info.
23 * Revision 1.28 1995/04/19 13:19:09 adam
24 * New command: account - for authentication.
26 * Revision 1.27 1995/04/19 10:46:19 adam
27 * Persistency works much better now. New command: status - history-like
29 * Revision 1.26 1995/04/19 07:31:12 adam
30 * First work on Z39.50 persistence.
32 * Revision 1.25 1995/04/17 09:34:33 adam
33 * Timeout (idletime) adjustable. Minor changes in kernel.
35 * Revision 1.24 1995/03/28 11:42:35 adam
36 * First use of string-queue utility.
38 * Revision 1.23 1995/03/28 08:01:28 adam
39 * FIFO existence is used to test for a running kernel.
41 * Revision 1.22 1995/03/27 12:51:05 adam
42 * New log level in use: GW_LOG_ERRNO.
44 * Revision 1.21 1995/03/27 08:24:04 adam
45 * First use of gip interface and gw-db.
46 * First work on eti program.
48 * Revision 1.20 1995/03/03 17:19:17 adam
49 * Smarter presentation. Bug fix in email header interpretation.
51 * Revision 1.19 1995/03/02 09:32:11 adam
52 * New presentation formats. f0=full, f1=brief, f2=mid
54 * Revision 1.18 1995/03/01 14:32:26 adam
55 * Better diagnostics. Default is, that only one database selected when
58 * Revision 1.17 1995/02/28 13:16:26 adam
59 * Configurable From: added.
61 * Revision 1.16 1995/02/23 10:08:20 adam
62 * Added logging of all user commands.
64 * Revision 1.15 1995/02/23 08:32:17 adam
67 * Revision 1.13 1995/02/22 16:54:42 adam
68 * Qualifiers of LOC target updated. More logging messages.
70 * Revision 1.12 1995/02/22 15:51:51 adam
71 * Bug fix: swap of parameter number and offset in function present.
73 * Revision 1.11 1995/02/22 15:22:33 adam
74 * Much more checking of run-time state. Show command never retrieves
75 * more records than indicated by the previous search request. Help
76 * command available. The maximum number of records retrieved can be
79 * Revision 1.10 1995/02/22 08:51:35 adam
80 * Output function can be customized in fml, which is used to print
81 * the reply to reply_fd.
83 * Revision 1.9 1995/02/21 17:46:21 adam
86 * Revision 1.8 1995/02/21 12:12:00 adam
87 * Diagnostic record with error info. observed.
89 * Revision 1.7 1995/02/20 21:16:20 adam
90 * FML support. Bug fixes. Profile for drewdb.
92 * Revision 1.6 1995/02/17 14:41:14 quinn
93 * Added simple display of records.
95 * Revision 1.5 1995/02/17 14:22:13 adam
96 * First steps of CCL show command. Not finished yet.
98 * Revision 1.4 1995/02/17 09:08:36 adam
99 * Reply with subject. CCL base command implemented.
101 * Revision 1.3 1995/02/16 18:35:09 adam
102 * First use of Zdist library. Search requests are supported.
103 * Present requests are not supported yet.
105 * Revision 1.2 1995/02/16 13:21:00 adam
106 * Organization of resource files for targets and conversion
107 * language implemented.
109 * Revision 1.1 1995/02/15 17:45:30 adam
110 * First version of email gateway kernel. Email requests are read
111 * from stdin. The output is transferred to an MTA if 'From' is
112 * found in the header - or stdout if absent. No Z39.50 client is used.
118 info/status (other name?)
119 better persistence diagnostics
120 resource gw.path - use chdir call instead
123 automatic information about target-aliases: name, query-support, etc.
136 #include <strqueue.h>
139 static char line_buf[LINE_MAX+1];
141 static void put_esc_str (const char *s)
147 int reopen_target (void)
151 gw_log (GW_LOG_WARN, KERNEL_LOG, "Zass free...");
152 gw_log (GW_LOG_DEBUG, KERNEL_LOG, "reopen_target");
153 info.zass = zass_open (info.hostname, info.port, NULL, /* complete */
154 *info.account ? info.account : NULL);
157 gw_log (GW_LOG_DEBUG, KERNEL_LOG, "Cannot connect to target %s:%d",
158 info.hostname, info.port);
159 fprintf (reply_fd, "%s %s:%d\n",
160 gw_res_get (info.kernel_res, "gw.err.connect",
161 "Cannot connect to target"),
162 info.hostname, info.port);
165 v = gw_res_get (info.kernel_res, "gw.description", NULL);
169 fprintf (reply_fd, "\n");
171 fprintf (reply_fd, "%s %s:%d\n",
172 gw_res_get (info.kernel_res, "gw.msg.connect",
173 "Connection established to"),
174 info.hostname, info.port);
176 fprintf (reply_fd, "%s:\n%s\n",
177 gw_res_get (info.kernel_res, "gw.msg.databases",
178 "Available databases"),
181 fprintf (reply_fd, "%s:\n%s\n",
182 gw_res_get (info.kernel_res, "gw.msg.database",
183 "Selected databases"),
186 fprintf (reply_fd, "set=%d\n", info.setno);
188 fprintf (reply_fd, "set=Default\n");
192 struct command_word {
194 char *resource_suffix;
197 static int command_search (struct command_word *tab, struct ccl_token *cmd,
198 const char *resource_prefix)
202 assert (resource_prefix);
205 while (tab->default_value)
207 char *cp, command_names[60];
208 char resource_name[60];
211 sprintf (resource_name, "%s%s", resource_prefix,
212 tab->resource_suffix);
213 v = gw_res_get (info.kernel_res, resource_name, tab->default_value);
215 strcpy (command_names, v);
221 if ((split = strchr (cp, ' ')))
223 if (cmd->len == strlen(cp) &&
224 !memcmp (cmd->name, cp, cmd->len))
236 static struct error_no_struct {
239 } error_ccl_tab[] = {
241 { CCL_ERR_TERM_EXPECTED, "term.expected" },
242 { CCL_ERR_RP_EXPECTED, "rp.expected" },
243 { CCL_ERR_SETNAME_EXPECTED, "setname.expected" },
244 { CCL_ERR_OP_EXPECTED, "op.expected" },
245 { CCL_ERR_BAD_RP, "bad.rp" },
246 { CCL_ERR_UNKNOWN_QUAL, "unknown.qual" },
247 { CCL_ERR_DOUBLE_QUAL, "double.qual" },
248 { CCL_ERR_EQ_EXPECTED, "eq.expected" },
249 { CCL_ERR_BAD_RELATION, "bad.relation" },
250 { CCL_ERR_TRUNC_NOT_LEFT, "trunc.not.left" },
251 { CCL_ERR_TRUNC_NOT_BOTH, "trunc.not.both" },
252 { CCL_ERR_TRUNC_NOT_RIGHT, "trunc.not.right" },
256 static char *error_no_search (struct error_no_struct *tab, int no)
258 struct error_no_struct *p = tab;
259 while (p->resource_name)
262 return p->resource_name;
268 static int email_header (struct str_queue *sq,
269 char *from_str, char *subject_str)
273 while (str_queue_deq (sq, line_buf, LINE_MAX))
275 if (line_buf[0] == '\n')
277 if (memcmp (line_buf, "From ", 5) == 0)
278 sscanf (line_buf+4, "%s", from_str);
279 if (memcmp (line_buf, "Subject: ", 9) == 0 &&
280 sscanf (line_buf+9, "%s", subject_str+1) == 1)
281 strcpy (subject_str, line_buf+9);
286 static void help_general (void)
288 put_esc_str (gw_res_get (info.kernel_res, "gw.help.general",
289 "Commands available in this service:\n"));
292 static int exec_help (struct ccl_token *list)
294 static char *sep = "-------------------------------\\n";
298 put_esc_str (gw_res_get (info.kernel_res, "gw.help.target",
299 "target <name> - selects a given target\n"));
302 put_esc_str (gw_res_get (info.kernel_res, "gw.help.base",
303 "base <base>.. - selects databases\n"));
306 put_esc_str (gw_res_get (info.kernel_res, "gw.help.find",
307 "find <query> - performs a search request\n"));
310 put_esc_str (gw_res_get (info.kernel_res, "gw.help.show",
311 "show <spec> - retrieves and displays "
316 static void display_diag_error (int code, const char *addinfo)
320 sprintf (str, "gw.bib1.diag.%d", code);
321 fprintf (reply_fd, "%s %d:\n %s: '%s'\n",
322 gw_res_get (info.kernel_res, "gw.msg.z39errcode",
325 gw_res_get (info.kernel_res, str, ""), addinfo);
328 static int exec_find (struct ccl_token *list, const char *search_str)
330 const struct zass_searchent *p;
331 struct gw_user_set *us;
334 struct ccl_rpn_node *rpn;
338 if (info.setno == -1)
339 strcpy (setname, "Default");
341 sprintf (setname, "%d", info.setno);
342 info.next_position = 1;
345 rpn = ccl_find (info.bibset, list, &error, &pos);
348 const char *v = NULL, *n;
351 fprintf (reply_fd, " %*s^ - ", pos - line_buf, " ");
353 n = error_no_search (error_ccl_tab, error);
356 sprintf (name, "gw.err.%s", n);
357 v = gw_res_get (info.kernel_res, name, NULL);
360 v = ccl_err_msg (error);
361 fprintf (reply_fd, "%s\n", v);
364 ccl_pr_tree (rpn, reply_fd);
365 fprintf (reply_fd, "\n");
367 if (!*info.database )
369 fprintf (reply_fd, "%s\n",
370 gw_res_get (info.kernel_res, "gw.err.no.database",
371 "You must select database"));
374 gw_log (GW_LOG_DEBUG, KERNEL_LOG, "Searching in database %s",
377 fprintf (reply_fd, "Searching in database %s\n", info.database);
378 p = zass_p_search (info.zass, rpn, setname, info.database, info.sets);
381 fprintf (reply_fd, "Search fail\n");
384 if (p->errcode != -1)
386 display_diag_error (p->errcode, p->errstring);
389 fprintf (reply_fd, "%d %s\n", p->num,
390 gw_res_get (info.kernel_res, "gw.msg.hits", "hit(s)"));
391 us = user_set_add (setname, p->num, info.database, rpn, 1, search_str);
392 fprintf (reply_fd, "Result-set %s created\n", setname);
396 static int exec_account (struct ccl_token *list)
398 if (list->kind != CCL_TOK_EOL)
401 memcpy (info.account, list->name, len);
402 info.target[len] = '\0';
405 *info.account = '\0';
409 static int exec_target (struct ccl_token *list)
412 if (list->kind == CCL_TOK_EOL)
415 memcpy (info.target, list->name, len);
416 info.target [len] = '\0';
419 return reopen_target ();
422 static void exec_status_r (struct gw_user_set *sp)
426 exec_status_r (sp->prev);
427 fprintf (reply_fd, "%6s %7d %12.12s %.50s\n", sp->name, sp->hits,
428 sp->database, sp->search_str);
431 static int exec_status (struct ccl_token *list)
433 fprintf (reply_fd, " Name Hits Database Find\n");
434 exec_status_r (info.sets);
438 static int exec_base (struct ccl_token *list)
440 struct ccl_token *li = list;
444 if (list->kind == CCL_TOK_EOL)
446 free (info.database);
447 while (li->kind != CCL_TOK_EOL)
451 if (li->kind == CCL_TOK_COMMA)
454 info.database = malloc (len);
455 assert (info.database );
458 while (li->kind != CCL_TOK_EOL)
460 memcpy (info.database+len, li->name, li->len);
462 info.database[len++] = ',';
464 if (li->kind == CCL_TOK_COMMA)
467 info.database[len-1] = '\0';
471 static void present (const char *set, int offset, int number,
472 struct ccl_token *format_token)
474 const struct zass_presentent *zp;
479 max_number = gw_res_int (info.kernel_res, "gw.max.show", 200);
480 if (number > max_number)
482 gw_log (GW_LOG_DEBUG, KERNEL_LOG, "present in set %s", set);
483 gw_log (GW_LOG_DEBUG, KERNEL_LOG, "present of %d records from offset %d",
485 zp = zass_p_present(info.zass, (char *) set, offset, number);
491 int record_log_fd = -1;
492 const char *record_log_name;
494 record_log_name = gw_res_get (info.kernel_res, "gw.marc.log",
498 sprintf (path, "%s/%s", gw_res_get (info.kernel_res,
501 record_log_fd = open (path, O_WRONLY|O_CREAT|O_APPEND, 0666);
502 if (record_log_fd == -1)
503 gw_log (GW_LOG_WARN|GW_LOG_ERRNO, "Cannot open %s", path);
505 fprintf (reply_fd, gw_res_get (info.kernel_res,
507 "Got %d records from set %s"),
509 fprintf (reply_fd, "\n");
510 for (i = 0, pp = zp->records; pp; pp = pp->next, i++)
514 const char *arg_ar[5];
516 fprintf (reply_fd, "--- %d/%d ---\n",
517 i+offset, offset+zp->num-1);
518 if (!gw_res_get (info.kernel_res, "gw.ignore.which", NULL))
520 if (pp->which == ZASS_REC_DIAG)
522 display_diag_error (pp->errcode, pp->errstring);
525 else if (pp->which != ZASS_REC_USMARC)
527 fprintf (reply_fd, "Unknown record kind %d\n",
532 if (record_log_fd != -1)
533 write (record_log_fd, pp->record, strlen(pp->record));
534 rec = iso2709_cvt (pp->record);
540 len = format_token->len;
541 if (len >= sizeof(format_str))
542 len = sizeof(format_str)-1;
543 memcpy (format_str, format_token->name, len);
544 format_str[len] = '\0';
546 if (info.fml && format_token &&
547 (!strcmp (format_str, "0") || !strcmp (format_str, "1")
548 || !strcmp(format_str, "2")))
551 arg_ar[1] = format_str;
552 arg_ar[2] = " \\list";
553 arg_ar[3] = marc_to_str (info.fml, rec);
555 fml_exec_call_argv (info.fml, arg_ar);
558 iso2709_display (rec, reply_fd);
560 iso2709_display (rec, reply_fd);
565 fprintf (reply_fd, "Not a MARC record\n");
567 if (record_log_fd != -1)
568 close (record_log_fd);
572 static int exec_show (struct ccl_token *list)
574 static struct command_word show_tab [] =
581 struct ccl_token *set_token = NULL;
582 struct ccl_token *format_token = NULL;
583 struct ccl_token *li = list;
584 int no_of_present = 0;
587 while (li->kind != CCL_TOK_EOL)
590 if (li->next->kind == CCL_TOK_EQ)
592 if (li->kind == CCL_TOK_SET) /* set = <name> ? */
599 modifier_no = command_search (show_tab, li, "ccl.token.");
602 fprintf (reply_fd, "Unknown modifier in show\n");
606 if (modifier_no == 1) /* f = <name> ? */
608 else if (modifier_no == 2) /* p = <name> ? */
610 if (li->kind != CCL_TOK_EOL /* p = <name> - <name> ? */
611 && li->next->kind == CCL_TOK_MINUS
612 && li->next->next != CCL_TOK_EOL)
618 fprintf (reply_fd, "%s\n", "Missing token after '='");
627 gw_log (GW_LOG_DEBUG, KERNEL_LOG, "Got set=%.*s", set_token->len,
630 gw_log (GW_LOG_DEBUG, KERNEL_LOG, "Got format=%.*s", format_token->len,
634 while (li->kind != CCL_TOK_EOL)
640 if (li->next->kind == CCL_TOK_EQ && li->kind != CCL_TOK_SET)
642 modifier_no = command_search (show_tab, li, "ccl.token.");
644 if (modifier_no == 2) /* p = <name> ? */
646 if (li->kind != CCL_TOK_EOL /* p = <name> - <name> ? */
647 && li->next->kind == CCL_TOK_MINUS
648 && li->next->next != CCL_TOK_EOL)
651 memcpy (tmp_str, li->name, len);
652 tmp_str [len] = '\0';
653 offset = atoi (tmp_str);
657 memcpy (tmp_str, li->name, len);
658 tmp_str [len] = '\0';
659 number = atoi (tmp_str) - offset + 1;
664 memcpy (tmp_str, li->name, len);
665 tmp_str [len] = '\0';
666 offset = atoi (tmp_str);
675 memcpy (tmp_str, li->name, len);
677 number = atoi (tmp_str);
681 if (offset > 0 && number > 0)
683 struct gw_user_set *us;
687 len = set_token->len;
688 memcpy (tmp_str, set_token->name, len);
690 us = user_set_search (tmp_str);
693 us = user_set_search (NULL);
694 if (us && us->hits != -1) /* proper result-set? */
696 if (offset <= us->hits)
698 if (offset+number-1 > us->hits)
699 number = us->hits - offset+1;
700 present (us->name, offset, number, format_token);
703 else if (!no_of_present) /* display error message once! */
705 fprintf (reply_fd, "%s\n",
706 gw_res_get (info.kernel_res, "gw.err.no.set",
707 "No result-set generated"));
712 if (!no_of_present) /* no records shown so far? */
714 struct gw_user_set *us;
717 us = user_set_search (NULL);
718 if (us && us->hits != -1) /* proper result-set? */
720 default_show = gw_res_int (info.kernel_res, "gw.default.show", 20);
721 if (us->hits >= info.next_position + default_show)
723 present (us->name, info.next_position, default_show,
725 info.next_position += default_show;
727 else if (us->hits >= info.next_position)
729 present (us->name, info.next_position,
730 us->hits - info.next_position + 1,
732 info.next_position = us->hits + 1;
735 else /* display error message */
737 fprintf (reply_fd, "%s\n",
738 gw_res_get (info.kernel_res, "gw.err.no.set",
739 "No result-set generated"));
746 static int exec_def (struct ccl_token *list)
748 const char *name = NULL;
751 static struct command_word def_tab [] =
753 { "reset", "reset" },
755 { "maxshow", "maxshow" },
756 { "defaultshow", "defaultshow" },
757 { "lang", "language" },
763 sprintf (fname, "%s/user.%d.r", gw_res_get (info.kernel_res,
767 if (list->kind == CCL_TOK_EOL)
769 fprintf (reply_fd, "format %s\n", gw_res_get
770 (info.kernel_res, "gw.display.format", ""));
771 fprintf (reply_fd, "maxshow %s\n", gw_res_get
772 (info.kernel_res, "gw.max.show", ""));
773 fprintf (reply_fd, "default-show %s\n", gw_res_get
774 (info.kernel_res, "gw.default.show", ""));
775 fprintf (reply_fd, "language %s\n", gw_res_get
776 (info.kernel_res, "gw.language", ""));
780 int setting_no = command_search (def_tab, list, "ccl.token.");
784 fprintf (reply_fd, "Unknown setting in def\n");
794 if (list->kind == CCL_TOK_EOL)
796 fprintf (reply_fd, "Missing value\n");
799 strncpy (value, list->name, 127);
800 value[(size_t) list->len] = '\0';
804 name = "gw.display.format";
807 name = "gw.max.show";
810 name = "gw.default.show";
813 name = "gw.language";
818 gw_log (GW_LOG_DEBUG, KERNEL_LOG, "update file %s with %s=%s",
820 gw_res_put (info.kernel_res, "gw.username", info.from_str, fname);
821 gw_res_put (info.kernel_res, name, value, fname);
822 gw_res_commit (info.kernel_res, fname);
831 * exec_command: parse and execute ccl command in str.
832 * str: ccl command string
833 * stop_flag pointer to integer. On completion the integer
834 * is 1 (stop) or 2 (continue); 0 (other command)
835 * return: 0 success; non-zero otherwise
837 static int exec_command (const char *str, int *stop_flag)
839 static struct command_word command_tab [] =
846 { "continue", "continue" },
847 { "status", "status" },
849 { "target", "target" },
851 { "account", "account" },
855 struct ccl_token *cmd = ccl_tokenize (str);
859 if (cmd->kind != CCL_TOK_EOL &&
860 (no = command_search (command_tab, cmd, "ccl.command.")))
862 if (no == 1 || no == 2 || no == 3) /* find/show/base? */
864 if (!info.zass) /* open if not already opened */
866 fprintf (reply_fd, "\n> %s\n", str);
867 if (!info.zass) /* fail? */
869 fprintf (reply_fd, "%s\n",
870 gw_res_get (info.kernel_res, "gw.err.no.target",
871 "No connection established - "
877 fprintf (reply_fd, "\n> %s\n", str);
879 ccl_token_and = gw_res_get (info.kernel_res, "ccl.token.and", "and");
880 ccl_token_or = gw_res_get (info.kernel_res, "ccl.token.or", "or");
881 ccl_token_not = gw_res_get (info.kernel_res, "ccl.token.not", "not");
882 ccl_token_set = gw_res_get (info.kernel_res, "ccl.token.set", "set");
887 return exec_find (cmd->next, str);
889 return exec_show (cmd->next);
891 return exec_base (cmd->next);
893 fprintf (reply_fd, "\n> %s\n", str);
894 return exec_help (cmd->next);
895 case 6: /* continue */
899 return exec_status (cmd->next);
907 return exec_target (cmd->next);
909 return exec_def (cmd->next);
911 return exec_account (cmd->next);
913 fprintf (reply_fd, "%s\n",
914 gw_res_get (info.kernel_res, "gw.err.unimplemented",
915 "Not implemented yet"));
920 fprintf (reply_fd, "\n> %s\n", str);
921 fprintf (reply_fd, " ^ %s\n",
922 gw_res_get (info.kernel_res, "gw.err.unknown.command",
924 "Use help to see list of commands"));
929 int urp_start (int continuation, struct str_queue *queue)
931 char subject_str[128];
934 info.reply_fname = NULL;
936 if (email_header (queue, info.from_str, subject_str))
938 gw_log (GW_LOG_WARN, KERNEL_LOG, "No message body");
941 tty_init (stdout, 40, 70);
944 info.reply_fname = tempnam (gw_res_get (info.kernel_res,
945 "gw.reply.tmp.dir", NULL),
946 gw_res_get (info.kernel_res,
947 "gw.reply.tmp.prefix", "gwr"));
949 reply_fd = fopen (info.reply_fname, "w");
952 gw_log (GW_LOG_FATAL|GW_LOG_ERRNO, KERNEL_LOG, "Cannot create %s",
956 tty_init (reply_fd, 0, 0);
957 fprintf (reply_fd, "From: %s\n",
958 gw_res_get (info.kernel_res, "gw.msg.from","Email-gateway"));
959 fprintf (reply_fd, "Subject: ");
961 fprintf (reply_fd, "Z39.50 Re: %s", subject_str);
963 fprintf (reply_fd, "%s\n", gw_res_get (info.kernel_res,
966 fprintf (reply_fd, "\n");
967 gw_log (GW_LOG_ACCT, KERNEL_LOG, "User start %s", info.from_str);
970 gw_log (GW_LOG_WARN, KERNEL_LOG, "No From in email header");
971 fprintf (reply_fd, "%s\n", gw_res_get (info.kernel_res, "gw.msg.greeting",
972 "Email->Z39.50 gateway"));
974 fprintf (reply_fd, "%s\n", gw_res_get (info.kernel_res,
980 int urp_command (struct str_queue *queue)
985 while (str_queue_deq (queue, line_buf, LINE_MAX))
987 if (line_buf[0] == '\n')
990 while (str_queue_deq (queue, 0, 0))
996 if ((cp = strchr (line_buf, '\n')))
998 gw_log (GW_LOG_ACCT, KERNEL_LOG, "cmd: %s", line_buf);
999 if (isalpha (line_buf[0]))
1001 exec_command (line_buf, &stop_flag);
1004 info.command_no++; /* prevent help! */
1005 while (str_queue_deq (queue, line_buf, LINE_MAX))
1017 if (!info.command_no)
1019 fprintf (reply_fd, "%s\n",
1020 gw_res_get (info.kernel_res, "gw.err.nullbody", "No body"));
1029 assert (info.reply_fname);
1033 mta = gw_res_get (info.kernel_res, "gw.reply.mta",
1034 "/usr/lib/sendmail");
1035 sprintf (cmd, "%s %s < %s", mta, info.from_str, info.reply_fname);
1037 mta_code = system (cmd);
1039 gw_log (GW_LOG_FATAL, KERNEL_LOG,
1040 "Reply '%s' got exit code %d", cmd, mta_code);
1042 unlink (info.reply_fname);
1043 gw_log (GW_LOG_ACCT, KERNEL_LOG, "User end %s", info.from_str);