2
0
mirror of https://github.com/vdukhovni/postfix synced 2025-09-02 23:25:31 +00:00

snapshot-19990905

This commit is contained in:
Wietse Venema
1999-09-05 00:00:00 -05:00
parent 92ecf320ac
commit 9fc0db5ed5
132 changed files with 368 additions and 3932 deletions

View File

@@ -2928,7 +2928,7 @@ Apologies for any names omitted.
19990810 19990810
Feature: added "-c config_directory" support to the postconf Feature: added "-c config_dir" support to the postconf
command. This probably means that "-f file" will never be command. This probably means that "-f file" will never be
implemented. implemented.
@@ -3008,3 +3008,26 @@ Apologies for any names omitted.
Bugfix: in case of some error conditions the pickup daemon Bugfix: in case of some error conditions the pickup daemon
could leak small amounts of memory. could leak small amounts of memory.
19990905
Bugfix: no more "skipping further client input" warnings
when a message header is rejected.
Feature: reject_unauth_pipelining SMTP restriction that
rejects mail from clients that improperly use SMTP command
pipelining.
Robustness: the LDAP client by default no longer looks up
names containing "*". See the lookup_wildcards feature in
LDAP_README. Update by John Hensley.
Documentation: address masquerading with exceptions FAQ by
Jim Seymour @ jimsun.LinxNet.com.
Bugfix: mysql reconnect after disconnect by Scott Cotton
Internet Consultants Group, Inc. File: util/dict_myqsl.c.
Portability: the Postfix to PCRE interface now expects
version 2.08. Postfix is no longer compatible with PCRE
versions before 2.6.

View File

@@ -67,6 +67,13 @@ Defaults are given in parentheses:
substitute for the address Postfix is trying to resolve, e.g. substitute for the address Postfix is trying to resolve, e.g.
ldapsource_query_filter = (&(mail=%s)(paid_up=true)) ldapsource_query_filter = (&(mail=%s)(paid_up=true))
lookup_wildcards (no)
Whether to search for addresses containing '*'. This has huge
potential for spammers, so by default, any address containing
'*' will cause the lookup to return nothing. Unless another
dictionary returns a valid lookup for it, the mail will bounce
with an 'unknown user' message.
result_attribute (maildrop) result_attribute (maildrop)
The attribute Postfix will read from any directory entries The attribute Postfix will read from any directory entries
returned by the lookup, to be resolved to an email address. returned by the lookup, to be resolved to an email address.

View File

@@ -19,10 +19,10 @@ from:
You will need to add -DHAS_PCRE and a -I for the PCRE header to CCARGS, You will need to add -DHAS_PCRE and a -I for the PCRE header to CCARGS,
and add the path to the PCRE library to AUXLIBS, for example: and add the path to the PCRE library to AUXLIBS, for example:
make -f Makefile.init makefiles 'CCARGS=-DHAS_PCRE -I../../pcre-2.05' \ make -f Makefile.init makefiles 'CCARGS=-DHAS_PCRE -I../../pcre-2.08' \
'AUXLIBS=../../pcre-2.05/libpcre.a' 'AUXLIBS=../../pcre-2.08/libpcre.a'
[note: earlier pcre versions have problems -- Wietse] [note: pcre versions before 2.06 are no longer compatible -- Wietse]
One possible use is to add a line to main.cf: One possible use is to add a line to main.cf:

View File

@@ -1,5 +1,5 @@
Incompatible changes with snapshot-19990627: Incompatible changes with postfix-19990904
============================================ ==========================================
- On systems that use user.lock files to protect system mailboxes - On systems that use user.lock files to protect system mailboxes
against simultaneous updates, Postfix now uses /file/name.lock against simultaneous updates, Postfix now uses /file/name.lock
@@ -7,16 +7,23 @@ files while delivering to files specified in aliases/forward/include
files. This is a no-op when the recipient lacks directory write files. This is a no-op when the recipient lacks directory write
permission. permission.
Major changes with snapshot-19990627: - The LDAP client code no longer looks up name containing "*"
===================================== because it could be abused. See the LDAP_README file for how to
restore previous behavior.
- The Postfix to PCRE interface now expects PCRE version 2.08.
Postfix is no longer compatible with PCRE versions prior to 2.06.
Major changes with postfix-19990904
===================================
Several bugfixes, none related to security. See the HISTORY file Several bugfixes, none related to security. See the HISTORY file
for a complete list of changes. for a complete list of changes.
- Postfix is now distributed under IBM Public License Version 1.0 - Postfix is now distributed under IBM Public License Version 1.0
(June 14, 1999), which does not carry the controversial termination which does not carry the controversial termination clause. The new
clause. The new license does have a requirement that contributors license does have a requirement that contributors make source code
make source code available. available.
- The ugly Delivered-To: header can now be turned off selectively. - The ugly Delivered-To: header can now be turned off selectively.
The default setting is: "prepend_delivered_header = command, file, The default setting is: "prepend_delivered_header = command, file,
@@ -26,6 +33,24 @@ mail is not recommended.
- mysql client support by Scott Cotton and Joshua Marcus, Internet - mysql client support by Scott Cotton and Joshua Marcus, Internet
Consultants Group, Inc. See the file MYSQL_README for instructions. Consultants Group, Inc. See the file MYSQL_README for instructions.
- reject_unauth_destination SMTP recipient restriction that rejects
destinations not in $relay_domains. Unlike the check_relay_domains
restriction, reject_unauth_destination ignores the client hostname.
By Lamont Jones of Hewlett-Packard.
- reject_unauth_pipelining SMTP *anything* restriction to stop mail
from spammers that improperly use SMTP command pipelining to speed
up their deliveries.
- Postfix "sendmail" now issues a warning and drops privileges if
installed set-uid root.
- No more duplicate delivery when "postfix reload" is immediately
followed by "sendmail -q".
- No more "invalid argument" errors when a Postfix daemon opens a
DB/DBM file while some other process is changing the file.
- Portability to the Mac OS X Server, Reliant Unix, AIX 3.2.5 and - Portability to the Mac OS X Server, Reliant Unix, AIX 3.2.5 and
Ultrix 4.3. Ultrix 4.3.

View File

@@ -261,6 +261,7 @@ cleanup_skip.o: ../include/sys_defs.h
cleanup_skip.o: ../include/msg.h cleanup_skip.o: ../include/msg.h
cleanup_skip.o: ../include/vstream.h cleanup_skip.o: ../include/vstream.h
cleanup_skip.o: ../include/vbuf.h cleanup_skip.o: ../include/vbuf.h
cleanup_skip.o: ../include/cleanup_user.h
cleanup_skip.o: ../include/record.h cleanup_skip.o: ../include/record.h
cleanup_skip.o: ../include/vstring.h cleanup_skip.o: ../include/vstring.h
cleanup_skip.o: ../include/rec_type.h cleanup_skip.o: ../include/rec_type.h

View File

