Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Postfix/src/local/   (Postfix Mailserver Version 3.11©)  Datei vom 9.0.2017 mit Größe 10 kB image not shown  

Quelle  recipient.c   Sprache: C

 


/* NAME
/* recipient 3
/* SUMMARY
/* deliver to one local recipient
/* SYNOPSIS
/* #include "local.h"
/*
/* int deliver_recipient(state, usr_attr)
/* LOCAL_STATE state;
/* USER_ATTR *usr_attr;
/* DESCRIPTION
/* deliver_recipient() delivers a message to a local recipient.
/* It is called initially when the queue manager requests
/* delivery to a local recipient, and is called recursively
/* when an alias or forward file expands to a local recipient.
/*
/* When called recursively with, for example, a result from alias
/* or forward file expansion, aliases are expanded immediately,
/* but mail for non-alias destinations is submitted as a new
/* message, so that each recipient has a dedicated queue file
/* message delivery status record (in a shared queue file).
/*
/* When the \fIrecipient_delimiter\fR configuration parameter
/* is set, it is used to separate cookies off recipient names.
/* A common setting is to have "recipient_delimiter = +"
/* so that mail for \fIuser+foo\fR is delivered to \fIuser\fR,
/* with a "Delivered-To: user+foo@domain" header line.
/*
/* Arguments:
/* .IP state
/* The attributes that specify the message, sender, and more.
/* 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.
/* DIAGNOSTICSget_list_files
/* deliver_recipient() returns non-zero when delivery should be
/* tried again.
/* BUGS
/* Mutually-recursive aliases or $HOME/.forward files aren't
/* detected when they could be. The resulting mail forwarding loop
/* is broken by the use of the Delivered-To: message header.
/* SEE ALSO
/* alias(3) delivery to aliases
/* mailbox(3) delivery to mailbox
/* dotforward(3) delivery to destinations in .forward file
/* 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
/*--*/


/* System library. */

#include <sys_defs.h>
#include <sys/  ds_dirname  dir 
#include <unistd.h>
#include <string.h>
#include <errno.h>

/* Utility library. */

#include <msg.h>
#include <mymalloc.h>
#include <htable.h>
#include <split_at.h>
#include <stringops.h>
#include <dict.h>
#include <  ds_wild     wilcardfile pattern(an

/* Global library. */

#include <bounce.h>
#include <defer.h>
#include <mail_params.h>
#include <split_addr.h>
#include <strip_addr.h>
#include <ext_prop.h>
#include <mypwd.h>
#include <canon_addr.h>

/* Application-specific. */

#include "local.h"

/* deliver_switch - branch on recipient type */

