~ubuntu-branches/ubuntu/trusty/postfix/trusty-proposed

« back to all changes in this revision

Viewing changes to src/local/deliver_attr.c

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2005-02-27 09:33:07 UTC
  • Revision ID: james.westby@ubuntu.com-20050227093307-cn789t27ibnlh6tf
Tags: upstream-2.1.5
ImportĀ upstreamĀ versionĀ 2.1.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*++
 
2
/* NAME
 
3
/*      deliver_attr 3
 
4
/* SUMMARY
 
5
/*      initialize message delivery attributes
 
6
/* SYNOPSIS
 
7
/*      #include "local.h"
 
8
/*
 
9
/*      void    deliver_attr_init(attrp)
 
10
/*      DELIVER_ATTR *attrp;
 
11
/*
 
12
/*      void    deliver_attr_dump(attrp)
 
13
/*      DELIVER_ATTR *attrp;
 
14
/* DESCRIPTION
 
15
/*      deliver_attr_init() initializes a structure with message delivery
 
16
/*      attributes to a known initial state (all zeros).
 
17
/*
 
18
/*      deliver_attr_dump() logs the contents of the given attribute list.
 
19
/* LICENSE
 
20
/* .ad
 
21
/* .fi
 
22
/*      The Secure Mailer license must be distributed with this software.
 
23
/* AUTHOR(S)
 
24
/*      Wietse Venema
 
25
/*      IBM T.J. Watson Research
 
26
/*      P.O. Box 704
 
27
/*      Yorktown Heights, NY 10598, USA
 
28
/*--*/
 
29
 
 
30
/* System library. */
 
31
 
 
32
#include <sys_defs.h>
 
33
#include <unistd.h>
 
34
 
 
35
/* Utility library. */
 
36
 
 
37
#include <msg.h>
 
38
#include <vstream.h>
 
39
 
 
40
/* Application-specific. */
 
41
 
 
42
#include "local.h"
 
43
 
 
44
/* deliver_attr_init - set message delivery attributes to all-zero state */
 
45
 
 
46
void    deliver_attr_init(DELIVER_ATTR *attrp)
 
47
{
 
48
    attrp->level = 0;
 
49
    attrp->fp = 0;
 
50
    attrp->queue_name = 0;
 
51
    attrp->queue_id = 0;
 
52
    attrp->offset = 0;
 
53
    attrp->sender = 0;
 
54
    attrp->recipient = 0;
 
55
    attrp->domain = 0;
 
56
    attrp->local = 0;
 
57
    attrp->user = 0;
 
58
    attrp->extension = 0;
 
59
    attrp->unmatched = 0;
 
60
    attrp->owner = 0;
 
61
    attrp->delivered = 0;
 
62
    attrp->relay = 0;
 
63
    attrp->exp_type = 0;
 
64
    attrp->exp_from = 0;
 
65
}
 
66
 
 
67
/* deliver_attr_dump - log message delivery attributes */
 
68
 
 
69
void    deliver_attr_dump(DELIVER_ATTR *attrp)
 
70
{
 
71
    msg_info("level: %d", attrp->level);
 
72
    msg_info("path: %s", VSTREAM_PATH(attrp->fp));
 
73
    msg_info("fp: 0x%lx", (long) attrp->fp);
 
74
    msg_info("queue_name: %s", attrp->queue_name ? attrp->queue_name : "null");
 
75
    msg_info("queue_id: %s", attrp->queue_id ? attrp->queue_id : "null");
 
76
    msg_info("offset: %ld", attrp->offset);
 
77
    msg_info("sender: %s", attrp->sender ? attrp->sender : "null");
 
78
    msg_info("recipient: %s", attrp->recipient ? attrp->recipient : "null");
 
79
    msg_info("domain: %s", attrp->domain ? attrp->domain : "null");
 
80
    msg_info("local: %s", attrp->local ? attrp->local : "null");
 
81
    msg_info("user: %s", attrp->user ? attrp->user : "null");
 
82
    msg_info("extension: %s", attrp->extension ? attrp->extension : "null");
 
83
    msg_info("unmatched: %s", attrp->unmatched ? attrp->unmatched : "null");
 
84
    msg_info("owner: %s", attrp->owner ? attrp->owner : "null");
 
85
    msg_info("delivered: %s", attrp->delivered ? attrp->delivered : "null");
 
86
    msg_info("relay: %s", attrp->relay ? attrp->relay : "null");
 
87
    msg_info("exp_type: %d", attrp->exp_type);
 
88
    msg_info("exp_from: %s", attrp->exp_from ? attrp->exp_from : "null");
 
89
}