@@ -33,6 +33,7 @@
/* Global library. */ /* Global library. */
#include <cleanup_user.h>
#include <record.h> #include <record.h>
#include <rec_type.h> #include <rec_type.h>
@@ -46,7 +47,8 @@ void cleanup_skip(void)
{ {
int type; int type;
msg_warn("%s: skipping further client input", cleanup_queue_id); if ((cleanup_errs & CLEANUP_STAT_CONT) == 0)
msg_warn("%s: skipping further client input", cleanup_queue_id);
/* /*
* XXX Rely on the front-end programs to enforce record size limits. * XXX Rely on the front-end programs to enforce record size limits.

View File

@@ -111,3 +111,5 @@
# P.O. Box 704 # P.O. Box 704
# Yorktown Heights, NY 10598, USA # Yorktown Heights, NY 10598, USA
#-- #--
# By default, this file is not used. See sample-canonical.cf

View File

@@ -76,3 +76,5 @@
# P.O. Box 704 # P.O. Box 704
# Yorktown Heights, NY 10598, USA # Yorktown Heights, NY 10598, USA
#-- #--
# By default, this file is not used. See sample-relocated.cf

View File

@@ -107,3 +107,5 @@
# P.O. Box 704 # P.O. Box 704
# Yorktown Heights, NY 10598, USA # Yorktown Heights, NY 10598, USA
#-- #--
# By default, this file is not used. See sample-transport.cf

View File

@@ -103,3 +103,5 @@
# P.O. Box 704 # P.O. Box 704
# Yorktown Heights, NY 10598, USA # Yorktown Heights, NY 10598, USA
#-- #--
# By default, this file is not used. See sample-virtual.cf

View File

@@ -793,6 +793,8 @@ extern char *var_maps_rbl_domains;
#define DEF_SMTPD_DELAY_REJECT 1 #define DEF_SMTPD_DELAY_REJECT 1
extern int var_smtpd_delay_reject; extern int var_smtpd_delay_reject;
#define REJECT_UNAUTH_PIPE "reject_unauth_pipelining"
/* /*
* Other. * Other.
*/ */

View File

@@ -15,7 +15,7 @@
* Version of this program. * Version of this program.
*/ */
#define VAR_MAIL_VERSION "mail_version" #define VAR_MAIL_VERSION "mail_version"
#define DEF_MAIL_VERSION "Snapshot-19990904" #define DEF_MAIL_VERSION "Snapshot-19990905"
extern char *var_mail_version; extern char *var_mail_version;
/* LICENSE /* LICENSE

View File

@@ -30,6 +30,8 @@
<li><a href="#local">Delivering some users locally while sending mail as user@domain</a> <li><a href="#local">Delivering some users locally while sending mail as user@domain</a>
<li><a href="#masquerade">Address masquerading with exceptions</a>
<li><a href="#scanning">Support for virus scanning</a> <li><a href="#scanning">Support for virus scanning</a>
<li><a href="#maildir">Support for maildir-style mailboxes</a> <li><a href="#maildir">Support for maildir-style mailboxes</a>
@@ -421,6 +423,95 @@ effective.
<hr> <hr>
<a name="masquerade"><h2>Address masquerading with exceptions</h2></a>
For people outside your organization it can be desirable to only
see addresses of the form <i>user@company.com</i> rather than
addresses with individual internal host names. This can be achieved
with address masquerading.
<p>
Address masquerading is intended for use only on mail gateways.
<ul>
<li>In order to have all mail through the gateway host appear as
coming from <i>user@my.domain</i>, edit <b>/etc/postfix/main.cf</b>
and specify:
<p>
<dl>
<dd><b>masquerade_domains = </b><i>$mydomain</i>
</dl>
<p>
Note that the gateway should have <b>append_dot_domain</b> and
<b>append_myorigin</b> turned on (which is the default setting) so
that all addresses are fully qualified before they are subjected
to address masquerading.
</ul>
<p>
In some cases, you may wish to have certain users or hosts exempted
from masquerading.
<ul>
<li>To exempt certain <i>users</i> from masquerading,
such as <b>root</b>, add:
<p>
<dl>
<dd><b>masquerade_exceptions = </b><i>root</i>
</dl>
<p>
<li>To exempt certain <i>hosts</i> from masquerading, write
<b>masquerade_domains</b> as:
<p>
<dl>
<dd><b>masquerade_domains = </b><i>somehost.my.domain otherhost.my.domain
$mydomain</i>
</dl>
<p>
Note that the order above is crucial: exemptions such as
<i>somehost.my.domain</i> must precede <i>$mydomain</i> in the
statement.
<p>
It should go without saying that if a particular host you wish to
exempt this way is originating mail as <i>user@my.domain</i> in
the first place, you can hardly exempt it.
<p>
</ul>
As usual, execute the command <b>postfix reload</b> to make the changes
effective.
<p>
<hr>
<a name="scanning"><h2>Support for virus scanning</h2> </a> <a name="scanning"><h2>Support for virus scanning</h2> </a>
Would not it be great if operating systems and applications actually Would not it be great if operating systems and applications actually
@@ -531,7 +622,7 @@ shell are replaced by underscores.
<dt><b>EXTENSION</b> <dd> Optional address extension part. <dt><b>EXTENSION</b> <dd> Optional address extension part.
<dt><b>HOME</b> <dd> The recpient's home directory. <dt><b>HOME</b> <dd> The recipient's home directory.
<dt><b>LOCAL</b> <dd> The text to the left-hand side of the <b>@</b> <dt><b>LOCAL</b> <dd> The text to the left-hand side of the <b>@</b>
in the recipient address, for example, <b>$USER+$EXTENSION</b>. in the recipient address, for example, <b>$USER+$EXTENSION</b>.
@@ -975,8 +1066,8 @@ version</a> which has a db-1.85 compatible interface.
<p> <p>
Use the following commands in the Postfix top-level directory. Use the following commands in the Postfix top-level directory.
The LD_LIBRARY_PATH unsets may be required to avoid linking in the The LD_LIBRARY_PATH unset commands may be required to avoid linking
wrong libraries. in the wrong libraries.
<dl> <dl>

View File

@@ -48,7 +48,7 @@ LOCAL(8) LOCAL(8)
Characters that may have special meaning to the shell or Characters that may have special meaning to the shell or
file system are replaced by underscores. The list of file system are replaced by underscores. The list of
acceptable characters is specified with the <b>forward</b><i>_</i><b>expan-</b> acceptable characters is specified with the <b>forward</b><i>_</i><b>expan-</b>
<b>sion</b><i>_</i><b>filter</b> configuration <b>sion</b><i>_</i><b>filter</b> configuration parameter.
An alias or ~/.<b>forward</b> file may list any combination of An alias or ~/.<b>forward</b> file may list any combination of
external commands, destination file names, <b>:include:</b> external commands, destination file names, <b>:include:</b>

View File

@@ -92,7 +92,7 @@ MASTER(8) MASTER(8)
in the <b>main.cf</b> configuration file. in the <b>main.cf</b> configuration file.
<b>MAIL</b><i>_</i><b>CONFIG</b> <b>MAIL</b><i>_</i><b>CONFIG</b>
Directory with configuration files. Directory with Postfix configuration files.
<b>CONFIGURATION</b> <b>PARAMETERS</b> <b>CONFIGURATION</b> <b>PARAMETERS</b>
The following <b>main.cf</b> parameters are especially relevant The following <b>main.cf</b> parameters are especially relevant
@@ -105,26 +105,26 @@ MASTER(8) MASTER(8)
The owner of the mail queue and of most Postfix The owner of the mail queue and of most Postfix
processes. processes.
<b>program</b><i>_</i><b>directory</b> <b>command</b><i>_</i><b>directory</b>
Directory with Postfix support programs and dae- Directory with Postfix support programs.
mons.
<b>daemon</b><i>_</i><b>directory</b>
Directory with Postfix daemon programs.
<b>queue</b><i>_</i><b>directory</b> <b>queue</b><i>_</i><b>directory</b>
Top-level directory of the Postfix queue. This is Top-level directory of the Postfix queue. This is
also the root directory of Postfix daemons that run also the root directory of Postfix daemons that run
chrooted. chrooted.
<b>Resource</b> <b>controls</b> <b>Resource</b> <b>controls</b>
<b>default</b><i>_</i><b>process</b><i>_</i><b>limit</b> <b>default</b><i>_</i><b>process</b><i>_</i><b>limit</b>
Default limit for the number of simultaneous child Default limit for the number of simultaneous child
processes that provide a given service. processes that provide a given service.
<b>max</b><i>_</i><b>idle</b> <b>max</b><i>_</i><b>idle</b>
Limit the time in seconds that a child process Limit the time in seconds that a child process
waits between service requests. waits between service requests.
<b>max</b><i>_</i><b>use</b>
Limit the number of service requests handled by a
@@ -137,10 +137,12 @@ MASTER(8) MASTER(8)
MASTER(8) MASTER(8) MASTER(8) MASTER(8)
<b>max</b><i>_</i><b>use</b>
Limit the number of service requests handled by a
child process. child process.
<b>service</b><i>_</i><b>throttle</b><i>_</i><b>time</b> <b>service</b><i>_</i><b>throttle</b><i>_</i><b>time</b>
Time to avoid forking a server that appears to be Time to avoid forking a server that appears to be
broken. broken.
<b>FILES</b> <b>FILES</b>
@@ -154,7 +156,7 @@ MASTER(8) MASTER(8)
syslogd(8) system logging syslogd(8) system logging
<b>LICENSE</b> <b>LICENSE</b>
The Secure Mailer license must be distributed with this The Secure Mailer license must be distributed with this
software. software.
<b>AUTHOR(S)</b> <b>AUTHOR(S)</b>
@@ -189,8 +191,6 @@ MASTER(8) MASTER(8)

View File

@@ -87,7 +87,7 @@ POSTALIAS(1) POSTALIAS(1)
<b>ENVIRONMENT</b> <b>ENVIRONMENT</b>
<b>MAIL</b><i>_</i><b>CONFIG</b> <b>MAIL</b><i>_</i><b>CONFIG</b>
Mail configuration database. Directory with Postfix configuration files.
<b>MAIL</b><i>_</i><b>VERBOSE</b> <b>MAIL</b><i>_</i><b>VERBOSE</b>
Enable verbose logging for debugging purposes. Enable verbose logging for debugging purposes.

View File

@@ -19,9 +19,9 @@ POSTCAT(1) POSTCAT(1)
Options: Options:
<b>-v</b> Enable verbose mode for debugging purposes. Multi- <b>-v</b> Enable verbose logging for debugging purposes. Mul-
ple <b>-v</b> options make the software increasingly ver- tiple <b>-v</b> options make the software increasingly
bose. verbose.
<b>DIAGNOSTICS</b> <b>DIAGNOSTICS</b>
Problems are reported to the standard error stream. Problems are reported to the standard error stream.

View File

@@ -25,19 +25,17 @@ POSTCONF(1) POSTCONF(1)
<b>-d</b> Print default parameter settings instead of actual <b>-d</b> Print default parameter settings instead of actual
settings. settings.
<b>-h</b> Show parameter values only, not the ``name ='' <b>-h</b> Show parameter values only, not the ``name = ''
label that normally precedes the value. label that normally precedes the value.
<b>-n</b> Print non-default parameter settings only. <b>-n</b> Print non-default parameter settings only.
<b>-v</b> Enable verbose mode for debugging purposes. Multi- <b>-v</b> Enable verbose logging for debugging purposes. Mul-
ple <b>-v</b> options make the software increasingly ver- tiple <b>-v</b> options make the software increasingly
bose. verbose.
<b>DIAGNOSTICS</b> <b>DIAGNOSTICS</b>
Problems are reported to the standard error stream. Fatal Problems are reported to the standard error stream.
error: out of memory, file not found, invalid <b>main.cf</b>
parameter syntax.
<b>LICENSE</b> <b>LICENSE</b>
The Secure Mailer license must be distributed with this The Secure Mailer license must be distributed with this
@@ -62,6 +60,8 @@ POSTCONF(1) POSTCONF(1)
1 1

View File

@@ -80,7 +80,7 @@ POSTFIX(1) POSTFIX(1)
ables: ables:
<b>MAIL</b><i>_</i><b>CONFIG</b> <b>MAIL</b><i>_</i><b>CONFIG</b>
The Postfix configuration directory. Directory with Postfix configuration files.
<b>MAIL</b><i>_</i><b>VERBOSE</b> <b>MAIL</b><i>_</i><b>VERBOSE</b>
This is set when the -v command-line option is pre- This is set when the -v command-line option is pre-
@@ -94,15 +94,15 @@ POSTFIX(1) POSTFIX(1)
as process environment variables with the same names: as process environment variables with the same names:
<b>command</b><i>_</i><b>directory</b> <b>command</b><i>_</i><b>directory</b>
The directory with Postfix support commands Directory with Postfix support commands (default:
(default: <b>$program</b><i>_</i><b>directory</b>). <b>$program</b><i>_</i><b>directory</b>).
<b>daemon</b><i>_</i><b>directory</b> <b>daemon</b><i>_</i><b>directory</b>
The directory with Postfix daemon programs Directory with Postfix daemon programs (default:
(default: <b>$program</b><i>_</i><b>directory</b>). <b>$program</b><i>_</i><b>directory</b>).
<b>config</b><i>_</i><b>directory</b> <b>config</b><i>_</i><b>directory</b>
The directory with configuration files and with Directory with Postfix configuration files and with
administrative shell scripts. administrative shell scripts.
<b>queue</b><i>_</i><b>directory</b> <b>queue</b><i>_</i><b>directory</b>

View File

@@ -50,7 +50,7 @@ POSTKICK(1) POSTKICK(1)
Directory with Postfix configuration files. Directory with Postfix configuration files.
<b>MAIL</b><i>_</i><b>VERBOSE</b> <b>MAIL</b><i>_</i><b>VERBOSE</b>
Enable verbose logging. Enable verbose logging for debugging purposes.
<b>CONFIGURATION</b> <b>PARAMETERS</b> <b>CONFIGURATION</b> <b>PARAMETERS</b>
The following <b>main.cf</b> parameters are especially relevant The following <b>main.cf</b> parameters are especially relevant

View File

@@ -22,9 +22,9 @@ POSTLOCK(1) POSTLOCK(1)
Read configuration information from <b>main.cf</b> in the Read configuration information from <b>main.cf</b> in the
named configuration directory. named configuration directory.
<b>-v</b> Enable verbose mode for debugging purposes. Multi- <b>-v</b> Enable verbose logging for debugging purposes. Mul-
ple <b>-v</b> options make the software increasingly ver- tiple <b>-v</b> options make the software increasingly
bose. verbose.
Arguments: Arguments:
@@ -54,7 +54,7 @@ POSTLOCK(1) POSTLOCK(1)
Directory with Postfix configuration files. Directory with Postfix configuration files.
<b>MAIL</b><i>_</i><b>VERBOSE</b> <b>MAIL</b><i>_</i><b>VERBOSE</b>
Enable verbose logging. Enable verbose logging for debugging purposes.
<b>CONFIGURATION</b> <b>PARAMETERS</b> <b>CONFIGURATION</b> <b>PARAMETERS</b>
The following <b>main.cf</b> parameters are especially relevant The following <b>main.cf</b> parameters are especially relevant

View File

@@ -106,7 +106,7 @@ POSTMAP(1) POSTMAP(1)
<b>ENVIRONMENT</b> <b>ENVIRONMENT</b>
<b>MAIL</b><i>_</i><b>CONFIG</b> <b>MAIL</b><i>_</i><b>CONFIG</b>
Mail configuration database Directory with Postfix configuration files.
<b>MAIL</b><i>_</i><b>VERBOSE</b> <b>MAIL</b><i>_</i><b>VERBOSE</b>
Enable verbose logging for debugging purposes. Enable verbose logging for debugging purposes.

View File

@@ -36,9 +36,9 @@ POSTSUPER(1) POSTSUPER(1)
<b>-p</b> Purge stale files (files that are left over after <b>-p</b> Purge stale files (files that are left over after
system or software crashes). system or software crashes).
<b>-v</b> Enable verbose mode for debugging purposes. Multi- <b>-v</b> Enable verbose logging for debugging purposes. Mul-
ple <b>-v</b> options make the software increasingly ver- tiple <b>-v</b> options make the software increasingly
bose. verbose.
<b>DIAGNOSTICS</b> <b>DIAGNOSTICS</b>
Problems are reported to the standard error stream and to Problems are reported to the standard error stream and to

View File

@@ -95,8 +95,8 @@ RELOCATED(5) RELOCATED(5)
<a href="postmap.1.html">postmap(1)</a> create lookup table <a href="postmap.1.html">postmap(1)</a> create lookup table
<b>LICENSE</b> <b>LICENSE</b>
The Secure Mailer license must be distributed with The Secure Mailer license must be distributed with this
this software. software.
<b>AUTHOR(S)</b> <b>AUTHOR(S)</b>
Wietse Venema Wietse Venema

View File

@@ -212,7 +212,7 @@ SENDMAIL(1) SENDMAIL(1)
Directory with Postfix configuration files. Directory with Postfix configuration files.
<b>MAIL</b><i>_</i><b>VERBOSE</b> <b>MAIL</b><i>_</i><b>VERBOSE</b>
Enable verbose logging Enable verbose logging for debugging purposes.
<b>MAIL</b><i>_</i><b>DEBUG</b> <b>MAIL</b><i>_</i><b>DEBUG</b>
Enable debugging with an external command, as spec- Enable debugging with an external command, as spec-

View File

@@ -1,44 +0,0 @@
#ifndef _ARGV_H_INCLUDED_
#define _ARGV_H_INCLUDED_
/*++
/* NAME
/* argv 3h
/* SUMMARY
/* string array utilities
/* SYNOPSIS
/* #include "argv.h"
DESCRIPTION
.nf
/*
* External interface.
*/
typedef struct ARGV {
int len; /* number of array elements */
int argc; /* array elements in use */
char **argv; /* string array */
} ARGV;
extern ARGV *argv_alloc(int);
extern void argv_add(ARGV *,...);
extern void argv_terminate(ARGV *);
extern ARGV *argv_free(ARGV *);
extern ARGV *argv_split(const char *, const char *);
extern ARGV *argv_split_append(ARGV *, const char *, const char *);
#define ARGV_END ((char *) 0)
/* 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
/*--*/
#endif

View File

@@ -1,33 +0,0 @@
#ifndef _ATTR_H_INCLUDED_
#define _ATTR_H_INCLUDED_
/*++
/* NAME
/* attr 3h
/* SUMMARY
/* attribute list manager
/* SYNOPSIS
/* #include <attr.h>
/* DESCRIPTION
/* .nf
/*
* External interface.
*/
extern void attr_enter(HTABLE *, const char *, const char *);
extern void attr_free(HTABLE *);
#define attr_find(table, name) htable_find((table), (name))
/* 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
/*--*/
#endif

View File

@@ -1,58 +0,0 @@
#ifndef _BINHASH_H_INCLUDED_
#define _BINHASH_H_INCLUDED_
/*++
/* NAME
/* binhash 3h
/* SUMMARY
/* hash table manager
/* SYNOPSIS
/* #include <binhash.h>
/* DESCRIPTION
/* .nf
/* Structure of one hash table entry. */
typedef struct BINHASH_INFO {
char *key; /* lookup key */
int key_len; /* key length */
char *value; /* associated value */
struct BINHASH_INFO *next; /* colliding entry */
struct BINHASH_INFO *prev; /* colliding entry */
} BINHASH_INFO;
/* Structure of one hash table. */
typedef struct BINHASH {
int size; /* length of entries array */
int used; /* number of entries in table */
BINHASH_INFO **data; /* entries array, auto-resized */
} BINHASH;
extern BINHASH *binhash_create(int);
extern BINHASH_INFO *binhash_enter(BINHASH *, const char *, int, char *);
extern BINHASH_INFO *binhash_locate(BINHASH *, const char *, int);
extern char *binhash_find(BINHASH *, const char *, int);
extern void binhash_delete(BINHASH *, const char *, int, void (*) (char *));
extern void binhash_free(BINHASH *, void (*) (char *));
extern void binhash_walk(BINHASH *, void (*) (BINHASH_INFO *, char *), char *);
extern BINHASH_INFO **binhash_list(BINHASH *);
/* 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
/* CREATION DATE
/* Thu Feb 20 16:54:29 EST 1997
/* LAST MODIFICATION
/* %E% %U%
/* VERSION/RELEASE
/* %I%
/*--*/
#endif

View File

@@ -1,29 +0,0 @@
#ifndef _CHROOT_UID_H_INCLUDED_
#define _CHROOT_UID_H_INCLUDED_
/*++
/* NAME
/* chroot_uid 3h
/* SUMMARY
/* limit possible damage a process can do
/* SYNOPSIS
/* #include <chroot_uid.h>
/* DESCRIPTION
/* .nf
/* External interface. */
extern void chroot_uid(const char *, const char *);
/* 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
/*--*/
#endif

View File

@@ -1,37 +0,0 @@
#ifndef _CONNECT_H_INCLUDED_
#define _CONNECT_H_INCLUDED_
/*++
/* NAME
/* connect 3h
/* SUMMARY
/* client interface file
/* SYNOPSIS
/* #include <connect.h>
/* DESCRIPTION
/* .nf
/*
* Utility library.
*/
#include <iostuff.h>
/*
* Client external interface.
*/
extern int unix_connect(const char *, int, int);
extern int inet_connect(const char *, int, int);
extern int stream_connect(const char *, int, int);
/* 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
/*--*/
#endif

View File

@@ -1,100 +0,0 @@
#ifndef _DICT_H_INCLUDED_
#define _DICT_H_INCLUDED_
/*++
/* NAME
/* dict 3h
/* SUMMARY
/* dictionary manager
/* SYNOPSIS
/* #include <dict.h>
/* DESCRIPTION
/* .nf
/*
* System library.
*/
#include <fcntl.h>
/*
* Utility library.
*/
#include <vstream.h>
/*
* Generic dictionary interface - in reality, a dictionary extends this
* structure with private members to maintain internal state.
*/
typedef struct DICT {
int flags; /* see below */
const char *(*lookup) (struct DICT *, const char *);
void (*update) (struct DICT *, const char *, const char *);
int (*delete) (struct DICT *, const char *);
int (*sequence) (struct DICT *, int, const char **, const char **);
void (*close) (struct DICT *);
int fd; /* for dict_update() lock */
time_t mtime; /* mod time at open */
} DICT;
#define DICT_FLAG_DUP_WARN (1<<0) /* if file, warn about dups */
#define DICT_FLAG_DUP_IGNORE (1<<1) /* if file, ignore dups */
#define DICT_FLAG_TRY0NULL (1<<2) /* do not append 0 to key/value */
#define DICT_FLAG_TRY1NULL (1<<3) /* append 0 to key/value */
#define DICT_FLAG_FIXED (1<<4) /* fixed key map */
#define DICT_FLAG_PATTERN (1<<5) /* keys are patterns */
#define DICT_FLAG_LOCK (1<<6) /* lock before access */
#define DICT_FLAG_DUP_REPLACE (1<<7) /* if file, replace dups */
extern int dict_unknown_allowed;
extern int dict_errno;
#define DICT_ERR_RETRY 1 /* soft error */
/*
* Sequence function types.
*/
#define DICT_SEQ_FUN_FIRST 0 /* set cursor to first record */
#define DICT_SEQ_FUN_NEXT 1 /* set cursor to next record */
/*
* High-level interface, with logical dictionary names.
*/
extern void dict_register(const char *, DICT *);
extern DICT *dict_handle(const char *);
extern void dict_unregister(const char *);
extern void dict_update(const char *, const char *, const char *);
extern const char *dict_lookup(const char *, const char *);
extern int dict_delete(const char *, const char *);
extern int dict_sequence(const char *, const int, const char **, const char **);
extern void dict_load_file(const char *, const char *);
extern void dict_load_fp(const char *, VSTREAM *);
extern const char *dict_eval(const char *, const char *, int);
/*
* Low-level interface, with physical dictionary handles.
*/
extern DICT *dict_open(const char *, int, int);
extern DICT *dict_open3(const char *, const char *, int, int);
extern void dict_open_register(const char *, DICT *(*) (const char *, int, int));
#define dict_get(dp, key) (dp)->lookup((dp), (key))
#define dict_put(dp, key, val) (dp)->update((dp), (key), (val))
#define dict_del(dp, key) (dp)->delete((dp), (key))
#define dict_seq(dp, f, key, val) (dp)->sequence((dp), (f), (key), (val))
#define dict_close(dp) (dp)->close(dp)
typedef void (*DICT_WALK_ACTION) (const char *, DICT *, char *);
extern void dict_walk(DICT_WALK_ACTION, char *);
extern int dict_changed(void);
/* 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
/*--*/
#endif

View File

@@ -1,36 +0,0 @@
#ifndef _DICT_DB_H_INCLUDED_
#define _DICT_DB_H_INCLUDED_
/*++
/* NAME
/* dict_db 3h
/* SUMMARY
/* dictionary manager interface to DB files
/* SYNOPSIS
/* #include <dict_db.h>
/* DESCRIPTION
/* .nf
/*
* Utility library.
*/
#include <dict.h>
/*
* External interface.
*/
extern DICT *dict_hash_open(const char *, int, int);
extern DICT *dict_btree_open(const char *, int, int);
/* 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
/*--*/
#endif

View File

@@ -1,35 +0,0 @@
#ifndef _DICT_DBN_H_INCLUDED_
#define _DICT_DBN_H_INCLUDED_
/*++
/* NAME
/* dict_dbm 3h
/* SUMMARY
/* dictionary manager interface to DBM files
/* SYNOPSIS
/* #include <dict_dbm.h>
/* DESCRIPTION
/* .nf
/*
* Utility library.
*/
#include <dict.h>
/*
* External interface.
*/
extern DICT *dict_dbm_open(const char *, int, int);
/* 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
/*--*/
#endif

View File

@@ -1,35 +0,0 @@
#ifndef _DICT_ENV_H_INCLUDED_
#define _DICT_ENV_H_INCLUDED_
/*++
/* NAME
/* dict_env 3h
/* SUMMARY
/* dictionary manager interface to environment variables
/* SYNOPSIS
/* #include <dict_env.h>
/* DESCRIPTION
/* .nf
/*
* Utility library.
*/
#include <dict.h>
/*
* External interface.
*/
extern DICT *dict_env_open(const char *, int, int);
/* 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
/*--*/
#endif

View File

@@ -1,36 +0,0 @@
#ifndef _DICT_HT_H_INCLUDED_
#define _DICT_HT_H_INCLUDED_
/*++
/* NAME
/* dict_ht 3h
/* SUMMARY
/* dictionary manager interface to hash tables
/* SYNOPSIS
/* #include <dict_ht.h>
/* DESCRIPTION
/* .nf
/*
* Utility library.
*/
#include <htable.h>
#include <dict.h>
/*
* External interface.
*/
extern DICT *dict_ht_open(HTABLE *, void (*) (char *));
/* 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
/*--*/
#endif

View File

@@ -1,31 +0,0 @@
#ifndef _DICT_LDAP_H_INCLUDED_
#define _DICT_LDAP_H_INCLUDED_
/*++
/* NAME
/* dict_ldap 3h
/* SUMMARY
/* dictionary manager interface to LDAP maps
/* SYNOPSIS
/* #include <dict_ldap.h>
/* DESCRIPTION
/* .nf
/*
* Utility library.
*/
#include <dict.h>
/*
* External interface.
*/
extern DICT *dict_ldap_open(const char *, int, int);
/* AUTHOR(S)
/* Wietse Venema
/* IBM T.J. Watson Research
/* P.O. Box 704
/* Yorktown Heights, NY 10532, USA
/*--*/
#endif

View File

@@ -1,46 +0,0 @@
#ifdef HAS_MYSQL
#include <time.h>
#include "mysql.h"
#define STATACTIVE 0
#define STATFAIL 1
#define STATUNTRIED 2
#define RETRY_CONN_INTV 300 /* 5 minutes */
extern DICT *dict_mysql_open(const char *name, int unused_flags, int dict_flags);
typedef struct {
char *hostname;
int stat; /* STATUNTRIED | STATFAIL | STATCUR */
time_t ts; /* used for attempting reconnection
* every so often if a host is down */
MYSQL db;
} HOST;
typedef struct {
char *username; /* login for database */
char *password; /* password for database */
char *dbname; /* the name of the database on all
* the servers */
HOST *db_hosts; /* the hosts on which the databases
* reside */
int len_hosts; /* number of hosts */
} PLMYSQL;
extern PLMYSQL *plmysql_init(char *dbname, char *hostnames[], int len_hosts);
extern int plmysql_connect(PLMYSQL *PLDB, char *username, char *password);
MYSQL_RES *plmysql_query(PLMYSQL *PLDB, const char *query);
void plmysql_dealloc(PLMYSQL *PLDB);
inline void plmysql_down_host(HOST *host);
int plmysql_connect_single(PLMYSQL *PLDB, int host);
int plmysql_ready_reconn(HOST host);
#endif

View File

@@ -1,32 +0,0 @@
#ifndef _DICT_NI_H_INCLUDED_
#define _DICT_NI_H_INCLUDED_
/*++
/* NAME
/* dict_ni 3h
/* SUMMARY
/* dictionary manager interface to NetInfo maps
/* SYNOPSIS
/* #include <dict_ni.h>
/* DESCRIPTION
/* .nf
/*
* Utility library.
*/
#include <dict.h>
/*
* External interface.
*/
extern DICT *dict_ni_open(const char *, int, int);
/* AUTHOR(S)
/* Pieter Schoenmakers
/* Eindhoven University of Technology
/* P.O. Box 513
/* 5600 MB Eindhoven
/* The Netherlands
/*--*/
#endif

View File

@@ -1,35 +0,0 @@
#ifndef _DIST_NIS_H_INCLUDED_
#define _DIST_NIS_H_INCLUDED_
/*++
/* NAME
/* dict_nis 3h
/* SUMMARY
/* dictionary manager interface to NIS maps
/* SYNOPSIS
/* #include <dict_nis.h>
/* DESCRIPTION
/* .nf
/*
* Utility library.
*/
#include <dict.h>
/*
* External interface.
*/
extern DICT *dict_nis_open(const char *, int, int);
/* 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
/*--*/
#endif

View File

@@ -1,35 +0,0 @@
#ifndef _DICT_NISPLUS_H_INCLUDED_
#define _DICT_NISPLUS_H_INCLUDED_
/*++
/* NAME
/* dict_nisplus 3h
/* SUMMARY
/* dictionary manager interface to NIS+ maps
/* SYNOPSIS
/* #include <dict_nisplus.h>
/* DESCRIPTION
/* .nf
/*
* Utility library.
*/
#include <dict.h>
/*
* External interface.
*/
extern DICT *dict_nisplus_open(const char *, int, int);
/* 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
/*--*/
#endif

View File

@@ -1,35 +0,0 @@
#ifndef _DIR_FOREST_H_INCLUDED_
#define _DIR_FOREST_H_INCLUDED_
/*++
/* NAME
/* dir_forest 3h
/* SUMMARY
/* file name to directory forest
/* SYNOPSIS
/* #include <dir_forest.h>
/* DESCRIPTION
/* .nf
/*
* Utility library.
*/
#include <vstring.h>
/*
* External interface.
*/
extern char *dir_forest(VSTRING *, const char *, int);
/* 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
/*--*/
#endif

View File

@@ -1,62 +0,0 @@
#ifndef _EVENTS_H_INCLUDED_
#define _EVENTS_H_INCLUDED_
/*++
/* NAME
/* events 3h
/* SUMMARY
/* event manager
/* SYNOPSIS
/* #include <events.h>
/* DESCRIPTION
/* .nf
/*
* System library.
*/
#include <time.h>
/*
* External interface.
*/
typedef void (*EVENT_NOTIFY_RDWR) (int, char *);
typedef void (*EVENT_NOTIFY_TIME) (int, char *);
extern time_t event_time(void);
extern void event_enable_read(int, EVENT_NOTIFY_RDWR, char *);
extern void event_enable_write(int, EVENT_NOTIFY_RDWR, char *);
extern void event_disable_readwrite(int);
extern time_t event_request_timer(EVENT_NOTIFY_TIME, char *, int);
extern int event_cancel_timer(EVENT_NOTIFY_TIME, char *);
extern void event_loop(int);
/*
* Event codes.
*/
#define EVENT_READ (1<<0) /* read event */
#define EVENT_WRITE (1<<1) /* write event */
#define EVENT_XCPT (1<<2) /* exception */
#define EVENT_TIME (1<<3) /* timer event */
#define EVENT_ERROR EVENT_XCPT
/*
* Dummies.
*/
#define EVENT_NULL_TYPE 0
#define EVENT_NULL_CONTEXT ((char *) 0)
/* 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
/* CREATION DATE
/* Wed Jan 29 17:00:03 EST 1997
/*--*/
#endif

View File

@@ -1,30 +0,0 @@
#ifndef _EXEC_COMMAND_H_INCLUDED_
#define _EXEC_COMMAND_H_INCLUDED_
/*++
/* NAME
/* exec_command 3h
/* SUMMARY
/* execute command
/* SYNOPSIS
/* #include <exec_command.h>
/* DESCRIPTION
/* .nf
/*
* External interface.
*/
extern NORETURN exec_command(const char *);
/* 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
/*--*/
#endif

View File

@@ -1,33 +0,0 @@
#ifndef _FIND_INET_H_INCLUDED_
#define _FIND_INET_H_INCLUDED_
/*++
/* NAME
/* find_inet 3h
/* SUMMARY
/* inet-domain name services
/* SYNOPSIS
/* #include <find_inet.h>
/* DESCRIPTION
/* .nf
/*
* External interface.
*/
extern unsigned find_inet_addr(const char *);
extern int find_inet_port(const char *, const char *);
/* 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
/* LAST MODIFICATION
/* Thu Feb 6 12:46:36 EST 1997
/*--*/
#endif

View File

@@ -1,33 +0,0 @@
#ifndef _FSSPACE_H_INCLUDED_
#define _FSSPACE_H_INCLUDED_
/*++
/* NAME
/* fsspace 3h
/* SUMMARY
/* determine available file system space
/* SYNOPSIS
/* #include <fsspace.h>
/* DESCRIPTION
/* .nf
/* External interface. */
struct fsspace {
unsigned long block_size; /* block size */
unsigned long block_free; /* free space */
};
extern void fsspace(const char *, struct fsspace *);
/* 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
/*--*/
#endif

View File

@@ -1,29 +0,0 @@
#ifndef _FULLNAME_H_INCLUDED_
#define _FULLNAME_H_INCLUDED_
/*++
/* NAME
/* fullname 3h
/* SUMMARY
/* lookup personal name of invoking user
/* SYNOPSIS
/* #include <fullname.h>
/* DESCRIPTION
/* .nf
/* External interface. */
extern const char *fullname(void);
/* 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
/*--*/
#endif

View File

@@ -1,29 +0,0 @@
#ifndef _GET_DOMAINNAME_H_INCLUDED_
#define _GET_DOMAINNAME_H_INCLUDED_
/*++
/* NAME
/* get_domainname 3h
/* SUMMARY
/* network domain name lookup
/* SYNOPSIS
/* #include <get_domainname.h>
/* DESCRIPTION
/* .nf
/* External interface */
extern const char *get_domainname(void);
/* 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
/*--*/
#endif

View File

@@ -1,29 +0,0 @@
#ifndef _GET_HOSTNAME_H_INCLUDED_
#define _GET_HOSTNAME_H_INCLUDED_
/*++
/* NAME
/* get_hostname 3h
/* SUMMARY
/* network name lookup
/* SYNOPSIS
/* #include <get_hostname.h>
/* DESCRIPTION
/* .nf
/* External interface */
extern const char *get_hostname(void);
/* 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
/*--*/
#endif

View File

@@ -1,57 +0,0 @@
#ifndef _HTABLE_H_INCLUDED_
#define _HTABLE_H_INCLUDED_
/*++
/* NAME
/* htable 3h
/* SUMMARY
/* hash table manager
/* SYNOPSIS
/* #include <htable.h>
/* DESCRIPTION
/* .nf
/* Structure of one hash table entry. */
typedef struct HTABLE_INFO {
char *key; /* lookup key */
char *value; /* associated value */
struct HTABLE_INFO *next; /* colliding entry */
struct HTABLE_INFO *prev; /* colliding entry */
} HTABLE_INFO;
/* Structure of one hash table. */
typedef struct HTABLE {
int size; /* length of entries array */
int used; /* number of entries in table */
HTABLE_INFO **data; /* entries array, auto-resized */
} HTABLE;
extern HTABLE *htable_create(int);
extern HTABLE_INFO *htable_enter(HTABLE *, const char *, char *);
extern HTABLE_INFO *htable_locate(HTABLE *, const char *);
extern char *htable_find(HTABLE *, const char *);
extern void htable_delete(HTABLE *, const char *, void (*) (char *));
extern void htable_free(HTABLE *, void (*) (char *));
extern void htable_walk(HTABLE *, void (*) (HTABLE_INFO *, char *), char *);
extern HTABLE_INFO **htable_list(HTABLE *);
/* 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
/* CREATION DATE
/* Fri Feb 14 13:43:19 EST 1997
/* LAST MODIFICATION
/* %E% %U%
/* VERSION/RELEASE
/* %I%
/*--*/
#endif

View File

@@ -1,35 +0,0 @@
#ifndef INET_ADDR_HOST_H_INCLUDED_
#define INET_ADDR_HOST_H_INCLUDED_
/*++
/* NAME
/* inet_addr_host 3h
/* SUMMARY
/* determine all host internet interface addresses
/* SYNOPSIS
/* #include <inet_addr_host.h>
/* DESCRIPTION
/* .nf
/*
* Utility library.
*/
#include <inet_addr_list.h>
/*
* External interface.
*/
extern int inet_addr_host(INET_ADDR_LIST *, const char *);
/* 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
/*--*/
#endif

View File

@@ -1,43 +0,0 @@
#ifndef _INET_ADDR_LIST_H_INCLUDED_
#define _INET_ADDR_LIST_H_INCLUDED_
/*++
/* NAME
/* inet_addr_list 3h
/* SUMMARY
/* internet address list manager
/* SYNOPSIS
/* #include <inet_addr_list.h>
/* DESCRIPTION
/* .nf
/*
* System library.
*/
#include <netinet/in.h>
/*
* External interface.
*/
typedef struct INET_ADDR_LIST {
int used; /* nr of elements in use */
int size; /* actual list size */
struct in_addr *addrs; /* payload */
} INET_ADDR_LIST;
extern void inet_addr_list_init(INET_ADDR_LIST *);
extern void inet_addr_list_free(INET_ADDR_LIST *);
extern void inet_addr_list_append(INET_ADDR_LIST *, struct in_addr *);
/* 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
/*--*/
#endif

View File

@@ -1,35 +0,0 @@
#ifndef _INET_ADDR_LOCAL_H_INCLUDED_
#define _INET_ADDR_LOCAL_H_INCLUDED_
/*++
/* NAME
/* inet_addr_local 3h
/* SUMMARY
/* determine if IP address is local
/* SYNOPSIS
/* #include <inet_addr_local.h>
/* DESCRIPTION
/* .nf
/*
* Utility library.
*/
#include <inet_addr_list.h>
/*
* External interface.
*/
extern int inet_addr_local(INET_ADDR_LIST *);
/* 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
/*--*/
#endif

View File

@@ -1,29 +0,0 @@
#ifndef _INET_UTIL_H_INCLUDED_
#define _INET_UTIL_H_INCLUDED_
/*++
/* NAME
/* inet_util 3h
/* SUMMARY
/* INET-domain utilities
/* SYNOPSIS
/* #include <inet_util.h>
/* DESCRIPTION
/* .nf
/* External interface. */
extern char *inet_parse(const char *, char **, char **);
/* 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
/*--*/
#endif

View File

@@ -1,48 +0,0 @@
#ifndef _IOSTUFF_H_INCLUDED_
#define _IOSTUFF_H_INCLUDED_
/*++
/* NAME
/* iostuff 3h
/* SUMMARY
/* miscellaneous I/O primitives
/* SYNOPSIS
/* #include <iostuff.h>
/* DESCRIPTION
/*
* External interface.
*/
extern int non_blocking(int, int);
extern int close_on_exec(int, int);
extern int open_limit(int);
extern int readable(int);
extern int writable(int);
extern off_t get_file_limit(void);
extern void set_file_limit(off_t);
extern int peekfd(int);
extern int read_wait(int, int);
extern int write_wait(int, int);
extern int write_buf(int, const char *, int, int);
extern void doze(unsigned);
#define BLOCKING 0
#define NON_BLOCKING 1
#define CLOSE_ON_EXEC 1
#define PASS_ON_EXEC 0
/* 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
/* CREATION DATE
/* Sat Jan 25 16:54:13 EST 1997
/*--*/
#endif

View File

@@ -1,31 +0,0 @@
#ifndef _LINE_WRAP_H_INCLUDED_
#define _LINE_WRAP_H_INCLUDED_
/*++
/* NAME
/* line_wrap 3h
/* SUMMARY
/* wrap long lines upon output
/* SYNOPSIS
/* #include <line_wrap.h>
/* DESCRIPTION
/* .nf
/*
* External interface.
*/
typedef void (*LINE_WRAP_FN) (const char *, int, int, char *);
extern void line_wrap(const char *, int, int, LINE_WRAP_FN, char *);
/* 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
/*--*/
#endif

View File

@@ -1,42 +0,0 @@
#ifndef _LISTEN_H_INCLUDED_
#define _LISTEN_H_INCLUDED_
/*++
/* NAME
/* listen 3h
/* SUMMARY
/* listener interface file
/* SYNOPSIS
/* #include <listen.h>
/* DESCRIPTION
/* .nf
/*
* Utility library.
*/
#include <iostuff.h>
/*
* Listener external interface.
*/
extern int unix_listen(const char *, int, int);
extern int inet_listen(const char *, int, int);
extern int fifo_listen(const char *, int, int);
extern int stream_listen(const char *, int, int);
extern int inet_accept(int);
extern int unix_accept(int);
extern int stream_accept(int);
/* 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
/*--*/
#endif

View File

@@ -1,30 +0,0 @@
#ifndef _LSTAT_AS_H_INCLUDED_
#define _LSTAT_AS_H_INCLUDED_
/*++
/* NAME
/* lstat_as 3h
/* SUMMARY
/* lstat file as user
/* SYNOPSIS
/* #include <sys/stat.h>
/* #include <lstat_as.h>
/* DESCRIPTION
/* .nf
/* External interface. */
extern int lstat_as(const char *, struct stat *, uid_t, gid_t);
/* 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
/*--*/
#endif

View File

@@ -1,44 +0,0 @@
#ifndef _MAC_PARSE_H_INCLUDED_
#define _MAC_PARSE_H_INCLUDED_
/*++
/* NAME
/* mac_parse 3h
/* SUMMARY
/* locate macro references in string
/* SYNOPSIS
/* #include <mac_parse.h>
DESCRIPTION
.nf
/*
* Utility library.
*/
#include <vstring.h>
/*
* External interface.
*/
#define MAC_PARSE_LITERAL 1
#define MAC_PARSE_VARNAME 2
#define MAC_PARSE_ERROR (1<<0)
#define MAC_PARSE_UNDEF (1<<1)
#define MAC_PARSE_USER 2 /* start user definitions */
typedef int (*MAC_PARSE_FN)(int, VSTRING *, char *);
extern int mac_parse(const char *, MAC_PARSE_FN, char *);
/* 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
/*--*/
#endif

View File

@@ -1,30 +0,0 @@
#ifndef MAKE_DIRS_H_INCLUDED_
#define MAKE_DIRS_H_INCLUDED_
/*++
/* NAME
/* make_dirs 3h
/* SUMMARY
/* create directory hierarchy
/* SYNOPSIS
/* #include <make_dirs.h>
/* DESCRIPTION
/* .nf
/*
* External interface.
*/
extern int make_dirs(const char *, int);
/* 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
/*--*/
#endif

View File

@@ -1,35 +0,0 @@
#ifndef _MATCH_LIST_H_INCLUDED_
#define _MATCH_LIST_H_INCLUDED_
/*++
/* NAME
/* match_list 3h
/* SUMMARY
/* generic list-based pattern matching
/* SYNOPSIS
/* #include <match_list.h>
/* DESCRIPTION
/* .nf
/*
* External interface.
*/
typedef struct MATCH_LIST MATCH_LIST;
typedef int (*MATCH_LIST_FN) (const char *, const char *);
extern MATCH_LIST *match_list_init(const char *, int,...);
extern int match_list_match(MATCH_LIST *,...);
extern void match_list_free(MATCH_LIST *);
/* 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
/*--*/
#endif

View File

@@ -1,31 +0,0 @@
#ifndef _MATCH_OPS_H_INCLUDED_
#define _MATCH_OPS_H_INCLUDED_
/*++
/* NAME
/* match_ops 3h
/* SUMMARY
/* simple string or host pattern matching
/* SYNOPSIS
/* #include <match_ops.h>
/* DESCRIPTION
/* .nf
/* External interface. */
extern int match_string(const char *, const char *);
extern int match_hostname(const char *, const char *);
extern int match_hostaddr(const char *, const char *);
/* 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
/*--*/
#endif

View File

@@ -1,42 +0,0 @@
#ifndef _MSG_H_INCLUDED_
#define _MSG_H_INCLUDED_
/*++
/* NAME
/* msg 3h
/* SUMMARY
/* diagnostics interface
/* SYNOPSIS
/* #include "msg.h"
/* DESCRIPTION
/* .nf
/*
* External interface.
*/
typedef void (*MSG_CLEANUP_FN) (void);
extern int msg_verbose;
extern void msg_info(const char *,...);
extern void msg_warn(const char *,...);
extern void msg_error(const char *,...);
extern NORETURN msg_fatal(const char *,...);
extern NORETURN msg_panic(const char *,...);
extern int msg_error_limit(int);
extern void msg_error_clear(void);
extern MSG_CLEANUP_FN msg_cleanup(MSG_CLEANUP_FN);
/* 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
/*--*/
#endif

View File

@@ -1,47 +0,0 @@
#ifndef _MSG_OUTPUT_FN_
#define _MSG_OUTPUT_FN_
/*++
/* NAME
/* msg_output 3h
/* SUMMARY
/* diagnostics output management
/* SYNOPSIS
/* #include <msg_output.h>
/* DESCRIPTION
/*
* System library.
*/
#include <stdarg.h>
/*
* External interface. Severity levels are documented to be monotonically
* increasing from 0 up to MSG_LAST.
*/
typedef void (*MSG_OUTPUT_FN) (int, const char *);
extern void msg_output(MSG_OUTPUT_FN);
extern void msg_printf(int, const char *,...);
extern void msg_vprintf(int, const char *, va_list);
extern void msg_text(int, const char *);
#define MSG_INFO 0 /* informative */
#define MSG_WARN 1 /* warning (non-fatal) */
#define MSG_ERROR 2 /* error (fatal) */
#define MSG_FATAL 3 /* software error (fatal) */
#define MSG_PANIC 4 /* software error (fatal) */
#define MSG_LAST 4 /* highest-numbered severity level */
/* 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
/*--*/
#endif

View File

@@ -1,34 +0,0 @@
#ifndef _MSG_SYSLOG_H_INCLUDED_
#define _MSG_SYSLOG_H_INCLUDED_
/*++
/* NAME
/* msg_syslog 3h
/* SUMMARY
/* direct diagnostics to syslog daemon
/* SYNOPSIS
/* #include <msg_syslog.h>
/* DESCRIPTION
/*
* System library.
*/
#include <syslog.h>
/*
* External interface.
*/
extern void msg_syslog_init(const char *, int, int);
/* 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
/*--*/
#endif

View File

@@ -1,34 +0,0 @@
#ifndef _MSG_VSTREAM_H_INCLUDED_
#define _MSG_VSTREAM_H_INCLUDED_
/*++
/* NAME
/* msg_vstream 3h
/* SUMMARY
/* direct diagnostics to VSTREAM
/* SYNOPSIS
/* #include <msg_vstream.h>
/* DESCRIPTION
/*
* Utility library.
*/
#include <vstream.h>
/*
* External interface.
*/
extern void msg_vstream_init(const char *, VSTREAM *);
/* 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
/*--*/
#endif

View File

@@ -1,42 +0,0 @@
#ifndef _MVECT_H_INCLUDED_
#define _MVECT_H_INCLUDED_
/*++
/* NAME
/* mvect 3h
/* SUMMARY
/* memory vector management
/* SYNOPSIS
/* #include <mvect.h>
/* DESCRIPTION
/* .nf
/*
* Generic memory vector interface.
*/
typedef void (*MVECT_FN) (char *, int);
typedef struct {
char *ptr;
int elsize;
int nelm;
MVECT_FN init_fn;
MVECT_FN wipe_fn;
} MVECT;
extern char *mvect_alloc(MVECT *, int, int, MVECT_FN, MVECT_FN);
extern char *mvect_realloc(MVECT *, int);
extern char *mvect_free(MVECT *);
/* 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
/*--*/
#endif

View File

@@ -1,38 +0,0 @@
#ifndef _MYFLOCK_H_INCLUDED_
#define _MYFLOCK_H_INCLUDED_
/*++
/* NAME
/* myflock 3h
/* SUMMARY
/* lock open file
/* SYNOPSIS
/* #include <myflock.h>
/* DESCRIPTION
/* .nf
/*
* External interface.
*/
extern int myflock(int, int);
extern int myflock_locked(int);
#define MYFLOCK_NONE 0
#define MYFLOCK_SHARED 1
#define MYFLOCK_EXCLUSIVE 2
#define MYFLOCK_LOCK_MASK (MYFLOCK_SHARED | MYFLOCK_EXCLUSIVE)
#define MYFLOCK_NOWAIT 4
#define MYFLOCK_BITS (MYFLOCK_LOCK_MASK | MYFLOCK_NOWAIT)
/* 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
/*--*/
#endif

View File

@@ -1,35 +0,0 @@
#ifndef _MALLOC_H_INCLUDED_
#define _MALLOC_H_INCLUDED_
/*++
/* NAME
/* mymalloc 3h
/* SUMMARY
/* memory management wrappers
/* SYNOPSIS
/* #include "mymalloc.h"
DESCRIPTION
.nf
/*
* External interface.
*/
extern char *mymalloc(int);
extern char *myrealloc(char *, int);
extern void myfree(char *);
extern char *mystrdup(const char *);
extern char *mystrndup(const char *, int len);
extern char *mymemdup(const char *, int);
/* 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
/*--*/
#endif

View File

@@ -1,35 +0,0 @@
#ifndef _NAME_MASK_H_INCLUDED_
#define _NAME_MASK_H_INCLUDED_
/*++
/* NAME
/* name_mask 3h
/* SUMMARY
/* map names to bit mask
/* SYNOPSIS
/* #include <name_mask.h>
/* DESCRIPTION
/* .nf
/*
* External interface.
*/
typedef struct {
const char *name;
int mask;
} NAME_MASK;
extern int name_mask(NAME_MASK *, const char *);
/* 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
/*--*/
#endif

View File

@@ -1,30 +0,0 @@
#ifndef _OPEN_H_INCLUDED_
#define _OPEN_H_INCLUDED_
/*++
/* NAME
/* open_as 3h
/* SUMMARY
/* open file as user
/* SYNOPSIS
/* #include <fcntl.h>
/* #include <open_as.h>
/* DESCRIPTION
/* .nf
/* External interface. */
extern int open_as(const char *, int, int, uid_t, gid_t);
/* 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
/*--*/
#endif

View File

@@ -1,41 +0,0 @@
#ifndef _OPEN_LOCK_H_INCLUDED_
#define _OPEN_LOCK_H_INCLUDED_
/*++
/* NAME
/* open_lock 3h
/* SUMMARY
/* open or create file and lock it for exclusive access
/* SYNOPSIS
/* #include <open_lock.h>
/* DESCRIPTION
/* .nf
/*
* System library.
*/
#include <fcntl.h>
/*
* Utility library.
*/
#include <vstream.h>
#include <vstring.h>
/*
* External interface.
*/
extern VSTREAM *open_lock(const char *, int, int, VSTRING *);
/* 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
/*--*/
#endif

View File

@@ -1,35 +0,0 @@
#ifndef _PERCENT_H_INCLUDED_
#define _PERCENT_H_INCLUDED_
/*++
/* NAME
/* percentm 3h
/* SUMMARY
/* expand %m embedded in string to system error text
/* SYNOPSIS
/* #include <percentm.h>
/* DESCRIPTION
/* .nf
/*
* External interface.
*/
extern char *percentm(const char *, int);
/* HISTORY
/* .ad
/* .fi
/* A percentm() routine appears in the TCP Wrapper software
/* by Wietse Venema.
/* 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
/*--*/
#endif

View File

@@ -1,59 +0,0 @@
#ifndef _POSIX_SIGNALS_H_INCLUDED_
#define _POSIX_SIGNALS_H_INCLUDED_
/*++
/* NAME
/* posix_signals 3h
/* SUMMARY
/* POSIX signal handling compatibility
/* SYNOPSIS
/* #include <posix_signals.h>
/* DESCRIPTION
/* .nf
/*
* Compatibility interface.
*/
#ifdef MISSING_SIGSET_T
typedef int sigset_t;
enum {
SIG_BLOCK,
SIG_UNBLOCK,
SIG_SETMASK
};
extern int sigemptyset(sigset_t *);
extern int sigaddset(sigset_t *, int);
extern int sigprocmask(int, sigset_t *, sigset_t *);
#endif
#ifdef MISSING_SIGACTION
struct sigaction {
void (*sa_handler) ();
sigset_t sa_mask;
int sa_flags;
};
/* Possible values for sa_flags. Or them to set multiple. */
enum {
SA_RESTART,
SA_NOCLDSTOP = 4 /* drop the = 4. */
};
extern int sigaction(int, struct sigaction *, struct sigaction *);
#endif
/* AUTHOR(S)
/* Pieter Schoenmakers
/* Eindhoven University of Technology
/* P.O. Box 513
/* 5600 MB Eindhoven
/* The Netherlands
/*--*/
#endif

View File

@@ -1,36 +0,0 @@
#ifndef _READLINE_H_INCLUDED_
#define _READLINE_H_INCLUDED_
/*++
/* NAME
/* readlline 3h
/* SUMMARY
/* read logical line
/* SYNOPSIS
/* #include <readlline.h>
/* DESCRIPTION
/* .nf
/*
* Utility library.
*/
#include <vstream.h>
#include <vstring.h>
/*
* External interface.
*/
extern VSTRING *readlline(VSTRING *, VSTREAM *, int *);
/* 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
/*--*/
#endif

View File

@@ -1,45 +0,0 @@
#ifndef _RING_H_INCLUDED_
#define _RING_H_INCLUDED_
/*++
/* NAME
/* ring 3h
/* SUMMARY
/* circular list management
/* SYNOPSIS
/* #include <ring.h>
/* DESCRIPTION
/* .nf
/*
* External interface.
*/
typedef struct RING RING;
struct RING {
RING *succ; /* successor */
RING *pred; /* predecessor */
};
extern void ring_init(RING *);
extern void ring_prepend(RING *, RING *);
extern void ring_append(RING *, RING *);
extern void ring_detach(RING *);
#define ring_succ(c) ((c)->succ)
#define ring_pred(c) ((c)->pred)
/* 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
/* LAST MODIFICATION
/* Tue Jan 28 16:50:20 EST 1997
/*--*/
#endif

View File

@@ -1,30 +0,0 @@
#ifndef _SAFE_H_INCLUDED_
#define _SAFE_H_INCLUDED_
/*++
/* NAME
/* safe 3h
/* SUMMARY
/* miscellaneous taint checks
/* SYNOPSIS
/* #include <safe.h>
/* DESCRIPTION
/* .nf
/* External interface. */
extern int unsafe(void);
extern char *safe_getenv(const char *);
/* 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
/*--*/
#endif

View File

@@ -1,41 +0,0 @@
#ifndef _SAFE_OPEN_H_INCLUDED_
#define _SAFE_OPEN_H_INCLUDED_
/*++
/* NAME
/* safe_open 3h
/* SUMMARY
/* safely open or create regular file
/* SYNOPSIS
/* #include <safe_open.h>
/* DESCRIPTION
/* .nf
/*
* System library.
*/
#include <fcntl.h>
/*
* Utility library.
*/
#include <vstream.h>
#include <vstring.h>
/*
* External interface.
*/
extern VSTREAM *safe_open(const char *, int, int, uid_t, gid_t, VSTRING *);
/* 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
/*--*/
#endif

View File

@@ -1,29 +0,0 @@
#ifndef _SANE_ACCEPT_H_
#define _SANE_ACCEPT_H_
/*++
/* NAME
/* sane_accept 3h
/* SUMMARY
/* sanitize accept() error returns
/* SYNOPSIS
/* #include <sane_accept.h>
/* DESCRIPTION
/* .nf
/* External interface. */
extern int sane_accept(int, struct sockaddr *, SOCKADDR_SIZE *);
/* 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
/*--*/
#endif

View File

@@ -1,37 +0,0 @@
#ifndef _SCAN_DIR_H_INCLUDED_
#define _SCAN_DIR_H_INCLUDED_
/*++
/* NAME
/* scan_dir 3h
/* SUMMARY
/* directory scanner
/* SYNOPSIS
/* #include <scan_dir.h>
/* DESCRIPTION
/* .nf
/*
* The directory scanner interface.
*/
typedef struct SCAN_DIR SCAN_DIR;
extern SCAN_DIR *scan_dir_open(const char *);
extern char *scan_dir_next(SCAN_DIR *);
extern char *scan_dir_path(SCAN_DIR *);
extern void scan_dir_push(SCAN_DIR *, const char *);
extern SCAN_DIR *scan_dir_pop(SCAN_DIR *);
extern SCAN_DIR *scan_dir_close(SCAN_DIR *);
/* 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
/*--*/
#endif

View File

@@ -1,29 +0,0 @@
#ifndef _SET_EUGID_H_INCLUDED_
#define _SET_EUGID_H_INCLUDED_
/*++
/* NAME
/* set_eugid 3h
/* SUMMARY
/* set effective user and group attributes
/* SYNOPSIS
/* #include <set_eugid.h>
/* DESCRIPTION
/* .nf
/* External interface. */
extern void set_eugid(uid_t, gid_t);
/* 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
/*--*/
#endif

View File

@@ -1,29 +0,0 @@
#ifndef _SET_UGID_H_INCLUDED_
#define _SET_UGID_H_INCLUDED_
/*++
/* NAME
/* set_ugid 3h
/* SUMMARY
/* set real, effective and saved user and group attributes
/* SYNOPSIS
/* #include <set_ugid.h>
/* DESCRIPTION
/* .nf
/* External interface. */
extern void set_ugid(uid_t, gid_t);
/* 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
/*--*/
#endif

View File

@@ -1,31 +0,0 @@
#ifndef _SIGDELAY_H_INCLUDED_
#define _SIGDELAY_H_INCLUDED_
/*++
/* NAME
/* sigdelay 3h
/* SUMMARY
/* delay/resume signal delivery
/* SYNOPSIS
/* #include <sigdelay.h>
/* DESCRIPTION
/* .nf
/*
* External interface.
*/
extern void sigdelay(void);
extern void sigresume(void);
/* 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
/*--*/
#endif

View File

@@ -1,35 +0,0 @@
#ifndef _SPLIT_AT_H_INCLUDED_
#define _SPLIT_AT_H_INCLUDED_
/*++
/* NAME
/* split_at 3h
/* SUMMARY
/* trivial token splitter
/* SYNOPSIS
/* #include <split_at.h>
/* DESCRIPTION
/* .nf
/* External interface. */
extern char *split_at(char *, int);
extern char *split_at_right(char *, int);
/* HISTORY
/* .ad
/* .fi
/* A split_at() routine appears in the TCP Wrapper software
/* by Wietse Venema.
/* 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
/*--*/
#endif

View File

@@ -1,30 +0,0 @@
#ifndef _STAT_AS_H_INCLUDED_
#define _STAT_AS_H_INCLUDED_
/*++
/* NAME
/* stat_as 3h
/* SUMMARY
/* stat file as user
/* SYNOPSIS
/* #include <sys/stat.h>
/* #include <stat_as.h>
/* DESCRIPTION
/* .nf
/* External interface. */
extern int stat_as(const char *, struct stat *, uid_t, gid_t);
/* 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
/*--*/
#endif

View File

@@ -1,38 +0,0 @@
#ifndef _STRINGOPS_H_INCLUDED_
#define _STRINGOPS_H_INCLUDED_
/*++
/* NAME
/* stringops 3h
/* SUMMARY
/* string operations
/* SYNOPSIS
/* #include <stringops.h>
/* DESCRIPTION
/* .nf
/* External interface. */
extern char *printable(char *, int);
extern char *lowercase(char *);
extern char *skipblanks(const char *);
extern char *trimblanks(char *, int);
extern char *concatenate(const char *,...);
extern char *mystrtok(char **, const char *);
extern char *translit(char *, const char *, const char *);
#ifndef HAVE_BASENAME
extern char *basename(const char *);
#endif
/* 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
/*--*/
#endif

View File

@@ -1,772 +0,0 @@
#ifndef _SYS_DEFS_H_INCLUDED_
#define _SYS_DEFS_H_INCLUDED_
/*++
/* NAME
/* sys_defs 3h
/* SUMMARY
/* portability header
/* SYNOPSIS
/* #include <sys_defs.h>
/* DESCRIPTION
/* .nf
/*
* Specific platforms. Major release numbers differ for a good reason. So be
* a good girl, plan for the future, and at least include the major release
* number in the system type (for example, SUNOS5 or FREEBSD2). The system
* type is determined by the makedefs shell script in the top-level
* directory. Adding support for a new system type means updating the
* makedefs script, and adding a section below for the new system.
*/
#if defined(FREEBSD2) || defined(FREEBSD3) || defined(FREEBSD4) \
|| defined(BSDI2) || defined(BSDI3) || defined(BSDI4) \
|| defined(OPENBSD2) || defined(NETBSD1) || defined(RHAPSODY5)
#define SUPPORTED
#include <sys/types.h>
#define USE_PATHS_H
#define USE_FLOCK_LOCK
#define HAS_SUN_LEN
#define HAS_FSYNC
#define HAS_DB
#define HAS_SA_LEN
#define DEF_DB_TYPE "hash"
#define ALIAS_DB_MAP "hash:/etc/aliases"
#define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
#define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin"
#define USE_STATFS
#define STATFS_IN_SYS_MOUNT_H
#define HAS_POSIX_REGEXP
#endif
#if defined(OPENBSD2)
#define HAS_ISSETUGID
#endif
#if defined(NETBSD1)
#define USE_DOT_LOCK
#endif
#if defined(RHAPSODY5)
#define NORETURN void
#define HAS_NETINFO
#endif
#ifdef ULTRIX4
#define SUPPORTED
/* Ultrix by default has only 64 descriptors per process */
#ifndef FD_SETSIZE
#define FD_SETSIZE 96
#endif
#include <sys/types.h>
#define UNSAFE_CTYPE /* XXX verify */
#define _PATH_MAILDIR "/var/spool/mail"
#define _PATH_BSHELL "/bin/sh"
#define _PATH_DEFPATH "/usr/bin:/usr/ucb"
#define _PATH_STDPATH "/usr/bin:/usr/etc:/usr/ucb"
#define USE_FLOCK_LOCK
#define USE_DOT_LOCK
#define HAS_FSYNC
/* might be set by makedef */
#ifdef HAS_DB
#define DEF_DB_TYPE "hash"
#define ALIAS_DB_MAP "hash:/etc/aliases"
#else
#define HAS_DBM
#define DEF_DB_TYPE "dbm"
#define ALIAS_DB_MAP "dbm:/etc/aliases"
#endif
extern int optind;
extern char *optarg;
extern int opterr;
#define MISSING_STRFTIME_E
#define HAS_NIS
#define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
#define ROOT_PATH "/bin:/usr/bin:/etc:/usr/etc:/usr/ucb"
#define USE_STATFS
#define USE_STRUCT_FS_DATA
#define STATFS_IN_SYS_MOUNT_H
/* Ultrix misses just S_ISSOCK, the others are there */
#define S_ISSOCK(mode) (((mode) & (S_IFMT)) == (S_IFSOCK))
#define DUP2_DUPS_CLOSE_ON_EXEC
#define MISSING_USLEEP
#endif
#ifdef OSF1
#define SUPPORTED
#include <sys/types.h>
#define MISSING_SETENV
#define USE_PATHS_H
#define _PATH_DEFPATH "/usr/bin:/usr/ucb"
#define USE_FLOCK_LOCK
#define USE_DOT_LOCK
#define HAS_FSYNC
#define HAVE_BASENAME
#define HAS_DBM
#define DEF_DB_TYPE "dbm"
#define ALIAS_DB_MAP "dbm:/var/adm/sendmail/aliases"
extern int optind; /* XXX use <getopt.h> */
extern char *optarg; /* XXX use <getopt.h> */
extern int opterr; /* XXX use <getopt.h> */
#define HAS_NIS
#define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
#define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb"
#define USE_STATFS
#define STATFS_IN_SYS_MOUNT_H
#define HAS_POSIX_REGEXP
#endif
#ifdef SUNOS4
#define SUPPORTED
#include <sys/types.h>
#define UNSAFE_CTYPE
#define fpos_t long
#define MISSING_SETENV
#define MISSING_STRERROR
#define _PATH_MAILDIR "/var/spool/mail"
#define _PATH_BSHELL "/bin/sh"
#define _PATH_DEFPATH "/usr/bin:/usr/ucb"
#define _PATH_STDPATH "/usr/bin:/usr/etc:/usr/ucb"
#define USE_FLOCK_LOCK
#define USE_DOT_LOCK
#define HAS_FSYNC
#define HAS_DBM
#define DEF_DB_TYPE "dbm"
#define ALIAS_DB_MAP "dbm:/etc/aliases"
extern int optind;
extern char *optarg;
extern int opterr;
#define HAS_NIS
#define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
#define ROOT_PATH "/bin:/usr/bin:/etc:/usr/etc:/usr/ucb"
#define USE_STATFS
#define STATFS_IN_SYS_VFS_H
#define memmove(d,s,l) bcopy(s,d,l)
#endif
#ifdef SUNOS5
#define SUPPORTED
#define _SVID_GETTOD /* Solaris 2.5, XSH4.2 versus SVID */
#include <sys/types.h>
#define MISSING_SETENV
#define _PATH_MAILDIR "/var/mail"
#define _PATH_BSHELL "/bin/sh"
#define _PATH_DEFPATH "/usr/bin:/usr/ucb"
#define _PATH_STDPATH "/usr/bin:/usr/sbin:/usr/ucb"
#define USE_FCNTL_LOCK
#define USE_DOT_LOCK
#define HAS_FSYNC
#define HAS_DBM
#define DEF_DB_TYPE "dbm"
#define ALIAS_DB_MAP "dbm:/etc/mail/aliases"
#define HAS_NIS
#define USE_SYS_SOCKIO_H /* Solaris 2.5, changed sys/ioctl.h */
#define GETTIMEOFDAY(t) gettimeofday(t)
#define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb"
#define FIONREAD_IN_SYS_FILIO_H
#define USE_STATVFS
#define STATVFS_IN_SYS_STATVFS_H
#define STREAM_CONNECTIONS /* avoid UNIX-domain sockets */
#define LOCAL_LISTEN stream_listen
#define LOCAL_ACCEPT stream_accept
#define LOCAL_CONNECT stream_connect
#define LOCAL_TRIGGER stream_trigger
#define HAS_VOLATILE_LOCKS
#endif
#ifdef UW7 /* UnixWare 7 */
#define SUPPORTED
#include <sys/types.h>
#define _PATH_MAILDIR "/var/mail"
#define _PATH_BSHELL "/bin/sh"
#define _PATH_DEFPATH "/usr/bin:/usr/ucb"
#define _PATH_STDPATH "/usr/bin:/usr/sbin:/usr/ucb"
#define MISSING_SETENV
#define USE_FCNTL_LOCK
#define USE_DOT_LOCK
#define HAS_FSYNC
#define HAS_DBM
#define DEF_DB_TYPE "dbm"
#define ALIAS_DB_MAP "dbm:/etc/mail/aliases"
#define HAS_NIS
#define USE_SYS_SOCKIO_H
#define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
#define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb"
#define FIONREAD_IN_SYS_FILIO_H
#define DBM_NO_TRAILING_NULL
#define USE_STATVFS
#define STATVFS_IN_SYS_STATVFS_H
#define UNIX_DOMAIN_CONNECT_BLOCKS_FOR_ACCEPT
#endif
#ifdef UW21 /* UnixWare 2.1.x */
#define SUPPORTED
#include <sys/types.h>
#define _PATH_MAILDIR "/var/mail"
#define _PATH_BSHELL "/bin/sh"
#define _PATH_DEFPATH "/usr/bin:/usr/ucb"
#define _PATH_STDPATH "/usr/bin:/usr/sbin:/usr/ucb"
#define MISSING_SETENV
#define USE_FCNTL_LOCK
#define USE_DOT_LOCK
#define HAS_FSYNC
#define HAS_DBM
#define DEF_DB_TYPE "dbm"
#define ALIAS_DB_MAP "dbm:/etc/mail/aliases"
/* Uncomment the following line if you have NIS package installed
#define HAS_NIS */
#define USE_SYS_SOCKIO_H
#define GETTIMEOFDAY(t) gettimeofday(t,NULL)
#define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb"
#define FIONREAD_IN_SYS_FILIO_H
#define DBM_NO_TRAILING_NULL
#define USE_STATVFS
#define STATVFS_IN_SYS_STATVFS_H
#define UNIX_DOMAIN_CONNECT_BLOCKS_FOR_ACCEPT
#endif
#ifdef AIX4
#define SUPPORTED
#include <sys/types.h>
#define MISSING_SETENV
#define _PATH_BSHELL "/bin/sh"
#define _PATH_MAILDIR "/var/spool/mail" /* paths.h lies */
#define _PATH_DEFPATH "/usr/bin:/usr/ucb"
#define _PATH_STDPATH "/usr/bin:/usr/sbin:/usr/ucb"
#define USE_FCNTL_LOCK
#define USE_DOT_LOCK
#define USE_SYS_SELECT_H
#define HAS_FSYNC
#define HAS_DBM
#define DEF_DB_TYPE "dbm"
#define ALIAS_DB_MAP "dbm:/etc/aliases"
#define HAS_NIS
#define HAS_SA_LEN
#define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
#define RESOLVE_H_NEEDS_STDIO_H
#define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb"
#define SOCKADDR_SIZE size_t
#define SOCKOPT_SIZE size_t
#define USE_STATVFS
#define STATVFS_IN_SYS_STATVFS_H
#define STRCASECMP_IN_STRINGS_H
extern time_t time(time_t *);
extern int seteuid(uid_t);
extern int setegid(gid_t);
extern int initgroups(const char *, int);
#endif
#ifdef AIX3
#define SUPPORTED
#include <sys/types.h>
#define MISSING_SETENV
#define _PATH_BSHELL "/bin/sh"
#define _PATH_MAILDIR "/var/spool/mail" /* paths.h lies */
#define _PATH_DEFPATH "/usr/bin:/usr/ucb"
#define _PATH_STDPATH "/usr/bin:/usr/sbin:/usr/ucb"
#define USE_FCNTL_LOCK
#define USE_DOT_LOCK
#define USE_SYS_SELECT_H
#define HAS_FSYNC
#define HAS_DBM
#define DEF_DB_TYPE "dbm"
#define ALIAS_DB_MAP "dbm:/etc/aliases"
#define HAS_NIS
#define HAS_SA_LEN
#define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
#define RESOLVE_H_NEEDS_STDIO_H
#define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb"
#define SOCKADDR_SIZE size_t
#define SOCKOPT_SIZE size_t
#define USE_STATFS
#define STATFS_IN_SYS_STATFS_H
#define STRCASECMP_IN_STRINGS_H
extern time_t time(time_t *);
extern int seteuid(uid_t);
extern int setegid(gid_t);
extern int initgroups(const char *, int);
#endif
#if defined(IRIX5) || defined(IRIX6)
#define SUPPORTED
#include <sys/types.h>
#define MISSING_SETENV
#define _PATH_MAILDIR "/var/mail"
#define _PATH_BSHELL "/bin/sh"
#define _PATH_DEFPATH "/usr/bin:/usr/bsd"
#define _PATH_STDPATH "/usr/bin:/usr/sbin:/usr/bsd"
#define USE_FCNTL_LOCK
#define USE_DOT_LOCK
#define HAS_FSYNC
#define HAS_DBM
#define DEF_DB_TYPE "dbm"
#define ALIAS_DB_MAP "dbm:/etc/aliases"
#define HAS_NIS
#define USE_SYS_SOCKIO_H /* XXX check */
#define GETTIMEOFDAY(t) gettimeofday(t)
#define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/bsd"
#define FIONREAD_IN_SYS_FILIO_H /* XXX check */
#define DBM_NO_TRAILING_NULL /* XXX check */
#define USE_STATVFS
#define STATVFS_IN_SYS_STATVFS_H
#endif
#if defined(IRIX5)
#define MISSING_USLEEP
#endif
#ifdef LINUX2
#define SUPPORTED
#include <sys/types.h>
#define USE_PATHS_H
#define USE_FLOCK_LOCK
#define USE_DOT_LOCK
#define HAS_FSYNC
#define HAS_DB
#define DEF_DB_TYPE "hash"
#define ALIAS_DB_MAP "hash:/etc/aliases"
#define HAS_NIS
#define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
#define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin"
#define FIONREAD_IN_TERMIOS_H
#define USE_STATFS
#define STATFS_IN_SYS_VFS_H
#define UNIX_DOMAIN_CONNECT_BLOCKS_FOR_ACCEPT
#define PREPEND_PLUS_TO_OPTSTRING
#define HAS_POSIX_REGEXP
#endif
/*
* HPUX11 was copied from HPUX10, but can perhaps be trimmed down a bit.
*/
#ifdef HPUX11
#define SUPPORTED
#define USE_SIG_RETURN
#include <sys/types.h>
#define HAS_DBM
#define USE_FCNTL_LOCK
#define HAS_FSYNC
#define DEF_DB_TYPE "dbm"
#define ALIAS_DB_MAP "dbm:/etc/mail/aliases"
#define ROOT_PATH "/usr/bin:/sbin:/usr/sbin"
#define MISSING_SETENV
#define HAS_NIS
#define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
#define _PATH_BSHELL "/bin/sh"
#define _PATH_MAILDIR "/var/mail"
#define _PATH_DEFPATH "/usr/bin"
#define _PATH_STDPATH "/usr/bin:/sbin:/usr/sbin"
#define MISSING_SETEUID
#define HAVE_SETRESUID
#define MISSING_SETEGID
#define HAVE_SETRESGID
extern int h_errno; /* <netdb.h> imports too much stuff */
#define USE_STATFS
#define STATFS_IN_SYS_VFS_H
#define HAS_POSIX_REGEXP
#endif
#ifdef HPUX10
#define SUPPORTED
#define USE_SIG_RETURN
#include <sys/types.h>
#define HAS_DBM
#define USE_FCNTL_LOCK
#define HAS_FSYNC
#define DEF_DB_TYPE "dbm"
#define ALIAS_DB_MAP "dbm:/etc/mail/aliases"
#define ROOT_PATH "/usr/bin:/sbin:/usr/sbin"
#define MISSING_SETENV
#define HAS_NIS
#define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
#define _PATH_BSHELL "/bin/sh"
#define _PATH_MAILDIR "/var/mail"
#define _PATH_DEFPATH "/usr/bin"
#define _PATH_STDPATH "/usr/bin:/sbin:/usr/sbin"
#define MISSING_SETEUID
#define HAVE_SETRESUID
#define MISSING_SETEGID
#define HAVE_SETRESGID
extern int h_errno; /* <netdb.h> imports too much stuff */
#define USE_STATFS
#define STATFS_IN_SYS_VFS_H
#define HAS_POSIX_REGEXP
#endif
#ifdef HPUX9
#define SUPPORTED
#define USE_SIG_RETURN
#include <sys/types.h>
#define HAS_DBM
#define USE_FCNTL_LOCK
#define HAS_FSYNC
#define HAS_NIS
#define MISSING_SETENV
#define MISSING_RLIMIT_FSIZE
#define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
#define DEF_DB_TYPE "dbm"
#define ALIAS_DB_MAP "dbm:/usr/lib/aliases"
#define ROOT_PATH "/bin:/usr/bin:/etc"
#define _PATH_BSHELL "/bin/sh"
#define _PATH_MAILDIR "/usr/mail"
#define _PATH_DEFPATH "/bin:/usr/bin"
#define _PATH_STDPATH "/bin:/usr/bin:/etc"
#define MISSING_SETEUID
#define HAVE_SETRESUID
#define MISSING_SETEGID
#define HAVE_SETRESGID
extern int h_errno;
#define USE_ULIMIT /* no setrlimit() */
#define USE_STATFS
#define STATFS_IN_SYS_VFS_H
#define HAS_POSIX_REGEXP
#endif
/*
* NEXTSTEP3, without -lposix, because its naming service is broken.
*/
#ifdef NEXTSTEP3
#define SUPPORTED
#include <sys/types.h>
#define HAS_DBM
#define USE_FLOCK_LOCK
#define USE_STATFS
#define HAVE_SYS_DIR_H
#define STATFS_IN_SYS_VFS_H
#define HAS_FSYNC
#define HAS_NIS
#define HAS_NETINFO
#define MISSING_SETENV_PUTENV
#define MISSING_MKFIFO
#define MISSING_SIGSET_T
#define MISSING_SIGACTION
#define MISSING_STD_FILENOS
#define MISSING_SETSID
#define MISSING_WAITPID
#define MISSING_UTIMBUF
#define HAS_WAIT4
#define WAIT_STATUS_T union wait
#define NORMAL_EXIT_STATUS(x) (WIFEXITED(x) && !WEXITSTATUS (x))
#define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
#define _PATH_MAILDIR "/usr/spool/mail"
#define _PATH_BSHELL "/bin/sh"
#define _PATH_DEFPATH "/bin:/usr/bin:/usr/ucb"
#define _PATH_STDPATH "/bin:/usr/bin:/usr/ucb"
#define ROOT_PATH "/bin:/usr/bin:/usr/etc:/usr/ucb"
#define DEF_DB_TYPE "dbm"
#define ALIAS_DB_MAP "netinfo:/aliases"
#include <libc.h>
#define MISSING_POSIX_S_IS
#define MISSING_POSIX_S_MODES
/* It's amazing what is all missing... */
#define isascii(c) ((unsigned)(c)<=0177)
extern int opterr;
#define MISSING_PID_T
#define MISSING_STRFTIME_E
#define FD_CLOEXEC 1
#define O_NONBLOCK O_NDELAY
#define WEXITSTATUS(x) ((x).w_retcode)
#define WTERMSIG(x) ((x).w_termsig)
#endif
/*
* OPENSTEP does not have posix (some fix...)
*/
#ifdef OPENSTEP4
#define SUPPORTED
#include <sys/types.h>
#define HAS_DBM
#define USE_FLOCK_LOCK
#define USE_STATFS
#define HAVE_SYS_DIR_H
#define STATFS_IN_SYS_VFS_H
#define HAS_FSYNC
#define HAS_NIS
#define HAS_NETINFO
#define MISSING_SETENV_PUTENV
#define MISSING_MKFIFO
#define MISSING_SIGSET_T
#define MISSING_SIGACTION
#define MISSING_STD_FILENOS
#define MISSING_SETSID
#define MISSING_WAITPID
#define MISSING_UTIMBUF
#define HAS_WAIT4
#define WAIT_STATUS_T union wait
#define NORMAL_EXIT_STATUS(x) (WIFEXITED(x) && !WEXITSTATUS (x))
#define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
#define _PATH_MAILDIR "/usr/spool/mail"
#define _PATH_BSHELL "/bin/sh"
#define _PATH_DEFPATH "/bin:/usr/bin:/usr/ucb"
#define _PATH_STDPATH "/bin:/usr/bin:/usr/ucb"
#define ROOT_PATH "/bin:/usr/bin:/usr/etc:/usr/ucb"
#define DEF_DB_TYPE "dbm"
#define ALIAS_DB_MAP "netinfo:/aliases"
#include <libc.h>
#define MISSING_POSIX_S_IS
#define MISSING_POSIX_S_MODES
/* It's amazing what is all missing... */
#define isascii(c) ((unsigned)(c)<=0177)
extern int opterr;
#define MISSING_PID_T
#define MISSING_STRFTIME_E
#define FD_CLOEXEC 1
#define O_NONBLOCK O_NDELAY
#define WEXITSTATUS(x) ((x).w_retcode)
#define WTERMSIG(x) ((x).w_termsig)
#define NORETURN /* the native compiler */
#endif
#ifdef ReliantUnix543
#define SUPPORTED
#include <sys/types.h>
#define MISSING_SETENV
#define _PATH_DEFPATH "/usr/bin:/usr/ucb"
#define _PATH_BSHELL "/bin/sh"
#define _PATH_MAILDIR "/var/spool/mail"
#define USE_FCNTL_LOCK
#define USE_DOT_LOCK
#define HAS_FSYNC
#define FIONREAD_IN_SYS_FILIO_H
#define USE_SYS_SOCKIO_H
#define HAS_DBM
#define DEF_DB_TYPE "dbm"
#define ALIAS_DB_MAP "dbm:/var/adm/sendmail/aliases"
extern int optind; /* XXX use <getopt.h> */
extern char *optarg; /* XXX use <getopt.h> */
extern int opterr; /* XXX use <getopt.h> */
#define HAS_NIS
#define GETTIMEOFDAY(t) gettimeofday(t)
#define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb"
#define USE_STATVFS
#define STATVFS_IN_SYS_STATVFS_H
#define MISSING_USLEEP
#endif
/*
* We're not going to try to guess like configure does.
*/
#ifndef SUPPORTED
#error "unsupported platform"
#endif
#ifdef DUP2_DUPS_CLOSE_ON_EXEC
/* dup2_pass_on_exec() can be found in util/sys_compat.c */
extern int dup2_pass_on_exec(int oldd, int newd);
#define DUP2 dup2_pass_on_exec
#else
#define DUP2 dup2
#endif
#ifdef PREPEND_PLUS_TO_OPTSTRING
#define GETOPT(argc, argv, str) getopt((argc), (argv), "+" str)
#else
#define GETOPT(argc, argv, str) getopt((argc), (argv), (str))
#endif
#define OPTIND (optind > 0 ? optind : 1)
#if defined(USE_FCNTL_LOCK) && defined(USE_FLOCK_LOCK)
#error "define USE_FCNTL_LOCK or USE_FLOCK_LOCK, not both"
#endif
#if !defined(USE_FCNTL_LOCK) && !defined(USE_FLOCK_LOCK)
#error "define USE_FCNTL_LOCK or USE_FLOCK_LOCK"
#endif
#if defined(USE_STATFS) && defined(USE_STATVFS)
#error "define USE_STATFS or USE_STATVFS, not both"
#endif
#if !defined(USE_STATFS) && !defined(USE_STATVFS)
#error "define USE_STATFS or USE_STATVFS"
#endif
/*
* Defaults for normal systems.
*/
#ifndef SOCKADDR_SIZE
#define SOCKADDR_SIZE int
#endif
#ifndef SOCKOPT_SIZE
#define SOCKOPT_SIZE int
#endif
#ifndef LOCAL_LISTEN
#define LOCAL_LISTEN unix_listen
#define LOCAL_ACCEPT unix_accept
#define LOCAL_CONNECT unix_connect
#define LOCAL_TRIGGER unix_trigger
#endif
#if !defined (HAVE_SYS_NDIR_H) && !defined (HAVE_SYS_DIR_H) \
&& !defined (HAVE_NDIR_H)
#define HAVE_DIRENT_H
#endif
#ifndef WAIT_STATUS_T
typedef int WAIT_STATUS_T;
#define NORMAL_EXIT_STATUS(status) ((status) == 0)
#endif
/*
* Turn on the compatibility stuff.
*/
#ifdef MISSING_UTIMBUF
struct utimbuf {
time_t actime;
time_t modtime;
};
#endif
#ifdef MISSING_STRERROR
extern const char *strerror(int);
#endif
#if defined (MISSING_SETENV) || defined (MISSING_SETENV_PUTENV)
extern int setenv(const char *, const char *, int);
#endif
#ifdef MISSING_SETEUID
extern int seteuid(uid_t euid);
#endif
#ifdef MISSING_SETEGID
extern int setegid(gid_t egid);
#endif
#ifdef MISSING_MKFIFO
extern int mkfifo(char *, int);
#endif
#ifdef MISSING_WAITPID
extern int waitpid(int, WAIT_STATUS_T *status, int options);
#endif
#ifdef MISSING_SETSID
extern int setsid(void);
#endif
#ifdef MISSING_STD_FILENOS
#define STDIN_FILENO 0
#define STDOUT_FILENO 1
#define STDERR_FILENO 2
#endif
#ifdef MISSING_PID_T
typedef int pid_t;
#endif
#ifdef MISSING_POSIX_S_IS
#define S_ISBLK(mode) (((mode) & (_S_IFMT)) == (_S_IFBLK))
#define S_ISCHR(mode) (((mode) & (_S_IFMT)) == (_S_IFCHR))
#define S_ISDIR(mode) (((mode) & (_S_IFMT)) == (_S_IFDIR))
#define S_ISSOCK(mode) (((mode) & (_S_IFMT)) == (_S_IFSOCK))
#define S_ISFIFO(mode) (((mode) & (_S_IFMT)) == (_S_IFIFO))
#define S_ISREG(mode) (((mode) & (_S_IFMT)) == (_S_IFREG))
#endif
#ifdef MISSING_POSIX_S_MODES
#define S_IRUSR _S_IRUSR
#define S_IRGRP 0000040
#define S_IROTH 0000004
#define S_IWUSR _S_IWUSR
#define S_IWGRP 0000020
#define S_IWOTH 0000002
#define S_IXUSR _S_IXUSR
#define S_IXGRP 0000010
#define S_IXOTH 0000001
#define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)
#endif
/*
* Need to specify what functions never return, so that the compiler can
* warn for missing initializations and other trouble. However, OPENSTEP4
* gcc 2.7.x cannot handle this so we define this only if NORETURN isn't
* already defined above.
*/
#ifndef NORETURN
#if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 || __GNUC__ >= 3
#define NORETURN void __attribute__((__noreturn__))
#endif
#endif
#ifndef NORETURN
#define NORETURN void
#endif
/*
* Making the ctype.h macros not more expensive than necessary. On some
* systems, ctype.h misbehaves badly with signed characters.
*/
#define _UCHAR_(c) ((unsigned char)(c))
#ifdef UNSAFE_CTYPE
#define ISASCII(c) isascii(_UCHAR_(c))
#define ISALNUM(c) (ISASCII(c) && isalnum(c))
#define ISALPHA(c) (ISASCII(c) && isalpha(c))
#define ISCNTRL(c) (ISASCII(c) && iscntrl(c))
#define ISDIGIT(c) (ISASCII(c) && isdigit(c))
#define ISGRAPH(c) (ISASCII(c) && isgraph(c))
#define ISLOWER(c) (ISASCII(c) && islower(c))
#define ISPRINT(c) (ISASCII(c) && isprint(c))
#define ISPUNCT(c) (ISASCII(c) && ispunct(c))
#define ISSPACE(c) (ISASCII(c) && isspace(c))
#define ISUPPER(c) (ISASCII(c) && isupper(c))
#define TOLOWER(c) (ISUPPER(c) ? tolower(c) : (c))
#define TOUPPER(c) (ISLOWER(c) ? toupper(c) : (c))
#else
#define ISASCII(c) isascii(_UCHAR_(c))
#define ISALNUM(c) isalnum(_UCHAR_(c))
#define ISALPHA(c) isalpha(_UCHAR_(c))
#define ISCNTRL(c) iscntrl(_UCHAR_(c))
#define ISDIGIT(c) isdigit(_UCHAR_(c))
#define ISGRAPH(c) isgraph(_UCHAR_(c))
#define ISLOWER(c) islower(_UCHAR_(c))
#define ISPRINT(c) isprint(_UCHAR_(c))
#define ISPUNCT(c) ispunct(_UCHAR_(c))
#define ISSPACE(c) isspace(_UCHAR_(c))
#define ISUPPER(c) isupper(_UCHAR_(c))
#define TOLOWER(c) tolower(_UCHAR_(c))
#define TOUPPER(c) toupper(_UCHAR_(c))
#endif
/*
* Scaffolding. I don't want to lose messages while the program is under
* development.
*/
extern int REMOVE(const char *);
/* 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
/*--*/
#endif

View File

@@ -1,31 +0,0 @@
#ifndef _TIMED_CONNECT_H_INCLUDED_
#define _TIMED_CONNECT_H_INCLUDED_
/*++
/* NAME
/* timed_connect 3h
/* SUMMARY
/* connect operation with timeout
/* SYNOPSIS
/* #include <sys/socket.h>
/* #include <timed_connect.h>
/* DESCRIPTION
/* .nf
/*
* External interface.
*/
extern int timed_connect(int, struct sockaddr *, int, int);
/* 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
/*--*/
#endif

View File

@@ -1,30 +0,0 @@
#ifndef _TIMED_WAIT_H_INCLUDED_
#define _TIMED_WAIT_H_INCLUDED_
/*++
/* NAME
/* timed_wait 3h
/* SUMMARY
/* wait operations with timeout
/* SYNOPSIS
/* #include <timed_wait.h>
/* DESCRIPTION
/* .nf
/*
* External interface.
*/
extern int timed_waitpid(pid_t, WAIT_STATUS_T *, int, int);
/* 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
/*--*/
#endif

View File

@@ -1,33 +0,0 @@
#ifndef _TRIGGER_H_INCLUDED_
#define _TRIGGER_H_INCLUDED_
/*++
/* NAME
/* trigger 3h
/* SUMMARY
/* client interface file
/* SYNOPSIS
/* #include <trigger.h>
/* DESCRIPTION
/* .nf
/*
* External interface.
*/
extern int unix_trigger(const char *, const char *, int, int);
extern int inet_trigger(const char *, const char *, int, int);
extern int fifo_trigger(const char *, const char *, int, int);
extern int stream_trigger(const char *, const char *, int, int);
/* 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
/*--*/
#endif

View File

@@ -1,29 +0,0 @@
#ifndef _USERNAME_H_INCLUDED_
#define _USERNAME_H_INCLUDED_
/*++
/* NAME
/* username 3h
/* SUMMARY
/* lookup name of real user
/* SYNOPSIS
/* #include <username.h>
/* DESCRIPTION
/* .nf
/* External interface. */
extern const char *username(void);
/* 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
/*--*/
#endif

View File

@@ -1,33 +0,0 @@
#ifndef _VALID_HOSTNAME_H_INCLUDED_
#define _VALID_HOSTNAME_H_INCLUDED_
/*++
/* NAME
/* valid_hostname 3h
/* SUMMARY
/* validate hostname
/* SYNOPSIS
/* #include <valid_hostname.h>
/* DESCRIPTION
/* .nf
/* External interface */
#define VALID_HOSTNAME_LEN 255 /* RFC 1035 */
#define VALID_LABEL_LEN 63 /* RFC 1035 */
extern int valid_hostname(const char *);
extern int valid_hostaddr(const char *);
/* 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
/*--*/
#endif

View File

@@ -1,98 +0,0 @@
#ifndef _VBUF_H_INCLUDED_
#define _VBUF_H_INCLUDED_
/*++
/* NAME
/* vbuf 3h
/* SUMMARY
/* generic buffer
/* SYNOPSIS
/* #include <vbuf.h>
/* DESCRIPTION
/* .nf
/*
* The VBUF buffer is defined by 1) its structure, by 2) the VBUF_GET() and
* 3) VBUF_PUT() operations that automatically handle buffer empty and
* buffer full conditions, and 4) by the VBUF_SPACE() operation that allows
* the user to reserve buffer space ahead of time, to allow for situations
* where calling VBUF_PUT() is not possible or desirable.
*
* The VBUF buffer does not specify primitives for memory allocation or
* deallocation. The purpose is to allow different applications to have
* different strategies: a memory-resident buffer; a memory-mapped file; or
* a stdio-like window to an open file. Each application provides its own
* get(), put() and space() methods that perform the necessary magic.
*
* This interface is pretty normal. With one exception: the number of bytes
* left to read is negated. This is done so that we can change direction
* between reading and writing on the fly.
*/
typedef struct VBUF VBUF;
typedef int (*VBUF_GET_READY_FN) (VBUF *);
typedef int (*VBUF_PUT_READY_FN) (VBUF *);
typedef int (*VBUF_SPACE_FN) (VBUF *, int);
struct VBUF {
int flags; /* status, see below */
unsigned char *data; /* variable-length buffer */
int len; /* buffer length */
int cnt; /* bytes left to read/write */
unsigned char *ptr; /* read/write position */
VBUF_GET_READY_FN get_ready; /* read buffer empty action */
VBUF_PUT_READY_FN put_ready; /* write buffer full action */
VBUF_SPACE_FN space; /* request for buffer space */
};
/*
* Typically, an application will embed a VBUF structure into a larger
* structure that also contains application-specific members. This approach
* gives us the best of both worlds. The application can still use the
* generic VBUF primitives for reading and writing VBUFs. The macro below
* transforms a pointer from VBUF structure to the structure that contains
* it.
*/
#define VBUF_TO_APPL(vbuf_ptr,app_type,vbuf_member) \
((app_type *) (((char *) (vbuf_ptr)) - offsetof(app_type,vbuf_member)))
/*
* Buffer status management.
*/
#define VBUF_FLAG_ERR (1<<0) /* some I/O error */
#define VBUF_FLAG_EOF (1<<1) /* end of data */
#define VBUF_FLAG_BAD (VBUF_FLAG_ERR | VBUF_FLAG_EOF)
#define VBUF_FLAG_FIXED (1<<2) /* fixed-size buffer */
#define vbuf_error(v) ((v)->flags & VBUF_FLAG_ERR)
#define vbuf_eof(v) ((v)->flags & VBUF_FLAG_EOF)
#define vbuf_clearerr(v) ((v)->flags &= ~VBUF_FLAG_BAD)
/*
* Buffer I/O-like operations and results.
*/
#define VBUF_GET(v) ((v)->cnt < 0 ? ++(v)->cnt, \
(int) *(v)->ptr++ : vbuf_get(v))
#define VBUF_PUT(v,c) ((v)->cnt > 0 ? --(v)->cnt, \
(int) (*(v)->ptr++ = (c)) : vbuf_put((v),(c)))
#define VBUF_SPACE(v,n) ((v)->space((v),(n)))
#define VBUF_EOF (-1) /* no more space or data */
extern int vbuf_get(VBUF *);
extern int vbuf_put(VBUF *, int);
extern int vbuf_unget(VBUF *, int);
extern int vbuf_read(VBUF *, char *, int);
extern int vbuf_write(VBUF *, const char *, int);
/* 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
/*--*/
#endif