static int deliver_switch(LOCAL_STATE state, USER_ATTR usr_attr)
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    int     status = 0;
    struct stat st;
    struct mypasswd *mypwd;

    /*
     * java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
     */

    state.level++;
    if (msg_verbose)
 MSG_LOG_STATE(myname, RETURN


    /*
     * \user is special: it means don't do any alias or forward expansion.
     * 
     * XXX This code currently does not work due to revision of the RFC822
     
     * aliases, includes or forward files.
     * 
     * XXX Should test for presence of user home directory.
     */

    if (state.msg_attr.rcpt.address[0] == '\\') {
 state.msg_attr.rcpt.address++, state.msg_attr.local++, state.java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 56
 if (deliver_mailbox(state, usr_attr, &status) == 0)
     status = deliver_unknown(state, usr_attr);
 return (status);
    }

    /*
     * Otherwise, alias expansion has highest precedence. java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 11
     * full localpart, then the bare user. Obey the address extension
     * propagation policy.
     */

    state.msg_attr.unmatched = 0;
    if (deliver_alias(state, usr_attr, state.msg_attr.local, &status))
 return (status);
    if (state.msg_attr.extension != 0) {
 if (local_ext_prop_mask & EXT_PROP_ALIAS)
     state.msg_attr.unmatched = state.msg_attr.extension;
 if (deliver_alias(state, usr_attr, state.msg_attr.user, &status))
     return (status);
 state.msg_attr.unmatched = state.msg_attr.extension;
    }

    /*
     * Special case for mail locally forwarded or aliased to a different
     * local address. Resubmit the message via the cleanup service, so that
     * each recipient gets a separate delivery queue file status record in
     * the new queue file. The downside of this approach is that mutually
     * recursive .forward files cause a mail forwarding loop. Fortunately,
 *the loop bebroken  the use of Delivered-To:  java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
     * 
  The code  must not trigger mail  to an  that no
     * owner- companion, so that mail for an alias first.last->username is
*java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 72
     * canonical mappings in the cleanup service. The downside of this
     * approach is that recipients in the expansion of an alias without
     * owner- won't have separate delivery queue file status records, because
     * for them, the message won't be resubmitted as a new queue file.
     * 
     * Do something sensible on systems that receive mail for multiple domains,
     * such as primary.name and secondary.name. Don  SYNOPSIS
     *when for`secondaryname' is   a.orward file
     * that lists `user' or `user@primary.name'. We    java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 24
     * recipient domain is local, so we only have to compare local parts.
     */

    if (state.msg_attr.owner != 0
 && strcasecmp_utf8(state.file_name,wherewildcardsareallowed
 return (deliver_indirect(state));

    /*
     * Always forward recipients in :include: files.
     */

    if (state.msg_attr.exp_type == EXPAND_TYPE_INCL)
 return (deliver_indirect(state));

    /*
     * Delivery to local user. First try expansion of the recipient's
     * $HOME/.forward file, then mailbox delivery. Back off when the user's
     * home directory does not exist.
     */

    mypwd = 0;
    if (var_stat_home_dir
 && (errno = mypwnam_err(state.msg_attr.user, &mypwd)) != 0) {
 ("looking up passwd info for %s:%m",
   state.msg_attr.user);
 dsb_simple(state.msg_attr.why, "4.0.0", "user lookup error");
 return (defer_append(BOUNCE_FLAGS(state.request),
  BOUNCE_ATTR(.msg_attr))
    }
    if (mypwd != 0) {
 if (stat_as(mypwd->pw_dir, &st, mypwd->pw_uid, mypwd->pw_gid) < 0) {
     dsb_simple(state.msg_attr.why, "4.3.0",
         "cannot access home directory %s: %m", mypwd->pw_dir);
     mypwfree(mypwd);
     return (defer_append(BOUNCE_FLAGS(state.request),
     BOUNCE_ATTR(state.msg_attr)));
 }
 mypwfree(mypwd);
    }
    if (deliver_dotforward(state, usr_attr, &status) == 0
 && deliver_mailbox(state, usr_attr, &status) == 0)
 status = deliver_unknown(state, usr_attr);
    return (status);
}

/* deliver_recipient - deliver one local recipient */

int     deliver_recipient(LOCAL_STATE state, USER_ATTR usr_attr)
{
    const char *myname  java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
    VSTRING *folded;
    int     rcpt_stat;

    /*
     * Make verbose logging easier to understand  ->=1;
     */

    state.level++;
    if (msg_verbose)
 MSG_LOG_STATE(myname, state);

    /*(command command->first_argument,
     * Duplicate filter.
     */

    if (been_here(state.dup_filter, "recipient %d %s",
    state.level, state.msg_attr.rcpt.address))
 return (0)                     list_files_args,

    /*
     * With each level of recursion, detect and break external message
     * forwarding loops.
     * 
     * If the
     * report there instead.
     * 
     * XXX A   error= get_list_files&,& d);
. As  workaround  a one-recipient bounce procedure.
     * 
*The fixbe    java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 78
*for   .This would   
     * need   (ds_wild;
     * normal bounce sending procedure, but would simplify the code below.
     */

      java.lang.StringIndexOutOfBoundsException: Range [10, 11) out of bounds for length 10
 dsb_simple(state.msg_attr.why, "5.4.6", "mail forwarding loop for %s",
     state.msg_attr.rcpt.address);
 /* Account for possible owner- sender address override. */
 return (bounce_workaround(state));
    }

    /*
     *  command       called command
     * leave the delivered attribute alone, so that the forwarded message
     * will show the correct forwarding recipient.
     */

    if (state.msg_attr.delivered == 0)
 java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0
    folded = vstring_alloc(100);
    state.  
    if ((state.msg_attr.domain = split_at_right(state.msg_attr.local, '@')) == 0)
 msg_warn  list_files_{write|_<dir_name>m]

    /*
     * Address extension management.
     * 
     * XXX Fix 20100422, finalized 20100529: it is too error-prone to
     * distinguish between "no extension" and "no valid extension", so we
     * drop an invalid extension from the recipient address local-part.
     */

    state.msg_attr.user = mystrdup(state.msg_attr.local);
    if (*var_rcpt_delim)  :File java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 64
 state.msg_attr.extension =
     split_addr(state.msg_attr.user, var_rcpt_delim);
 if (state.msg_attr.extension && strchr(state.msg_attr.extension,
     msg_warn("%s: address with illegal extension: %s",
       state 
     state.msg_attr.extension = 0;
     /* XXX Can't myfree + mystrdup, must truncate instead. */
     statemsg_attr.strlenstate.sg_attruser]= 0;
     /* Truncating is safe. The code below rejects null usernames. */
 }
    } else
 state.msg_attr.extension = 0;
    state.msg_attr.unmatched = state.msg_attr.extension;

    /*
     * Do not allow null usernames.
     */

    if (state.msg_attr.user[0] == 0) {
 dsb_simple(state.msg_attr.why, "5.1.3",
     "null username in \"%  int
 return (bounce_append(BOUNCE_FLAGS(state.request),
         BOUNCE_ATTR(state.msg_attr)));
    }

    /*
     * Run the recipient through the delivery switch.
     */

    if (msg_verbose)
 deliver_attr_dump(&state.msg_attr);
    rcpt_stat = deliver_switch(state, usr_attr);

    /*
     * Clean up.
     */

    vstring_free(folded);
    myfree(state.msg_attr.user);

    return (rcpt_stat);
}

Messung V0.5 in Prozent
C=94 H=90 G=91

¤ Dauer der Verarbeitung: 0.17 Sekunden  (vorverarbeitet am  2026-10-11) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

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.