/*++ /* NAME /* dotforward 3 /* SUMMARY /* $HOME/.forward file expansion /* SYNOPSIS /* #include "local.h" /* /* int deliver_dotforward(state, usr_attr, statusp) /* LOCAL_STATE state; /* USER_ATTR usr_attr; /* int *statusp; /* DESCRIPTION /* deliver_dotforward() delivers a message to the destinations /* listed in a recipient's .forward file(s) as specified through /* the forward_path configuration parameter. The result is /* zero when no acceptable .forward file was found, or when /* a recipient is listed in her own .forward file. Expansions /* are scrutinized with the forward_expansion_filter parameter. /* /* Arguments: /* .IP state /* Message delivery attributes (sender, recipient etc.). /* Attributes describing alias, include or forward expansion. /* A table with the results from expanding aliases or lists. /* A table with delivered-to: addresses taken from the message. /* .IP usr_attr /* Attributes describing user rights and environment. /* .IP statusp /* Message delivery status. See below. /* DIAGNOSTICS /* Fatal errors: out of memory. Warnings: bad $HOME/.forward /* file type, permissions or ownership. The message delivery /* status is non-zero when delivery should be tried again. /* SEE ALSO /* include(3) include file processor. /* LICENSE /* .ad /* .fi /* The Secure Mailer license must be distributed with this software. /* AUTHOR(S) /* Wietse Venema /* IBM T.J. Watson Research /* P.O. Box 704 /* Yorktown Heights, NY 10598, USA
/*--*/
/* deliver_dotforward - expand contents of .forward file */
int deliver_dotforward(LOCAL_STATE state, USER_ATTR usr_attr, int *statusp)
{ constchar *myname = "deliver_dotforward"; struct stat st;
VSTRING *path; struct mypasswd *mypwd; int fd;
VSTREAM *fp; int status; int forward_found = NO; int lookup_status; int addr_count; char *saved_forward_path; char *lhs; char *next; int expand_status; int saved_notify;
/* *Makeverboseloggingeasiertounderstand.
*/
state.level++; if (msg_verbose)
MSG_LOG_STATE(myname, state);
/* *Skipthismoduleifper-userforwardingisdisabled.
*/ if (*var_forward_path == 0) return (NO);
/* *Skipnon-existingusers.Themailboxdeliveryroutinewillcatchthe *error.
*/ if ((errno = mypwnam_err(state.msg_attr.user, &mypwd)) != 0) {
msg_warn("error looking up passwd info for %s: %m",
state.msg_attr.user);
dsb_simple(state.msg_attr.why, "4.0.0", "user lookup error");
*statusp = defer_append(BOUNCE_FLAGS(state.request),
BOUNCE_ATTR(state.msg_attr)); return (YES);
} if (mypwd == 0) return (NO);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.