View File

@@ -1,40 +0,0 @@
#ifndef _VBUF_PRINT_H_INCLUDED_
#define _VBUF_PRINT_H_INCLUDED_
/*++
/* NAME
/* vbuf_print 3h
/* SUMMARY
/* formatted print to generic buffer
/* SYNOPSIS
/* #include <vbuf_print.h>
/* DESCRIPTION
/* .nf
/*
* System library.
*/
#include <stdarg.h>
/*
* Utility library.
*/
#include <vbuf.h>
/*
* External interface.
*/
extern VBUF *vbuf_print(VBUF *, const char *, va_list);
/* 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
/*--*/
#endif

View File

@@ -1,135 +0,0 @@
#ifndef _VSTREAM_H_INCLUDED_
#define _VSTREAM_H_INCLUDED_
/*++
/* NAME
/* vstream 3h
/* SUMMARY
/* simple buffered I/O package
/* SYNOPSIS
/* #include <vstream.h>
/* DESCRIPTION
/* .nf
/*
* System library.
*/
#include <fcntl.h>
#include <stdarg.h>
/*
* Utility library.
*/
#include <vbuf.h>
/*
* Simple buffered stream. The members of this structure are not part of the
* official interface and can change without prior notice.
*/
typedef int (*VSTREAM_FN) (int, void *, unsigned);
typedef int (*VSTREAM_WAITPID_FN) (pid_t, WAIT_STATUS_T *, int);
typedef struct VSTREAM {
VBUF buf; /* generic intelligent buffer */
int fd; /* file handle, no 256 limit */
VSTREAM_FN read_fn; /* buffer fill action */
VSTREAM_FN write_fn; /* buffer fill action */
long offset; /* cached seek info */
char *path; /* give it at least try */
int read_fd; /* read channel (double-buffered) */
int write_fd; /* write channel (double-buffered) */
VBUF read_buf; /* read buffer (double-buffered) */
VBUF write_buf; /* write buffer (double-buffered) */
pid_t pid; /* vstream_popen/close() */
VSTREAM_WAITPID_FN waitpid_fn; /* vstream_popen/close() */
} VSTREAM;
extern VSTREAM vstream_fstd[]; /* pre-defined streams */
#define VSTREAM_IN (&vstream_fstd[0])
#define VSTREAM_OUT (&vstream_fstd[1])
#define VSTREAM_ERR (&vstream_fstd[2])
#define VSTREAM_FLAG_ERR VBUF_FLAG_ERR /* some I/O error */
#define VSTREAM_FLAG_EOF VBUF_FLAG_EOF /* end of file */
#define VSTREAM_FLAG_FIXED VBUF_FLAG_FIXED /* fixed-size buffer */
#define VSTREAM_FLAG_BAD VBUF_FLAG_BAD
#define VSTREAM_FLAG_READ (1<<8) /* read buffer */
#define VSTREAM_FLAG_WRITE (1<<9) /* write buffer */
#define VSTREAM_FLAG_SEEK (1<<10) /* seek info valid */
#define VSTREAM_FLAG_NSEEK (1<<11) /* can't seek this file */
#define VSTREAM_FLAG_DOUBLE (1<<12) /* double buffer */
#define VSTREAM_BUFSIZE 4096
extern VSTREAM *vstream_fopen(const char *, int, int);
extern int vstream_fclose(VSTREAM *);
extern long vstream_fseek(VSTREAM *, long, int);
extern long vstream_ftell(VSTREAM *);
extern int vstream_fflush(VSTREAM *);
extern int vstream_fputs(const char *, VSTREAM *);
extern VSTREAM *vstream_fdopen(int, int);
#define vstream_fread(v, b, n) vbuf_read(&(v)->buf, (b), (n))
#define vstream_fwrite(v, b, n) vbuf_write(&(v)->buf, (b), (n))
#define VSTREAM_PUTC(ch, vp) VBUF_PUT(&(vp)->buf, (ch))
#define VSTREAM_GETC(vp) VBUF_GET(&(vp)->buf)
#define vstream_ungetc(vp, ch) vbuf_unget(&(vp)->buf, (ch))
#define VSTREAM_EOF VBUF_EOF
#define VSTREAM_PUTCHAR(ch) VSTREAM_PUTC((ch), VSTREAM_OUT)
#define VSTREAM_GETCHAR() VSTREAM_GETC(VSTREAM_IN)
#define vstream_fileno(vp) ((vp)->fd)
#define vstream_ferror(vp) vbuf_error(&(vp)->buf)
#define vstream_feof(vp) vbuf_eof(&(vp)->buf)
#define vstream_clearerr(vp) vbuf_clearerr(&(vp)->buf)
#define VSTREAM_PATH(vp) ((vp)->path ? (vp)->path : "unknown_stream")
extern void vstream_control(VSTREAM *, int,...);
#define VSTREAM_CTL_END 0
#define VSTREAM_CTL_READ_FN 1
#define VSTREAM_CTL_WRITE_FN 2
#define VSTREAM_CTL_PATH 3
#define VSTREAM_CTL_DOUBLE 4
#define VSTREAM_CTL_READ_FD 5
#define VSTREAM_CTL_WRITE_FD 6
#define VSTREAM_CTL_WAITPID_FN 7
extern VSTREAM *vstream_printf(const char *,...);
extern VSTREAM *vstream_fprintf(VSTREAM *, const char *,...);
extern VSTREAM *vstream_popen(const char *, int);
extern VSTREAM *vstream_popen_vargs(int,...);
extern int vstream_pclose(VSTREAM *);
#define vstream_ispipe(vp) ((vp)->pid != 0)
#define VSTREAM_POPEN_END 0 /* terminator */
#define VSTREAM_POPEN_COMMAND 1 /* command is string */
#define VSTREAM_POPEN_ARGV 2 /* command is array */
#define VSTREAM_POPEN_UID 3 /* privileges */
#define VSTREAM_POPEN_GID 4 /* privileges */
#define VSTREAM_POPEN_ENV 5 /* extra environment */
#define VSTREAM_POPEN_SHELL 6 /* alternative shell */
#define VSTREAM_POPEN_WAITPID_FN 7 /* child catcher, waitpid() compat. */
extern VSTREAM *vstream_vfprintf(VSTREAM *, const char *, va_list);
extern int vstream_peek(VSTREAM *);
/* 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
/*--*/
#endif

