Postfix3.3.1
unknown.c
[詳解]
1 /*++
2 /* NAME
3 /* unknown 3
4 /* SUMMARY
5 /* delivery of unknown recipients
6 /* SYNOPSIS
7 /* #include "virtual.h"
8 /*
9 /* int deliver_unknown(state)
10 /* LOCAL_STATE state;
11 /* DESCRIPTION
12 /* deliver_unknown() delivers a message for unknown recipients.
13 /* .PP
14 /* Arguments:
15 /* .IP state
16 /* Message delivery attributes (sender, recipient etc.).
17 /* .IP usr_attr
18 /* Attributes describing user rights and mailbox location.
19 /* DIAGNOSTICS
20 /* The result status is non-zero when delivery should be tried again.
21 /* LICENSE
22 /* .ad
23 /* .fi
24 /* The Secure Mailer license must be distributed with this software.
25 /* AUTHOR(S)
26 /* Wietse Venema
27 /* IBM T.J. Watson Research
28 /* P.O. Box 704
29 /* Yorktown Heights, NY 10598, USA
30 /*--*/
31 
32 /* System library. */
33 
34 #include <sys_defs.h>
35 
36 /* Utility library. */
37 
38 #include <msg.h>
39 
40 /* Global library. */
41 
42 #include <bounce.h>
43 
44 /* Application-specific. */
45 
46 #include "virtual.h"
47 
48 /* deliver_unknown - delivery for unknown recipients */
49 
51 {
52  const char *myname = "deliver_unknown";
53 
54  /*
55  * Make verbose logging easier to understand.
56  */
57  state.level++;
58  if (msg_verbose)
59  MSG_LOG_STATE(myname, state);
60 
61  dsb_simple(state.msg_attr.why, "5.1.1",
62  "unknown user: \"%s\"", state.msg_attr.user);
63  return (bounce_append(BOUNCE_FLAGS(state.request),
64  BOUNCE_ATTR(state.msg_attr)));
65 }
int msg_verbose
Definition: msg.c:177
#define BOUNCE_ATTR(attr)
Definition: local.h:134
DELIVER_REQUEST * request
Definition: local.h:113
#define BOUNCE_FLAGS(request)
int bounce_append(int flags, const char *id, MSG_STATS *stats, RECIPIENT *rcpt, const char *relay, DSN *dsn)
Definition: bounce.c:222
char * user
Definition: local.h:82
DELIVER_ATTR msg_attr
Definition: local.h:110
DSN_BUF * dsb_simple(DSN_BUF *dsb, const char *status, const char *format,...)
Definition: dsn_buf.c:275
DSN_BUF * why
Definition: local.h:92
int level
Definition: local.h:109
int deliver_unknown(LOCAL_STATE state, USER_ATTR usr_attr)
Definition: unknown.c:86
#define MSG_LOG_STATE(m, p)
Definition: local.h:150