7 /* look up/create error/retry queue
11 /* QMGR_TRANSPORT *qmgr_error_transport(service)
12 /* const char *service;
14 /* QMGR_QUEUE *qmgr_error_queue(service, dsn)
15 /* const char *service;
18 /* char *qmgr_error_nexthop(dsn)
21 /* qmgr_error_transport() looks up the error transport for the
22 /* specified service. The result is null if the transport is
25 /* qmgr_error_queue() looks up an error queue for the specified
26 /* service and problem. The result is null if the queue is not
29 /* qmgr_error_nexthop() computes the next-hop information for
30 /* the specified problem. The result must be passed to myfree().
36 /* One of MAIL_SERVICE_ERROR or MAIL_SERVICE_RETRY.
38 /* Panic: consistency check failure. Fatal: out of memory.
42 /* The Secure Mailer license must be distributed with this software.
45 /* IBM T.J. Watson Research
47 /* Yorktown Heights, NY 10598, USA
54 /* Utility library. */
57 #include <stringops.h>
61 /* Application-specific. */
65 /* qmgr_error_transport - look up error transport for specified service */
67 QMGR_TRANSPORT
*qmgr_error_transport(const char *service
)
69 QMGR_TRANSPORT
*transport
;
72 * Find or create retry transport.
74 if ((transport
= qmgr_transport_find(service
)) == 0)
75 transport
= qmgr_transport_create(service
);
76 if (QMGR_TRANSPORT_THROTTLED(transport
))
85 /* qmgr_error_queue - look up error queue for specified service and problem */
87 QMGR_QUEUE
*qmgr_error_queue(const char *service
, DSN
*dsn
)
89 QMGR_TRANSPORT
*transport
;
94 * Find or create transport.
96 if ((transport
= qmgr_error_transport(service
)) == 0)
100 * Find or create queue.
102 nexthop
= qmgr_error_nexthop(dsn
);
103 if ((queue
= qmgr_queue_find(transport
, nexthop
)) == 0)
104 queue
= qmgr_queue_create(transport
, nexthop
, nexthop
);
106 if (QMGR_QUEUE_THROTTLED(queue
))
115 /* qmgr_error_nexthop - compute next-hop information from problem description */
117 char *qmgr_error_nexthop(DSN
*dsn
)
121 nexthop
= concatenate(dsn
->status
, " ", dsn
->reason
, (char *) 0);