View File

@@ -1,98 +0,0 @@
#ifndef _VSTRING_H_INCLUDED_
#define _VSTRING_H_INCLUDED_
/*++
/* NAME
/* vstring 3h
/* SUMMARY
/* arbitrary-length string manager
/* SYNOPSIS
/* #include "vstring.h"
/* DESCRIPTION
/* .nf
/*
* System library.
*/
#include <stdarg.h>
/*
* Utility library.
*/
#include <vbuf.h>
/*
* We can't allow bare VBUFs in the interface, because VSTRINGs have a
* specific initialization and destruction sequence.
*/
typedef struct VSTRING {
VBUF vbuf;
int maxlen;
} VSTRING;
extern void vstring_init(VSTRING *, int);
extern void vstring_wipe(VSTRING *);
extern VSTRING *vstring_alloc(int);
extern void vstring_ctl(VSTRING *,...);
extern VSTRING *vstring_truncate(VSTRING *, int);
extern VSTRING *vstring_free(VSTRING *);
extern VSTRING *vstring_strcpy(VSTRING *, const char *);
extern VSTRING *vstring_strncpy(VSTRING *, const char *, int);
extern VSTRING *vstring_strcat(VSTRING *, const char *);
extern VSTRING *vstring_strncat(VSTRING *, const char *, int);
extern VSTRING *vstring_sprintf(VSTRING *, const char *,...);
extern VSTRING *vstring_sprintf_append(VSTRING *, const char *,...);
extern char *vstring_export(VSTRING *);
extern VSTRING *vstring_import(char *);
#define VSTRING_CTL_MAXLEN 1
#define VSTRING_CTL_END 0
/*
* Macros. Unsafe macros have UPPERCASE names.
*/
#define VSTRING_SPACE(vp, len) ((vp)->vbuf.space(&(vp)->vbuf, len))
#define vstring_str(vp) ((char *) (vp)->vbuf.data)
#define VSTRING_LEN(vp) ((vp)->vbuf.ptr - (vp)->vbuf.data)
#define vstring_end(vp) ((char *) (vp)->vbuf.ptr)
#define VSTRING_TERMINATE(vp) { if ((vp)->vbuf.cnt <= 0) \
VSTRING_SPACE((vp),1); \
*(vp)->vbuf.ptr = 0; }
#define VSTRING_RESET(vp) { (vp)->vbuf.ptr = (vp)->vbuf.data; \
(vp)->vbuf.cnt = (vp)->vbuf.len; }
#define VSTRING_ADDCH(vp, ch) VBUF_PUT(&(vp)->vbuf, ch)
#define VSTRING_SKIP(vp) { while ((vp)->vbuf.cnt > 0 && *(vp)->vbuf.ptr) \
(vp)->vbuf.ptr++, (vp)->vbuf.cnt--; }
#define vstring_avail(vp) ((vp)->vbuf.cnt)
/*
* The following macro is not part of the public interface, because it can
* really screw up a buffer by positioning past allocated memory.
*/
#define VSTRING_AT_OFFSET(vp, offset) { \
(vp)->vbuf.ptr = (vp)->vbuf.data + (offset); \
(vp)->vbuf.cnt = (vp)->vbuf.len - (offset); \
}
extern VSTRING *vstring_vsprintf(VSTRING *, const char *, va_list);
extern VSTRING *vstring_vsprintf_append(VSTRING *, const char *, va_list);
/* BUGS
/* Auto-resizing may change the address of the string data in
/* a vstring structure. Beware of dangling pointers.
/* HISTORY
/* .ad
/* .fi
/* A vstring module appears in the UNPROTO software by Wietse Venema.
/* 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
/*--*/
#endif

