xref: /freebsd/contrib/sendmail/libmilter/docs/smfi_getsymval.html (revision 924226fba12cc9a228c73b956e1b7fa24c60b055)
1<HTML>
2<HEAD><TITLE>smfi_getsymval</TITLE></HEAD>
3<BODY>
4<!--
5$Id: smfi_getsymval.html,v 1.16 2013-11-22 20:51:39 ca Exp $
6-->
7<H1>smfi_getsymval</H1>
8
9<TABLE border="0" cellspacing=4 cellpadding=4>
10<!---------- Synopsis ----------->
11<TR><TH valign="top" align=left width=100>SYNOPSIS</TH><TD>
12<PRE>
13#include &lt;libmilter/mfapi.h&gt;
14char* smfi_getsymval(
15	SMFICTX *ctx,
16	char *symname
17);
18</PRE>
19Get the value of a sendmail macro.
20</TD></TR>
21
22<!----------- Description ---------->
23<TR><TH valign="top" align=left>DESCRIPTION</TH><TD>
24<TABLE border="1" cellspacing=1 cellpadding=4>
25<TR align="left" valign=top>
26<TH width="80">Called When</TH>
27<TD>smfi_getsymval may be called from within any of the xxfi_* callbacks.  Which macros are defined will depend on when it is called.</TD>
28</TR>
29<TR align="left" valign=top>
30<TH width="80">Effects</TH>
31<TD>None.</TD>
32</TR>
33</TABLE>
34</TD></TR>
35
36<!----------- Arguments ---------->
37<TR><TH valign="top" align=left>ARGUMENTS</TH><TD>
38    <TABLE border="1" cellspacing=0>
39    <TR bgcolor="#dddddd"><TH>Argument</TH><TH>Description</TH></TR>
40    <TR valign="top"><TD>ctx</TD>
41	<TD>The opaque context structure.
42	</TD></TR>
43    <TR valign="top"><TD>symname</TD>
44	<TD>The name of a sendmail macro.
45	Single letter macros can optionally be enclosed in braces ("{" and "}"),
46	longer macro names must be enclosed in braces, just as in a
47	<TT>sendmail.cf</TT> file.
48	<A href="#notes">See below</A> for default macros.
49	</TD></TR>
50    </TABLE>
51</TD></TR>
52
53<!----------- Return values ---------->
54<TR>
55<TH valign="top" align=left>RETURN VALUES</TH>
56
57<TD>smfi_getsymval returns the value of the given macro as a null-terminated string, or NULL if the macro is not defined.</TD>
58</TR>
59
60<!----------- Notes ---------->
61<TR align="left" valign=top>
62<TH><A name="notes">NOTES</A></TH>
63<TD>
64By default, the following macros are valid in the given contexts:
65
66<TABLE border="1" cellspacing=0>
67<TR bgcolor="#dddddd"><TH>Sent With</TH><TH>Macros</TH></TR>
68<TR><TD>xxfi_connect</TD>    <TD>daemon_name, if_name, if_addr, j, _</TD></TR>
69<TR><TD>xxfi_helo</TD>       <TD>tls_version, cipher, cipher_bits, cert_subject, cert_issuer</TD></TR>
70<TR><TD>xxfi_envfrom</TD>    <TD>i, auth_type, auth_authen, auth_ssf, auth_author,
71                mail_mailer, mail_host, mail_addr</TD></TR>
72<TR><TD>xxfi_envrcpt</TD>    <TD>rcpt_mailer, rcpt_host, rcpt_addr</TD></TR>
73
74<TR><TD>xxfi_data</TD>   <TD>(none)</TD></TR>
75<TR><TD>xxfi_eoh</TD>    <TD>(none)</TD></TR>
76<TR><TD>xxfi_eom</TD>    <TD>msg_id</TD></TR>
77</TABLE>
78<P>
79All macros stay in effect from the point they are received
80until the end of the connection for the first two sets,
81the end of the message for the third (xxfi_envfrom) and last (xxfi_eom),
82and just for each recipient for xxfi_envrcpt.
83<P>
84The macro list can be changed using the confMILTER_MACROS_* options in
85sendmail.mc.
86The scopes of such macros will be determined by when they are set by sendmail.
87For descriptions of macros' values,
88please see the
89"Sendmail Installation and Operation Guide"
90provided with your sendmail distribution.
91
92</TD>
93</TR>
94
95</TABLE>
96
97<HR size="1">
98<FONT size="-1">
99Copyright (c) 2000, 2002-2003, 2007 Proofpoint, Inc. and its suppliers.
100All rights reserved.
101<BR>
102By using this file, you agree to the terms and conditions set
103forth in the LICENSE.
104</FONT>
105</BODY>
106</HTML>
107