mirror of
https://github.com/vdukhovni/postfix
synced 2025-08-31 06:05:37 +00:00
snapshot-20011209
This commit is contained in:
committed by
Viktor Dukhovni
parent
e6bdd030da
commit
6bab266f36
@@ -5752,17 +5752,24 @@ Apologies for any names omitted.
|
|||||||
Bugfix? Avoid surprises with source routed destinations
|
Bugfix? Avoid surprises with source routed destinations
|
||||||
and OK entries in SMTPD access maps. File: smtpd/smtpd_access.c.
|
and OK entries in SMTPD access maps. File: smtpd/smtpd_access.c.
|
||||||
|
|
||||||
Security: "postfix check" now looks for common stupidity
|
Security: "postfix check" looks for damage by well-intended
|
||||||
such as "chown -R postfix /var/spool/postfix" which makes
|
but misguided use of "chown -R postfix /var/spool/postfix".
|
||||||
chrooted Postfix less secure than non-chrooted. These extra
|
That would make chrooted Postfix less secure than non-chrooted
|
||||||
tests are bound to raise a stink with third-party patches
|
Postfix. These extra tests may cause complaints with
|
||||||
such as TLS that introduce their own files into the jail.
|
third-party patches such as TLS that introduce their own
|
||||||
|
files into the jail.
|
||||||
|
|
||||||
|
Feature: disable the PIX workaround for mail that is queued
|
||||||
|
for less than $minimal_backoff_time seconds.
|
||||||
|
|
||||||
|
Feature: static map type that always returns the map name
|
||||||
|
as lookup value, regardless of lookup key value. Contributed
|
||||||
|
Jeff Miller (jeffm at ghostgun.com)
|
||||||
|
|
||||||
Open problems:
|
Open problems:
|
||||||
|
|
||||||
Low: log queue ID when enabling PIX workaround.
|
Low: after reorganizing configuration parameters, add flags
|
||||||
|
to all parameters whose value can be read from file.
|
||||||
Low: disable PIX workaround for mail < configurable age.
|
|
||||||
|
|
||||||
Low: replace null sender address internal representation
|
Low: replace null sender address internal representation
|
||||||
by <> so that it can be looked up reliably in maps. Must
|
by <> so that it can be looked up reliably in maps. Must
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
This code was created by Andrew McNamara <andrew@connect.com.au>
|
This code was created by Andrew McNamara <andrew@connect.com.au>
|
||||||
and adapted to snapshot 20001121 by Xavier Beaudouin. It was merged
|
and adapted to snapshot 50001121 by Xavier Beaudouin. It was merged
|
||||||
with mainstream Postfix for 20010128 by Wietse.
|
with mainstream Postfix for 20010128 by Wietse.
|
||||||
|
|
||||||
Purpose of this software
|
Purpose of this software
|
||||||
@@ -84,6 +84,12 @@ virtual_uid_maps
|
|||||||
For security reasons, regexp maps are not allowed here, because
|
For security reasons, regexp maps are not allowed here, because
|
||||||
their $1 etc. substitutions would open a security hole.
|
their $1 etc. substitutions would open a security hole.
|
||||||
|
|
||||||
|
Specify a static map if all mailboxes should be owned by the same
|
||||||
|
UID. For example, to specify that all mailboxes are owned by the
|
||||||
|
UID 5000, specify:
|
||||||
|
|
||||||
|
virtual_uid_maps = static:5000
|
||||||
|
|
||||||
virtual_gid_maps
|
virtual_gid_maps
|
||||||
|
|
||||||
Recipients are looked up in this map to determine the GID (group
|
Recipients are looked up in this map to determine the GID (group
|
||||||
@@ -92,6 +98,12 @@ virtual_gid_maps
|
|||||||
For security reasons, regexp maps are not allowed here, because
|
For security reasons, regexp maps are not allowed here, because
|
||||||
their $1 etc. substitutions would open a security hole.
|
their $1 etc. substitutions would open a security hole.
|
||||||
|
|
||||||
|
Specify a static map if all mailboxes should be owned by the same
|
||||||
|
GID. For example, to specify that all mailboxes are owned by the
|
||||||
|
GID 5000, specify:
|
||||||
|
|
||||||
|
virtual_gid_maps = static:5000
|
||||||
|
|
||||||
virtual_mailbox_lock
|
virtual_mailbox_lock
|
||||||
|
|
||||||
This setting is ignored in case of maildir delivery.
|
This setting is ignored in case of maildir delivery.
|
||||||
@@ -174,7 +186,8 @@ Example 2: co-existing with the default local delivery agent
|
|||||||
|
|
||||||
In this example, the default Postfix local delivery agent handles
|
In this example, the default Postfix local delivery agent handles
|
||||||
the mail for non-virtual recipients; the virtual delivery agent
|
the mail for non-virtual recipients; the virtual delivery agent
|
||||||
handles virtual recipients.
|
handles virtual recipients, and all virtual mailboxes are owned
|
||||||
|
by user ID 5000, group ID 5000.
|
||||||
|
|
||||||
Instead of "hash" specify "dbm" or "btree", depending on your system
|
Instead of "hash" specify "dbm" or "btree", depending on your system
|
||||||
type. The command "postconf -m" displays possible lookup table
|
type. The command "postconf -m" displays possible lookup table
|
||||||
@@ -184,8 +197,8 @@ types.
|
|||||||
virtual_mailbox_base = /var/mail/vhosts
|
virtual_mailbox_base = /var/mail/vhosts
|
||||||
virtual_mailbox_maps = hash:/etc/postfix/vmailbox
|
virtual_mailbox_maps = hash:/etc/postfix/vmailbox
|
||||||
virtual_minimum_uid = 100
|
virtual_minimum_uid = 100
|
||||||
virtual_uid_maps = hash:/etc/postfix/vuid
|
virtual_uid_maps = static:5000
|
||||||
virtual_gid_maps = hash:/etc/postfix/vgid
|
virtual_gid_maps = static:5000
|
||||||
transport_maps = hash:/etc/postfix/transport
|
transport_maps = hash:/etc/postfix/transport
|
||||||
|
|
||||||
# All domains that have final delivery on this machine
|
# All domains that have final delivery on this machine
|
||||||
@@ -216,23 +229,15 @@ types.
|
|||||||
test1@virtual1.domain test1
|
test1@virtual1.domain test1
|
||||||
test2@virtual2.domain test2/
|
test2@virtual2.domain test2/
|
||||||
|
|
||||||
/etc/postfix/vuid:
|
|
||||||
test1@virtual1.domain 5001
|
|
||||||
test2@virtual2.domain 5002
|
|
||||||
|
|
||||||
/etc/postfix/vgid:
|
|
||||||
test1@virtual1.domain 5001
|
|
||||||
test2@virtual2.domain 5002
|
|
||||||
|
|
||||||
Execute something like the following commands for each mailbox recipient:
|
Execute something like the following commands for each mailbox recipient:
|
||||||
|
|
||||||
# touch /var/mail/vhosts/test1
|
# touch /var/mail/vhosts/test1
|
||||||
# chown 5001:5001 /var/mail/vhosts/test1
|
# chown 5000:5000 /var/mail/vhosts/test1
|
||||||
|
|
||||||
Execute something like the following commands for each maildir recipient:
|
Execute something like the following commands for each maildir recipient:
|
||||||
|
|
||||||
# mkdir /var/mail/vhosts/test2
|
# mkdir /var/mail/vhosts/test2
|
||||||
# chown 5002:5002 /var/mail/vhosts/test2
|
# chown 5000:5000 /var/mail/vhosts/test2
|
||||||
|
|
||||||
Remember that each domain is required to have a postmaster contact
|
Remember that each domain is required to have a postmaster contact
|
||||||
address.
|
address.
|
||||||
|
@@ -211,10 +211,12 @@ check)
|
|||||||
! \( -type p -o -type s \) ! -user $mail_owner \
|
! \( -type p -o -type s \) ! -user $mail_owner \
|
||||||
-exec $WARN not owned by $mail_owner: {} \;
|
-exec $WARN not owned by $mail_owner: {} \;
|
||||||
|
|
||||||
find `ls -d $queue_directory/* | \
|
for name in `ls -d $queue_directory/* | \
|
||||||
egrep -v '/(incoming|active|defer|deferred|bounce|saved|corrupt|public|private|flush|pid|maildrop)$'` \
|
egrep '/(bin|etc|lib|usr)$'` ; \
|
||||||
! -user root \
|
do \
|
||||||
-exec $WARN not owned by root: {} \;
|
find $name ! -user root \
|
||||||
|
-exec $WARN not owned by root: {} \; ; \
|
||||||
|
done
|
||||||
|
|
||||||
for dir in $queue_directory/maildrop
|
for dir in $queue_directory/maildrop
|
||||||
do
|
do
|
||||||
|
@@ -212,10 +212,12 @@ check)
|
|||||||
! \( -type p -o -type s \) ! -user $mail_owner \
|
! \( -type p -o -type s \) ! -user $mail_owner \
|
||||||
-exec $WARN not owned by $mail_owner: {} \;
|
-exec $WARN not owned by $mail_owner: {} \;
|
||||||
|
|
||||||
find `ls -d $queue_directory/* | \
|
for name in `ls -d $queue_directory/* | \
|
||||||
egrep -v '/(incoming|active|defer|deferred|bounce|saved|corrupt|public|private|flush|pid|maildrop)$'` \
|
egrep '/(bin|etc|lib|usr)$'` ; \
|
||||||
! -user root \
|
do \
|
||||||
-exec $WARN not owned by root: {} \;
|
find $name ! -user root \
|
||||||
|
-exec $WARN not owned by root: {} \; ; \
|
||||||
|
done
|
||||||
|
|
||||||
for dir in $queue_directory/maildrop
|
for dir in $queue_directory/maildrop
|
||||||
do
|
do
|
||||||
|
@@ -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-20011208"
|
#define DEF_MAIL_VERSION "Snapshot-20011209"
|
||||||
extern char *var_mail_version;
|
extern char *var_mail_version;
|
||||||
|
|
||||||
/* LICENSE
|
/* LICENSE
|
||||||
|
@@ -397,7 +397,7 @@ static void enqueue(const int flags, const char *sender, const char *full_name,
|
|||||||
msg_warn("-f option specified malformed sender: %s", sender);
|
msg_warn("-f option specified malformed sender: %s", sender);
|
||||||
} else {
|
} else {
|
||||||
if ((sender = username()) == 0)
|
if ((sender = username()) == 0)
|
||||||
msg_fatal("unable to find out your login name");
|
fatal_error(EX_OSERR, "unable to find out your login name");
|
||||||
saved_sender = mystrdup(sender);
|
saved_sender = mystrdup(sender);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -409,7 +409,8 @@ static void enqueue(const int flags, const char *sender, const char *full_name,
|
|||||||
* queue file.
|
* queue file.
|
||||||
*/
|
*/
|
||||||
if (stat(MAIL_QUEUE_MAILDROP, &st) < 0)
|
if (stat(MAIL_QUEUE_MAILDROP, &st) < 0)
|
||||||
msg_fatal("No maildrop directory %s: %m", MAIL_QUEUE_MAILDROP);
|
fatal_error(EX_UNAVAILABLE, "No maildrop directory %s: %m",
|
||||||
|
MAIL_QUEUE_MAILDROP);
|
||||||
if (st.st_mode & S_IWOTH) {
|
if (st.st_mode & S_IWOTH) {
|
||||||
handle = mail_stream_file(MAIL_QUEUE_MAILDROP,
|
handle = mail_stream_file(MAIL_QUEUE_MAILDROP,
|
||||||
MAIL_CLASS_PUBLIC, MAIL_SERVICE_PICKUP);
|
MAIL_CLASS_PUBLIC, MAIL_SERVICE_PICKUP);
|
||||||
@@ -418,7 +419,7 @@ static void enqueue(const int flags, const char *sender, const char *full_name,
|
|||||||
postdrop_command = concatenate(var_command_dir, "/postdrop",
|
postdrop_command = concatenate(var_command_dir, "/postdrop",
|
||||||
msg_verbose ? " -v" : (char *) 0, (char *) 0);
|
msg_verbose ? " -v" : (char *) 0, (char *) 0);
|
||||||
if ((handle = mail_stream_command(postdrop_command)) == 0)
|
if ((handle = mail_stream_command(postdrop_command)) == 0)
|
||||||
msg_fatal("%s(%ld): unable to execute %s: %m",
|
fatal_error(EX_UNAVAILABLE, "%s(%ld): unable to execute %s: %m",
|
||||||
saved_sender, (long) uid, postdrop_command);
|
saved_sender, (long) uid, postdrop_command);
|
||||||
myfree(postdrop_command);
|
myfree(postdrop_command);
|
||||||
}
|
}
|
||||||
@@ -452,7 +453,8 @@ static void enqueue(const int flags, const char *sender, const char *full_name,
|
|||||||
if (tp->type == TOK822_ADDR) {
|
if (tp->type == TOK822_ADDR) {
|
||||||
tok822_internalize(buf, tp->head, TOK822_STR_DEFL);
|
tok822_internalize(buf, tp->head, TOK822_STR_DEFL);
|
||||||
if (REC_PUT_BUF(dst, REC_TYPE_RCPT, buf) < 0)
|
if (REC_PUT_BUF(dst, REC_TYPE_RCPT, buf) < 0)
|
||||||
msg_fatal("%s(%ld): error writing queue file: %m",
|
fatal_error(EX_TEMPFAIL,
|
||||||
|
"%s(%ld): error writing queue file: %m",
|
||||||
saved_sender, (long) uid);
|
saved_sender, (long) uid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -494,7 +496,7 @@ static void enqueue(const int flags, const char *sender, const char *full_name,
|
|||||||
if ((flags & SM_FLAG_AEOF) && VSTRING_LEN(buf) == 1 && *STR(buf) == '.')
|
if ((flags & SM_FLAG_AEOF) && VSTRING_LEN(buf) == 1 && *STR(buf) == '.')
|
||||||
break;
|
break;
|
||||||
if (REC_PUT_BUF(dst, type, buf) < 0)
|
if (REC_PUT_BUF(dst, type, buf) < 0)
|
||||||
fatal_error(EX_CANTCREAT, "%s(%ld): error writing queue file: %m",
|
fatal_error(EX_TEMPFAIL, "%s(%ld): error writing queue file: %m",
|
||||||
saved_sender, (long) uid);
|
saved_sender, (long) uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -519,7 +521,9 @@ static void enqueue(const int flags, const char *sender, const char *full_name,
|
|||||||
fatal_error(EX_DATAERR, "%s(%ld): error reading input: %m",
|
fatal_error(EX_DATAERR, "%s(%ld): error reading input: %m",
|
||||||
saved_sender, (long) uid);
|
saved_sender, (long) uid);
|
||||||
if ((status = mail_stream_finish(handle, (VSTRING *) 0)) != 0)
|
if ((status = mail_stream_finish(handle, (VSTRING *) 0)) != 0)
|
||||||
fatal_error(EX_CANTCREAT, "%s(%ld): %s", saved_sender,
|
fatal_error((status & CLEANUP_STAT_BAD) ? EX_SOFTWARE :
|
||||||
|
(status & CLEANUP_STAT_WRITE) ? EX_TEMPFAIL :
|
||||||
|
EX_UNAVAILABLE, "%s(%ld): %s", saved_sender,
|
||||||
(long) uid, cleanup_strerror(status));
|
(long) uid, cleanup_strerror(status));
|
||||||
if (sendmail_path) {
|
if (sendmail_path) {
|
||||||
myfree(sendmail_path);
|
myfree(sendmail_path);
|
||||||
|
@@ -254,6 +254,7 @@ bool var_smtp_sasl_enable;
|
|||||||
char *var_smtp_bind_addr;
|
char *var_smtp_bind_addr;
|
||||||
bool var_smtp_rand_addr;
|
bool var_smtp_rand_addr;
|
||||||
bool var_smtp_break_lines;
|
bool var_smtp_break_lines;
|
||||||
|
int var_min_backoff_time;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Global variables. smtp_errno is set by the address lookup routines and by
|
* Global variables. smtp_errno is set by the address lookup routines and by
|
||||||
@@ -416,6 +417,7 @@ int main(int argc, char **argv)
|
|||||||
VAR_SMTP_DATA1_TMOUT, DEF_SMTP_DATA1_TMOUT, &var_smtp_data1_tmout, 1, 0,
|
VAR_SMTP_DATA1_TMOUT, DEF_SMTP_DATA1_TMOUT, &var_smtp_data1_tmout, 1, 0,
|
||||||
VAR_SMTP_DATA2_TMOUT, DEF_SMTP_DATA2_TMOUT, &var_smtp_data2_tmout, 1, 0,
|
VAR_SMTP_DATA2_TMOUT, DEF_SMTP_DATA2_TMOUT, &var_smtp_data2_tmout, 1, 0,
|
||||||
VAR_SMTP_QUIT_TMOUT, DEF_SMTP_QUIT_TMOUT, &var_smtp_quit_tmout, 1, 0,
|
VAR_SMTP_QUIT_TMOUT, DEF_SMTP_QUIT_TMOUT, &var_smtp_quit_tmout, 1, 0,
|
||||||
|
VAR_MIN_BACKOFF_TIME, DEF_MIN_BACKOFF_TIME, &var_min_backoff_time, 1, 0,
|
||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
static CONFIG_INT_TABLE int_table[] = {
|
static CONFIG_INT_TABLE int_table[] = {
|
||||||
|
@@ -179,11 +179,8 @@ int smtp_helo(SMTP_STATE *state)
|
|||||||
* does not span a packet boundary. This hurts performance so it is not
|
* does not span a packet boundary. This hurts performance so it is not
|
||||||
* on by default.
|
* on by default.
|
||||||
*/
|
*/
|
||||||
if (resp->str[strspn(resp->str, "20 *\t\n")] == 0) {
|
if (resp->str[strspn(resp->str, "20 *\t\n")] == 0)
|
||||||
msg_info("enabling PIX <CRLF>.<CRLF> workaround for %s",
|
|
||||||
session->namaddr);
|
|
||||||
state->features |= SMTP_FEATURE_MAYBEPIX;
|
state->features |= SMTP_FEATURE_MAYBEPIX;
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* See if we are talking to ourself. This should not be possible with the
|
* See if we are talking to ourself. This should not be possible with the
|
||||||
@@ -661,7 +658,11 @@ int smtp_xfer(SMTP_STATE *state)
|
|||||||
|
|
||||||
if (prev_type == REC_TYPE_CONT) /* missing newline at end */
|
if (prev_type == REC_TYPE_CONT) /* missing newline at end */
|
||||||
smtp_fputs("", 0, session->stream);
|
smtp_fputs("", 0, session->stream);
|
||||||
if ((state->features & SMTP_FEATURE_MAYBEPIX) != 0) {
|
if ((state->features & SMTP_FEATURE_MAYBEPIX) != 0
|
||||||
|
&& request->arrival_time < vstream_ftime(session->stream)
|
||||||
|
- var_min_backoff_time) {
|
||||||
|
msg_info("%s: enabling PIX <CRLF>.<CRLF> workaround for %s",
|
||||||
|
request->queue_id, session->namaddr);
|
||||||
vstream_fflush(session->stream);/* hurts performance */
|
vstream_fflush(session->stream);/* hurts performance */
|
||||||
sleep(10); /* not to mention this */
|
sleep(10); /* not to mention this */
|
||||||
}
|
}
|
||||||
|
@@ -1713,7 +1713,11 @@ static int check_mail_access(SMTPD_STATE *state, const char *table,
|
|||||||
msg_warn("%s: no @domain in address: %s", myname, CONST_STR(reply->recipient));
|
msg_warn("%s: no @domain in address: %s", myname, CONST_STR(reply->recipient));
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
if (var_allow_untrust_route == 0 && (reply->flags & RESOLVE_FLAG_ROUTED))
|
|
||||||
|
/*
|
||||||
|
* Avoid surprise matches with source-routed, non-local addresses.
|
||||||
|
*/
|
||||||
|
if (!resolve_local(ratsign + 1) && (reply->flags & RESOLVE_FLAG_ROUTED))
|
||||||
return (SMTPD_CHECK_DUNNO);
|
return (SMTPD_CHECK_DUNNO);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -1,73 +1,77 @@
|
|||||||
SHELL = /bin/sh
|
SHELL = /bin/sh
|
||||||
SRCS = argv.c argv_split.c basename.c binhash.c chroot_uid.c \
|
SRCS = argv.c argv_split.c attr_print0.c attr_print64.c attr_scan0.c \
|
||||||
close_on_exec.c concatenate.c dict.c dict_db.c dict_dbm.c \
|
attr_scan64.c base64_code.c basename.c binhash.c chroot_uid.c \
|
||||||
dict_env.c dict_ht.c dict_ldap.c dict_mysql.c dict_ni.c dict_nis.c \
|
clean_env.c close_on_exec.c concatenate.c ctable.c dict.c \
|
||||||
dict_nisplus.c dict_open.c dir_forest.c doze.c environ.c \
|
dict_alloc.c dict_db.c dict_dbm.c dict_debug.c dict_env.c \
|
||||||
events.c exec_command.c fifo_listen.c fifo_trigger.c file_limit.c \
|
dict_ht.c dict_ldap.c dict_mysql.c dict_ni.c dict_nis.c \
|
||||||
find_inet.c fsspace.c fullname.c get_domainname.c get_hostname.c \
|
dict_nisplus.c dict_open.c dict_pcre.c dict_regexp.c dict_static.c \
|
||||||
htable.c inet_addr_host.c inet_addr_list.c inet_addr_local.c \
|
dict_tcp.c dict_unix.c dir_forest.c doze.c duplex_pipe.c \
|
||||||
inet_connect.c inet_listen.c inet_trigger.c inet_util.c \
|
environ.c events.c exec_command.c fifo_listen.c fifo_trigger.c \
|
||||||
line_wrap.c lowercase.c lstat_as.c mac_parse.c make_dirs.c \
|
file_limit.c find_inet.c fsspace.c fullname.c get_domainname.c \
|
||||||
match_list.c match_ops.c msg.c msg_output.c msg_syslog.c \
|
get_hostname.c hex_quote.c htable.c inet_addr_host.c \
|
||||||
msg_vstream.c mvect.c myflock.c mymalloc.c mystrtok.c name_mask.c \
|
inet_addr_list.c inet_addr_local.c inet_connect.c inet_listen.c \
|
||||||
non_blocking.c open_as.c open_limit.c open_lock.c peekfd.c \
|
inet_trigger.c inet_util.c intv.c line_wrap.c lowercase.c \
|
||||||
percentm.c posix_signals.c printable.c read_wait.c readable.c \
|
lstat_as.c mac_expand.c mac_parse.c make_dirs.c match_list.c \
|
||||||
readlline.c ring.c safe_getenv.c safe_open.c sane_accept.c \
|
match_ops.c msg.c msg_output.c msg_syslog.c msg_vstream.c \
|
||||||
scan_dir.c set_eugid.c set_ugid.c sigdelay.c skipblanks.c \
|
mvect.c myflock.c mymalloc.c myrand.c mystrtok.c name_mask.c \
|
||||||
split_at.c stat_as.c sys_compat.c timed_connect.c timed_wait.c \
|
netstring.c non_blocking.c open_as.c open_limit.c open_lock.c \
|
||||||
translit.c trimblanks.c unix_connect.c unix_listen.c unix_trigger.c \
|
peekfd.c percentm.c posix_signals.c printable.c rand_sleep.c \
|
||||||
unsafe.c username.c valid_hostname.c vbuf.c vbuf_print.c \
|
read_wait.c readable.c readlline.c ring.c safe_getenv.c \
|
||||||
vstream.c vstream_popen.c vstring.c vstring_vstream.c writable.c \
|
safe_open.c sane_accept.c sane_link.c sane_rename.c \
|
||||||
write_buf.c write_wait.c dict_unix.c dict_pcre.c stream_listen.c \
|
sane_socketpair.c sane_time.c scan_dir.c set_eugid.c set_ugid.c \
|
||||||
stream_connect.c stream_trigger.c dict_regexp.c mac_expand.c \
|
sigdelay.c skipblanks.c sock_empty_wait.c spawn_command.c \
|
||||||
clean_env.c watchdog.c spawn_command.c duplex_pipe.c sane_rename.c \
|
split_at.c stat_as.c stream_connect.c stream_listen.c \
|
||||||
sane_link.c unescape.c timed_read.c timed_write.c dict_tcp.c \
|
stream_trigger.c sys_compat.c timed_connect.c timed_read.c \
|
||||||
hex_quote.c dict_alloc.c rand_sleep.c sane_time.c dict_debug.c \
|
timed_wait.c timed_write.c translit.c trimblanks.c unescape.c \
|
||||||
sane_socketpair.c myrand.c netstring.c ctable.c attr_print64.c intv.c \
|
unix_connect.c unix_listen.c unix_trigger.c unsafe.c username.c \
|
||||||
attr_scan64.c base64_code.c sock_empty_wait.c attr_print0.c attr_scan0.c
|
valid_hostname.c vbuf.c vbuf_print.c vstream.c vstream_popen.c \
|
||||||
OBJS = argv.o argv_split.o basename.o binhash.o chroot_uid.o \
|
vstring.c vstring_vstream.c watchdog.c writable.c write_buf.c \
|
||||||
close_on_exec.o concatenate.o dict.o dict_db.o dict_dbm.o \
|
write_wait.c
|
||||||
dict_env.o dict_ht.o dict_ldap.o dict_mysql.o dict_ni.o dict_nis.o \
|
OBJS = argv.o argv_split.o attr_print0.o attr_print64.o attr_scan0.o \
|
||||||
dict_nisplus.o dict_open.o dir_forest.o doze.o environ.o \
|
attr_scan64.o base64_code.o basename.o binhash.o chroot_uid.o \
|
||||||
events.o exec_command.o fifo_listen.o fifo_trigger.o file_limit.o \
|
clean_env.o close_on_exec.o concatenate.o ctable.o dict.o \
|
||||||
find_inet.o fsspace.o fullname.o get_domainname.o get_hostname.o \
|
dict_alloc.o dict_db.o dict_dbm.o dict_debug.o dict_env.o \
|
||||||
htable.o inet_addr_host.o inet_addr_list.o inet_addr_local.o \
|
dict_ht.o dict_ldap.o dict_mysql.o dict_ni.o dict_nis.o \
|
||||||
inet_connect.o inet_listen.o inet_trigger.o inet_util.o \
|
dict_nisplus.o dict_open.o dict_pcre.o dict_regexp.o dict_static.o \
|
||||||
line_wrap.o lowercase.o lstat_as.o mac_parse.o make_dirs.o \
|
dict_tcp.o dict_unix.o dir_forest.o doze.o duplex_pipe.o \
|
||||||
match_list.o match_ops.o msg.o msg_output.o msg_syslog.o \
|
environ.o events.o exec_command.o fifo_listen.o fifo_trigger.o \
|
||||||
msg_vstream.o mvect.o myflock.o mymalloc.o mystrtok.o name_mask.o \
|
file_limit.o find_inet.o fsspace.o fullname.o get_domainname.o \
|
||||||
non_blocking.o open_as.o open_limit.o open_lock.o peekfd.o \
|
get_hostname.o hex_quote.o htable.o inet_addr_host.o \
|
||||||
percentm.o posix_signals.o printable.o read_wait.o readable.o \
|
inet_addr_list.o inet_addr_local.o inet_connect.o inet_listen.o \
|
||||||
readlline.o ring.o safe_getenv.o safe_open.o sane_accept.o \
|
inet_trigger.o inet_util.o intv.o line_wrap.o lowercase.o \
|
||||||
scan_dir.o set_eugid.o set_ugid.o sigdelay.o skipblanks.o \
|
lstat_as.o mac_expand.o mac_parse.o make_dirs.o match_list.o \
|
||||||
split_at.o stat_as.o sys_compat.o timed_connect.o timed_wait.o \
|
match_ops.o msg.o msg_output.o msg_syslog.o msg_vstream.o \
|
||||||
translit.o trimblanks.o unix_connect.o unix_listen.o unix_trigger.o \
|
mvect.o myflock.o mymalloc.o myrand.o mystrtok.o name_mask.o \
|
||||||
unsafe.o username.o valid_hostname.o vbuf.o vbuf_print.o \
|
netstring.o non_blocking.o open_as.o open_limit.o open_lock.o \
|
||||||
vstream.o vstream_popen.o vstring.o vstring_vstream.o writable.o \
|
peekfd.o percentm.o posix_signals.o printable.o rand_sleep.o \
|
||||||
write_buf.o write_wait.o dict_unix.o dict_pcre.o stream_listen.o \
|
read_wait.o readable.o readlline.o ring.o safe_getenv.o \
|
||||||
stream_connect.o stream_trigger.o dict_regexp.o mac_expand.o \
|
safe_open.o sane_accept.o sane_link.o sane_rename.o \
|
||||||
clean_env.o watchdog.o spawn_command.o duplex_pipe.o sane_rename.o \
|
sane_socketpair.o sane_time.o scan_dir.o set_eugid.o set_ugid.o \
|
||||||
sane_link.o unescape.o timed_read.o timed_write.o dict_tcp.o \
|
sigdelay.o skipblanks.o sock_empty_wait.o spawn_command.o \
|
||||||
hex_quote.o dict_alloc.o rand_sleep.o sane_time.o dict_debug.o \
|
split_at.o stat_as.o stream_connect.o stream_listen.o \
|
||||||
sane_socketpair.o myrand.o netstring.o ctable.o attr_print64.o intv.o \
|
stream_trigger.o sys_compat.o timed_connect.o timed_read.o \
|
||||||
attr_scan64.o base64_code.o sock_empty_wait.o attr_print0.o attr_scan0.o
|
timed_wait.o timed_write.o translit.o trimblanks.o unescape.o \
|
||||||
HDRS = argv.h attr.h binhash.h chroot_uid.h connect.h dict.h dict_db.h \
|
unix_connect.o unix_listen.o unix_trigger.o unsafe.o username.o \
|
||||||
dict_dbm.h dict_env.h dict_ht.h dict_ldap.h dict_mysql.h \
|
valid_hostname.o vbuf.o vbuf_print.o vstream.o vstream_popen.o \
|
||||||
dict_ni.h dict_nis.h dict_nisplus.h dir_forest.h events.h \
|
vstring.o vstring_vstream.o watchdog.o writable.o write_buf.o \
|
||||||
exec_command.h find_inet.h fsspace.h fullname.h get_domainname.h \
|
write_wait.o
|
||||||
get_hostname.h htable.h inet_addr_host.h inet_addr_list.h \
|
HDRS = argv.h attr.h base64_code.h binhash.h chroot_uid.h clean_env.h \
|
||||||
inet_addr_local.h inet_util.h iostuff.h line_wrap.h listen.h lstat_as.h \
|
connect.h ctable.h dict.h dict_db.h dict_dbm.h dict_env.h \
|
||||||
mac_parse.h make_dirs.h match_list.h match_ops.h msg.h msg_output.h \
|
dict_ht.h dict_ldap.h dict_mysql.h dict_ni.h dict_nis.h \
|
||||||
msg_syslog.h msg_vstream.h mvect.h myflock.h mymalloc.h name_mask.h \
|
dict_nisplus.h dict_pcre.h dict_regexp.h dict_static.h dict_tcp.h \
|
||||||
open_as.h open_lock.h percentm.h posix_signals.h readlline.h ring.h \
|
dict_unix.h dir_forest.h events.h exec_command.h find_inet.h \
|
||||||
safe.h safe_open.h sane_accept.h scan_dir.h set_eugid.h set_ugid.h \
|
fsspace.h fullname.h get_domainname.h get_hostname.h hex_quote.h \
|
||||||
sigdelay.h split_at.h stat_as.h stringops.h sys_defs.h \
|
htable.h inet_addr_host.h inet_addr_list.h inet_addr_local.h \
|
||||||
timed_connect.h timed_wait.h trigger.h username.h valid_hostname.h \
|
inet_util.h intv.h iostuff.h line_wrap.h listen.h lstat_as.h \
|
||||||
vbuf.h vbuf_print.h vstream.h vstring.h vstring_vstream.h \
|
mac_expand.h mac_parse.h make_dirs.h match_list.h match_ops.h \
|
||||||
dict_unix.h dict_pcre.h dict_regexp.h mac_expand.h clean_env.h \
|
msg.h msg_output.h msg_syslog.h msg_vstream.h mvect.h myflock.h \
|
||||||
watchdog.h spawn_command.h sane_fsops.h dict_tcp.h hex_quote.h \
|
mymalloc.h myrand.h name_mask.h netstring.h open_as.h open_lock.h \
|
||||||
sane_time.h sane_socketpair.h myrand.h netstring.h ctable.h \
|
percentm.h posix_signals.h readlline.h ring.h safe.h safe_open.h \
|
||||||
intv.h base64_code.h
|
sane_accept.h sane_fsops.h sane_socketpair.h sane_time.h \
|
||||||
|
scan_dir.h set_eugid.h set_ugid.h sigdelay.h spawn_command.h \
|
||||||
|
split_at.h stat_as.h stringops.h sys_defs.h timed_connect.h \
|
||||||
|
timed_wait.h trigger.h username.h valid_hostname.h vbuf.h \
|
||||||
|
vbuf_print.h vstream.h vstring.h vstring_vstream.h watchdog.h
|
||||||
TESTSRC = fifo_open.c fifo_rdwr_bug.c fifo_rdonly_bug.c select_bug.c \
|
TESTSRC = fifo_open.c fifo_rdwr_bug.c fifo_rdonly_bug.c select_bug.c \
|
||||||
stream_test.c dup2_pass_on_exec.c
|
stream_test.c dup2_pass_on_exec.c
|
||||||
WARN = -W -Wformat -Wimplicit -Wmissing-prototypes \
|
WARN = -W -Wformat -Wimplicit -Wmissing-prototypes \
|
||||||
@@ -588,6 +592,7 @@ dict_open.o: dict_ldap.h
|
|||||||
dict_open.o: dict_mysql.h
|
dict_open.o: dict_mysql.h
|
||||||
dict_open.o: dict_pcre.h
|
dict_open.o: dict_pcre.h
|
||||||
dict_open.o: dict_regexp.h
|
dict_open.o: dict_regexp.h
|
||||||
|
dict_open.o: dict_static.h
|
||||||
dict_open.o: stringops.h
|
dict_open.o: stringops.h
|
||||||
dict_open.o: vstring.h
|
dict_open.o: vstring.h
|
||||||
dict_open.o: split_at.h
|
dict_open.o: split_at.h
|
||||||
@@ -608,6 +613,15 @@ dict_regexp.o: dict.h
|
|||||||
dict_regexp.o: argv.h
|
dict_regexp.o: argv.h
|
||||||
dict_regexp.o: dict_regexp.h
|
dict_regexp.o: dict_regexp.h
|
||||||
dict_regexp.o: mac_parse.h
|
dict_regexp.o: mac_parse.h
|
||||||
|
dict_static.o: dict_static.c
|
||||||
|
dict_static.o: sys_defs.h
|
||||||
|
dict_static.o: mymalloc.h
|
||||||
|
dict_static.o: msg.h
|
||||||
|
dict_static.o: dict.h
|
||||||
|
dict_static.o: vstream.h
|
||||||
|
dict_static.o: vbuf.h
|
||||||
|
dict_static.o: argv.h
|
||||||
|
dict_static.o: dict_static.h
|
||||||
dict_tcp.o: dict_tcp.c
|
dict_tcp.o: dict_tcp.c
|
||||||
dict_tcp.o: sys_defs.h
|
dict_tcp.o: sys_defs.h
|
||||||
dict_tcp.o: msg.h
|
dict_tcp.o: msg.h
|
||||||
|
@@ -168,6 +168,7 @@
|
|||||||
#include <dict_mysql.h>
|
#include <dict_mysql.h>
|
||||||
#include <dict_pcre.h>
|
#include <dict_pcre.h>
|
||||||
#include <dict_regexp.h>
|
#include <dict_regexp.h>
|
||||||
|
#include <dict_static.h>
|
||||||
#include <stringops.h>
|
#include <stringops.h>
|
||||||
#include <split_at.h>
|
#include <split_at.h>
|
||||||
#include <htable.h>
|
#include <htable.h>
|
||||||
@@ -214,6 +215,7 @@ static DICT_OPEN_INFO dict_open_info[] = {
|
|||||||
#ifdef HAS_POSIX_REGEXP
|
#ifdef HAS_POSIX_REGEXP
|
||||||
DICT_TYPE_REGEXP, dict_regexp_open,
|
DICT_TYPE_REGEXP, dict_regexp_open,
|
||||||
#endif
|
#endif
|
||||||
|
DICT_TYPE_STATIC, dict_static_open,
|
||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
72
postfix/src/util/dict_static.c
Normal file
72
postfix/src/util/dict_static.c
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
/*++
|
||||||
|
/* NAME
|
||||||
|
/* dict_static 3
|
||||||
|
/* SUMMARY
|
||||||
|
/* dictionary manager interface to static variables
|
||||||
|
/* SYNOPSIS
|
||||||
|
/* #include <dict_static.h>
|
||||||
|
/*
|
||||||
|
/* DICT *dict_static_open(name, dummy, dict_flags)
|
||||||
|
/* const char *name;
|
||||||
|
/* int dummy;
|
||||||
|
/* int dict_flags;
|
||||||
|
/* DESCRIPTION
|
||||||
|
/* dict_static_open() implements a dummy dictionary that returns
|
||||||
|
/* as lookup result the dictionary name, regardless of the lookup
|
||||||
|
/* key value.
|
||||||
|
/*
|
||||||
|
/* The \fIdummy\fR argument is ignored.
|
||||||
|
/* SEE ALSO
|
||||||
|
/* dict(3) generic dictionary manager
|
||||||
|
/* LICENSE
|
||||||
|
/* .ad
|
||||||
|
/* .fi
|
||||||
|
/* The Secure Mailer license must be distributed with this software.
|
||||||
|
/* AUTHOR(S)
|
||||||
|
/* jeffm
|
||||||
|
/* ghostgun.com
|
||||||
|
/*--*/
|
||||||
|
|
||||||
|
/* System library. */
|
||||||
|
|
||||||
|
#include "sys_defs.h"
|
||||||
|
#include <stdio.h> /* sprintf() prototype */
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
/* Utility library. */
|
||||||
|
|
||||||
|
#include "mymalloc.h"
|
||||||
|
#include "msg.h"
|
||||||
|
#include "dict.h"
|
||||||
|
#include "dict_static.h"
|
||||||
|
|
||||||
|
/* dict_static_lookup - access static value*/
|
||||||
|
|
||||||
|
static const char *dict_static_lookup(DICT *dict, const char *name)
|
||||||
|
{
|
||||||
|
dict_errno = 0;
|
||||||
|
|
||||||
|
return (dict->name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* dict_static_close - close static dictionary */
|
||||||
|
|
||||||
|
static void dict_static_close(DICT *dict)
|
||||||
|
{
|
||||||
|
dict_free(dict);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* dict_static_open - make association with static variable */
|
||||||
|
|
||||||
|
DICT *dict_static_open(const char *name, int unused_flags, int dict_flags)
|
||||||
|
{
|
||||||
|
DICT *dict;
|
||||||
|
|
||||||
|
dict = dict_alloc(DICT_TYPE_STATIC, name, sizeof(*dict));
|
||||||
|
dict->lookup = dict_static_lookup;
|
||||||
|
dict->close = dict_static_close;
|
||||||
|
dict->flags = dict_flags | DICT_FLAG_FIXED;
|
||||||
|
return (DICT_DEBUG (dict));
|
||||||
|
}
|
35
postfix/src/util/dict_static.h
Normal file
35
postfix/src/util/dict_static.h
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
#ifndef _DICT_STATIC_H_INCLUDED_
|
||||||
|
#define _DICT_STATIC_H_INCLUDED_
|
||||||
|
|
||||||
|
/*++
|
||||||
|
/* NAME
|
||||||
|
/* dict_static 3h
|
||||||
|
/* SUMMARY
|
||||||
|
/* dictionary manager interface to static settings
|
||||||
|
/* SYNOPSIS
|
||||||
|
/* #include <dict_static.h>
|
||||||
|
/* DESCRIPTION
|
||||||
|
/* .nf
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Utility library.
|
||||||
|
*/
|
||||||
|
#include <dict.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* External interface.
|
||||||
|
*/
|
||||||
|
#define DICT_TYPE_STATIC "static"
|
||||||
|
|
||||||
|
extern DICT *dict_static_open(const char *, int, int);
|
||||||
|
|
||||||
|
/* LICENSE
|
||||||
|
/* .ad
|
||||||
|
/* .fi
|
||||||
|
/* The Secure Mailer license must be distributed with this software.
|
||||||
|
/* AUTHOR(S)
|
||||||
|
/* jeffm
|
||||||
|
/* ghostgun.com
|
||||||
|
/*--*/
|
||||||
|
|
||||||
|
#endif
|
@@ -909,7 +909,11 @@ typedef int pid_t;
|
|||||||
* doubles.
|
* doubles.
|
||||||
*/
|
*/
|
||||||
#ifndef ALIGN_TYPE
|
#ifndef ALIGN_TYPE
|
||||||
#define ALIGN_TYPE double
|
# ifdef __ia64__
|
||||||
|
# define ALIGN_TYPE long double
|
||||||
|
# else
|
||||||
|
# define ALIGN_TYPE double
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user