View File

@@ -1,54 +0,0 @@
#ifndef _VSTRING_VSTREAM_H_INCLUDED_
#define _VSTRING_VSTREAM_H_INCLUDED_
/*++
/* NAME
/* vstring_vstream 3h
/* SUMMARY
/* auto-resizing string library
/* SYNOPSIS
/* #include <vstring_vstream.h>
/* DESCRIPTION
/*
* Utility library.
*/
#include <vstream.h>
#include <vstring.h>
/*
* External interface.
*/
extern int vstring_get(VSTRING *, VSTREAM *);
extern int vstring_get_nonl(VSTRING *, VSTREAM *);
extern int vstring_get_null(VSTRING *, VSTREAM *);
extern int vstring_get_bound(VSTRING *, VSTREAM *, int);
extern int vstring_get_nonl_bound(VSTRING *, VSTREAM *, int);
/*
* Backwards compatibility for code that still uses the vstring_fgets()
* interface. Unfortunately we can't change the macro name to upper case.
*/
#define vstring_fgets(s, p) \
(vstring_get((s), (p)) == VSTREAM_EOF ? 0 : (s))
#define vstring_fgets_nonl(s, p) \
(vstring_get_nonl((s), (p)) == VSTREAM_EOF ? 0 : (s))
#define vstring_fgets_null(s, p) \
(vstring_get_null((s), (p)) == VSTREAM_EOF ? 0 : (s))
#define vstring_fgets_bound(s, p, l) \
(vstring_get_bound((s), (p), (l)) == VSTREAM_EOF ? 0 : (s))
#define vstring_fgets_nonl_bound(s, p, l) \
(vstring_get_nonl_bound((s), (p), (l)) == VSTREAM_EOF ? 0 : (s))
/* 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
/*--*/
#endif

