7 /* deliver to one local recipient
9 /* #include "virtual.h"
11 /* int deliver_recipient(state, usr_attr)
13 /* USER_ATTR *usr_attr;
15 /* deliver_recipient() delivers a message to a local recipient.
19 /* The attributes that specify the message, sender, and more.
21 /* Attributes describing user rights and mailbox location.
23 /* deliver_recipient() returns non-zero when delivery should be
26 /* mailbox(3) delivery to UNIX-style mailbox
27 /* maildir(3) delivery to qmail-style maildir
31 /* The Secure Mailer license must be distributed with this software.
34 /* IBM T.J. Watson Research
36 /* Yorktown Heights, NY 10598, USA
43 /* Utility library. */
47 #include <stringops.h>
53 /* Application-specific. */
57 /* deliver_recipient - deliver one local recipient */
59 int deliver_recipient(LOCAL_STATE state
, USER_ATTR usr_attr
)
61 const char *myname
= "deliver_recipient";
65 * Make verbose logging easier to understand.
69 MSG_LOG_STATE(myname
, state
);
72 * Set up the recipient-specific attributes. The recipient's lookup
73 * handle is the full address.
75 if (state
.msg_attr
.delivered
== 0)
76 state
.msg_attr
.delivered
= state
.msg_attr
.rcpt
.address
;
77 state
.msg_attr
.user
= mystrdup(state
.msg_attr
.rcpt
.address
);
78 lowercase(state
.msg_attr
.user
);
84 deliver_attr_dump(&state
.msg_attr
);
86 if (deliver_mailbox(state
, usr_attr
, &rcpt_stat
) == 0)
87 rcpt_stat
= deliver_unknown(state
);
92 myfree(state
.msg_attr
.user
);