View File

View File

@@ -1,91 +0,0 @@
/*++
/* NAME
/* feature 3
/* SUMMARY
/* toggle features depending on address
/* SYNOPSIS
/* #include "local.h"
/*
/* int feature_control(state)
/* LOCAL_STATE state;
/* DESCRIPTION
/* feature_control() breaks the localpart of the recipient
/* address up into fields, according to the recipient feature
/* delimiter, and turns on/off the features as encountered.
/*
/* Arguments:
/* .IP state
/* The attributes that specify the message, recipient and more.
/* Attributes describing the alias, include or forward expansion.
/* A table with the results from expanding aliases or lists.
/* 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 <string.h>
#ifdef STRCASECMP_IN_STRINGS_H
#include <strings.h>
#endif
/* Utility library. */
#include <msg.h>
#include <stringops.h>
#include <mymalloc.h>
/* Global library. */
#include <mail_params.h>
/* Application-specific. */
#include "local.h"
struct feature_map {
char *name;
int mask;
};
static struct feature_map feature_map[] = {
"nodelivered", FEATURE_NODELIVERED,
0,
};
/* feature_control - extract delivery options from recipient localpart */
int feature_control(const char *localpart)
{
struct feature_map *mp;
char *saved_localpart;
char *ptr;
int mask = 0;
char *cp;
if (*var_rcpt_fdelim) {
ptr = saved_localpart = mystrdup(localpart);
while ((cp = mystrtok(&ptr, var_rcpt_fdelim)) != 0) {
for (mp = feature_map; mp->name; mp++)
if (strcasecmp(mp->name, cp) == 0) {
if (msg_verbose)
msg_info("feature: %s", mp->name);
mask |= mp->mask;
break;
}
}
myfree(saved_localpart);
}
if (msg_verbose)
msg_info("features: 0x%x", mask);
return (mask);
}

View File

@@ -70,7 +70,7 @@ flagged with a warning.
.ad .ad
.fi .fi
.IP \fBMAIL_CONFIG\fR .IP \fBMAIL_CONFIG\fR
Mail configuration database. Directory with Postfix configuration files.
.IP \fBMAIL_VERBOSE\fR .IP \fBMAIL_VERBOSE\fR
Enable verbose logging for debugging purposes. Enable verbose logging for debugging purposes.
.SH CONFIGURATION PARAMETERS .SH CONFIGURATION PARAMETERS

View File

@@ -19,7 +19,7 @@ reads from standard input.
Options: Options:
.IP \fB-v\fR .IP \fB-v\fR
Enable verbose mode for debugging purposes. Multiple \fB-v\fR Enable verbose logging for debugging purposes. Multiple \fB-v\fR
options make the software increasingly verbose. options make the software increasingly verbose.
.SH DIAGNOSTICS .SH DIAGNOSTICS
.ad .ad

Some files were not shown because too many files have changed in this diff Show More