mirror of
https://github.com/vdukhovni/postfix
synced 2025-08-30 13:48:06 +00:00
postfix-1.1.11-20020610
This commit is contained in:
committed by
Viktor Dukhovni
parent
14c13568bd
commit
866561e747
@@ -6598,9 +6598,9 @@ Apologies for any names omitted.
|
|||||||
with unread data according to ioctl FIONREAD. Incredible.
|
with unread data according to ioctl FIONREAD. Incredible.
|
||||||
Diagnosis by Max Pashkov. File: smtp/smtp-sink.c.
|
Diagnosis by Max Pashkov. File: smtp/smtp-sink.c.
|
||||||
|
|
||||||
Weirdstuff: sender-based routing. This will become more
|
Weird feature: sender-based routing. This will become more
|
||||||
useful once per-address transport map entries are done.
|
useful once per-address transport map entries are done.
|
||||||
File: src/qmgr/qmgr_message.c.
|
File: src/*qmgr/qmgr_message.c.
|
||||||
|
|
||||||
20020605
|
20020605
|
||||||
|
|
||||||
@@ -6609,6 +6609,20 @@ Apologies for any names omitted.
|
|||||||
addresses in message headers. The limit is expressed as a
|
addresses in message headers. The limit is expressed as a
|
||||||
number of tokens. File: global/tok822_parse.c
|
number of tokens. File: global/tok822_parse.c
|
||||||
|
|
||||||
|
20020608
|
||||||
|
|
||||||
|
Feature: user@domain transport map lookup, based on code
|
||||||
|
by Scott Cotton, from several years ago. Adding this code
|
||||||
|
now was much less painful than it was in the past. Files:
|
||||||
|
global/strip_addr.c, trivial-rewrite/transport.c.
|
||||||
|
|
||||||
|
20020610
|
||||||
|
|
||||||
|
Cleanup: making user@domain transport map lookups work with
|
||||||
|
sender-based routing was a bit tricky, because the null
|
||||||
|
address must be handled sensibly. Files: global/resolve_clnt.c,
|
||||||
|
trivial-rewrite/resolve.c. It ain't perfect yet, but close.
|
||||||
|
|
||||||
Open problems:
|
Open problems:
|
||||||
|
|
||||||
Medium: old maildrop files are no longer readable by the
|
Medium: old maildrop files are no longer readable by the
|
||||||
|
@@ -18,7 +18,7 @@ makefiles Makefiles:
|
|||||||
done;
|
done;
|
||||||
rm -f Makefile; (set -e; $(SHELL) makedefs && cat Makefile.in) >Makefile
|
rm -f Makefile; (set -e; $(SHELL) makedefs && cat Makefile.in) >Makefile
|
||||||
|
|
||||||
update printfck:
|
update printfck tests:
|
||||||
set -e; for i in $(DIRS); do \
|
set -e; for i in $(DIRS); do \
|
||||||
(set -e; echo "[$$i]"; cd $$i; $(MAKE) $(OPTS) $@ MAKELEVEL=) || exit 1; \
|
(set -e; echo "[$$i]"; cd $$i; $(MAKE) $(OPTS) $@ MAKELEVEL=) || exit 1; \
|
||||||
done
|
done
|
||||||
|
@@ -12,6 +12,31 @@ snapshot release). Patches change the patchlevel and the release
|
|||||||
date. Snapshots change only the release date, unless they include
|
date. Snapshots change only the release date, unless they include
|
||||||
the same bugfixes as a patch release.
|
the same bugfixes as a patch release.
|
||||||
|
|
||||||
|
Incompatible changes with Postfix snapshot 1.1.11-20020610
|
||||||
|
==========================================================
|
||||||
|
|
||||||
|
Regexp-based transport maps now see the entire recipient address
|
||||||
|
instead of only the destination domain name.
|
||||||
|
|
||||||
|
Major changes with Postfix snapshot 1.1.11-20020610
|
||||||
|
===================================================
|
||||||
|
|
||||||
|
A bizarre feature, sender-based routing, that could be useful in
|
||||||
|
combination with user@domain address lookups in the transport map.
|
||||||
|
|
||||||
|
An actually useful feature, user@domain address lookups in the
|
||||||
|
transport map. This feature also understands address extensions.
|
||||||
|
Transport maps still support lookup keys in the form of domain
|
||||||
|
names, but only with non-regexp tables. Specify <> in order to
|
||||||
|
match the null address. More in the transport(5) manual page.
|
||||||
|
|
||||||
|
Together with sender-based routing, and a dual Postfix setup.
|
||||||
|
user@domain transport map lookups could fulfill people's wishes to
|
||||||
|
have multiple SMTP personalities for sending and receiving mail,
|
||||||
|
including bounce processing. Details will have to be hammered out
|
||||||
|
by users, as Wietse is now completely tied up by other business
|
||||||
|
for the next three weeks.
|
||||||
|
|
||||||
Incompatible changes with Postfix snapshot 1.1.11-20020528
|
Incompatible changes with Postfix snapshot 1.1.11-20020528
|
||||||
==========================================================
|
==========================================================
|
||||||
|
|
||||||
|
@@ -66,10 +66,10 @@ fork_delay = 1s
|
|||||||
#
|
#
|
||||||
header_size_limit = 102400
|
header_size_limit = 102400
|
||||||
|
|
||||||
# The header_address_token_limit limits the amount of memory and CPU
|
# The header_address_token_limit limits the amount of memory that
|
||||||
# that Postfix will spend while rewriting addresses in message headers.
|
# Postfix will spend while rewriting addresses in message headers.
|
||||||
# The limit is expressed as a token count. Tokens beyond the limit are
|
# The limit is expressed as a token count. Tokens beyond the limit
|
||||||
# discarded.
|
# are discarded.
|
||||||
#
|
#
|
||||||
header_address_token_limit = 10240
|
header_address_token_limit = 10240
|
||||||
|
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
#
|
#
|
||||||
# DESCRIPTION
|
# DESCRIPTION
|
||||||
# The optional transport table specifies a mapping from
|
# The optional transport table specifies a mapping from
|
||||||
# domain hierarchies to message delivery transports and/or
|
# email addresses to message delivery transports and/or
|
||||||
# relay hosts. The mapping is used by the trivial-rewrite(8)
|
# relay hosts. The mapping is used by the trivial-rewrite(8)
|
||||||
# daemon.
|
# daemon.
|
||||||
#
|
#
|
||||||
@@ -26,143 +26,157 @@
|
|||||||
# Alternatively, the table can be provided as a regular-
|
# Alternatively, the table can be provided as a regular-
|
||||||
# expression map where patterns are given as regular expres-
|
# expression map where patterns are given as regular expres-
|
||||||
# sions. In that case, the lookups are done in a slightly
|
# sions. In that case, the lookups are done in a slightly
|
||||||
# different way as described below.
|
# different way as described in the section titled "REGULAR
|
||||||
|
# EXPRESSION TABLES".
|
||||||
#
|
#
|
||||||
# TABLE FORMAT
|
# TABLE FORMAT
|
||||||
# The format of the transport table is as follows:
|
# The format of the transport table is as follows:
|
||||||
#
|
#
|
||||||
# pattern result
|
# pattern result
|
||||||
# When pattern matches the domain, use the corre-
|
# When pattern matches the domain, use the corre-
|
||||||
# sponding result.
|
# sponding result.
|
||||||
#
|
#
|
||||||
# blank lines and comments
|
# blank lines and comments
|
||||||
# Empty lines and whitespace-only lines are ignored,
|
# Empty lines and whitespace-only lines are ignored,
|
||||||
# as are lines whose first non-whitespace character
|
# as are lines whose first non-whitespace character
|
||||||
# is a `#'.
|
# is a `#'.
|
||||||
#
|
#
|
||||||
# multi-line text
|
# multi-line text
|
||||||
# A logical line starts with non-whitespace text. A
|
# A logical line starts with non-whitespace text. A
|
||||||
# line that starts with whitespace continues a logi-
|
# line that starts with whitespace continues a logi-
|
||||||
# cal line.
|
# cal line.
|
||||||
#
|
#
|
||||||
# In an indexed file, a pattern of `*' matches everything.
|
# In an indexed file, a pattern of `*' matches everything.
|
||||||
#
|
#
|
||||||
# The result is of the form transport:nexthop. The trans-
|
# The result is of the form transport:nexthop. The trans-
|
||||||
# port field specifies a mail delivery transport such as
|
# port field specifies a mail delivery transport such as
|
||||||
# smtp or local. The nexthop field specifies where and how
|
# smtp or local. The nexthop field specifies where and how
|
||||||
# to deliver mail. A null transport or nexthop field means
|
# to deliver mail. A null transport or nexthop field means
|
||||||
# "do not change": use the delivery transport and nexthop
|
# "do not change": use the delivery transport and nexthop
|
||||||
# information that would be used if no match were found.
|
# information that would be used if no match were found.
|
||||||
#
|
#
|
||||||
# The interpretation of the nexthop field is transport
|
# The interpretation of the nexthop field is transport
|
||||||
# dependent. In the case of SMTP, specify host:service for a
|
# dependent. In the case of SMTP, specify host:service for a
|
||||||
# non-default server port, and use [host] or [host]:port in
|
# non-default server port, and use [host] or [host]:port in
|
||||||
# order to disable MX (mail exchanger) DNS lookups. The []
|
# order to disable MX (mail exchanger) DNS lookups. The []
|
||||||
# form can also be used with IP addresses instead of host-
|
# form can also be used with IP addresses instead of host-
|
||||||
# names.
|
# names.
|
||||||
#
|
#
|
||||||
# With lookups from indexed files such as DB or DBM, or from
|
# With lookups from indexed files such as DB or DBM, or from
|
||||||
# networked tables such as NIS, LDAP or SQL, patterns are
|
# networked tables such as NIS, LDAP or SQL, patterns are
|
||||||
# tried in the order as listed below:
|
# tried in the order as listed below:
|
||||||
#
|
#
|
||||||
|
# user+extension@domain transport:nexthop
|
||||||
|
# Mail for user+extension@domain is delivered through
|
||||||
|
# transport to nexthop.
|
||||||
|
#
|
||||||
|
# user@domain transport:nexthop
|
||||||
|
# Mail for user@domain is delivered through transport
|
||||||
|
# to nexthop.
|
||||||
|
#
|
||||||
# domain transport:nexthop
|
# domain transport:nexthop
|
||||||
# Mail for domain is delivered through transport to
|
# Mail for domain is delivered through transport to
|
||||||
# nexthop.
|
# nexthop.
|
||||||
#
|
#
|
||||||
# .domain transport:nexthop
|
# .domain transport:nexthop
|
||||||
# Mail for any subdomain of domain is delivered
|
# Mail for any subdomain of domain is delivered
|
||||||
# through transport to nexthop. This applies only
|
# through transport to nexthop. This applies only
|
||||||
# when the string transport_maps is not listed in the
|
# when the string transport_maps is not listed in the
|
||||||
# parent_domain_matches_subdomains configuration set-
|
# parent_domain_matches_subdomains configuration set-
|
||||||
# ting. Otherwise, a domain name matches itself and
|
# ting. Otherwise, a domain name matches itself and
|
||||||
# its subdomains.
|
# its subdomains.
|
||||||
#
|
#
|
||||||
|
# NOTE
|
||||||
|
# The special pattern <> represents the null address, and
|
||||||
|
# the special pattern * represents any address (i.e. it
|
||||||
|
# functions as the wild-card pattern).
|
||||||
|
#
|
||||||
# EXAMPLES
|
# EXAMPLES
|
||||||
# In order to deliver internal mail directly, while using a
|
# In order to deliver internal mail directly, while using a
|
||||||
# mail relay for all other mail, specify a null entry for
|
# mail relay for all other mail, specify a null entry for
|
||||||
# internal destinations (do not change the delivery trans-
|
# internal destinations (do not change the delivery trans-
|
||||||
# port or the nexthop information) and specify a wildcard
|
# port or the nexthop information) and specify a wildcard
|
||||||
# for all other destinations. Note that for this trick to
|
# for all other destinations. Note that for this trick to
|
||||||
# work you should not specify a relayhost in the main.cf
|
# work you should not specify a relayhost in the main.cf
|
||||||
# file.
|
# file.
|
||||||
#
|
#
|
||||||
# my.domain :
|
# my.domain :
|
||||||
# .my.domain :
|
# .my.domain :
|
||||||
# * smtp:outbound-relay.my.domain
|
# * smtp:outbound-relay.my.domain
|
||||||
#
|
#
|
||||||
# In order to send mail for foo.org and its subdomains via
|
# In order to send mail for foo.org and its subdomains via
|
||||||
# the uucp transport to the UUCP host named foo:
|
# the uucp transport to the UUCP host named foo:
|
||||||
#
|
#
|
||||||
# foo.org uucp:foo
|
# foo.org uucp:foo
|
||||||
# .foo.org uucp:foo
|
# .foo.org uucp:foo
|
||||||
#
|
#
|
||||||
# When no nexthop host name is specified, the destination
|
# When no nexthop host name is specified, the destination
|
||||||
# domain name is used instead. For example, the following
|
# domain name is used instead. For example, the following
|
||||||
# directs mail for user@foo.org via the slow transport to a
|
# directs mail for user@foo.org via the slow transport to a
|
||||||
# mail exchanger for foo.org. The slow transport could be
|
# mail exchanger for foo.org. The slow transport could be
|
||||||
# something that runs at most one delivery process at a
|
# something that runs at most one delivery process at a
|
||||||
# time:
|
# time:
|
||||||
#
|
#
|
||||||
# foo.org slow:
|
# foo.org slow:
|
||||||
#
|
#
|
||||||
# When no transport is specified, Postfix uses either
|
# When no transport is specified, Postfix uses either
|
||||||
# $local_transport or $default_transport, depending on
|
# $local_transport or $default_transport, depending on
|
||||||
# whether the destination matches $mydestination. The fol-
|
# whether the destination matches $mydestination. The fol-
|
||||||
# lowing sends all mail for foo.org and its subdomains to
|
# lowing sends all mail for foo.org and its subdomains to
|
||||||
# host gateway.foo.org:
|
# host gateway.foo.org:
|
||||||
#
|
#
|
||||||
# foo.org :[gateway.foo.org]
|
# foo.org :[gateway.foo.org]
|
||||||
# .foo.org :[gateway.foo.org]
|
# .foo.org :[gateway.foo.org]
|
||||||
#
|
#
|
||||||
# In the above example, the [] are used to suppress MX
|
# In the above example, the [] are used to suppress MX
|
||||||
# lookups. The result would likely point to your local
|
# lookups. The result would likely point to your local
|
||||||
# machine.
|
# machine.
|
||||||
#
|
#
|
||||||
# In the case of delivery via SMTP, one may specify host-
|
# In the case of delivery via SMTP, one may specify host-
|
||||||
# name:service instead of just a host:
|
# name:service instead of just a host:
|
||||||
#
|
#
|
||||||
# foo.org smtp:bar.org:2025
|
# foo.org smtp:bar.org:2025
|
||||||
#
|
#
|
||||||
# This directs mail for user@foo.org to host bar.org port
|
# This directs mail for user@foo.org to host bar.org port
|
||||||
# 2025. Instead of a numerical port a symbolic name may be
|
# 2025. Instead of a numerical port a symbolic name may be
|
||||||
# used. Specify [] around the hostname in order to disable
|
# used. Specify [] around the hostname in order to disable
|
||||||
# MX lookups.
|
# MX lookups.
|
||||||
#
|
#
|
||||||
# The error mailer can be used to bounce mail:
|
# The error mailer can be used to bounce mail:
|
||||||
#
|
#
|
||||||
# .foo.org error:mail for *.foo.org is not deliv-
|
# .foo.org error:mail for *.foo.org is not deliv-
|
||||||
# erable
|
# erable
|
||||||
#
|
#
|
||||||
# This causes all mail for user@anything.foo.org to be
|
# This causes all mail for user@anything.foo.org to be
|
||||||
# bounced.
|
# bounced.
|
||||||
#
|
#
|
||||||
# REGULAR EXPRESSION TABLES
|
# REGULAR EXPRESSION TABLES
|
||||||
# This section describes how the table lookups change when
|
# This section describes how the table lookups change when
|
||||||
# the table is given in the form of regular expressions. For
|
# the table is given in the form of regular expressions. For
|
||||||
# a description of regular expression lookup table syntax,
|
# a description of regular expression lookup table syntax,
|
||||||
# see regexp_table(5) or pcre_table(5).
|
# see regexp_table(5) or pcre_table(5).
|
||||||
#
|
#
|
||||||
# Each pattern is a regular expression that is applied to
|
# Each pattern is a regular expression that is applied to
|
||||||
# the entire domain being looked up. Thus, some.domain.hier-
|
# the entire domain being looked up. Thus, some.domain.hier-
|
||||||
# archy is not broken up into parent domains.
|
# archy is not broken up into parent domains.
|
||||||
#
|
#
|
||||||
# Patterns are applied in the order as specified in the
|
# Patterns are applied in the order as specified in the
|
||||||
# table, until a pattern is found that matches the search
|
# table, until a pattern is found that matches the search
|
||||||
# string.
|
# string.
|
||||||
#
|
#
|
||||||
# Results are the same as with indexed file lookups, with
|
# Results are the same as with indexed file lookups, with
|
||||||
# the additional feature that parenthesized substrings from
|
# the additional feature that parenthesized substrings from
|
||||||
# the pattern can be interpolated as $1, $2 and so on.
|
# the pattern can be interpolated as $1, $2 and so on.
|
||||||
#
|
#
|
||||||
# CONFIGURATION PARAMETERS
|
# CONFIGURATION PARAMETERS
|
||||||
# The following main.cf parameters are especially relevant
|
# The following main.cf parameters are especially relevant
|
||||||
# to this topic. See the Postfix main.cf file for syntax
|
# to this topic. See the Postfix main.cf file for syntax
|
||||||
# details and for default values. Use the postfix reload
|
# details and for default values. Use the postfix reload
|
||||||
# command after a configuration change.
|
# command after a configuration change.
|
||||||
#
|
#
|
||||||
# parent_domain_matches_subdomains
|
# parent_domain_matches_subdomains
|
||||||
# List of Postfix features that use domain.tld pat-
|
# List of Postfix features that use domain.tld pat-
|
||||||
# terns to match sub.domain.tld (as opposed to
|
# terns to match sub.domain.tld (as opposed to
|
||||||
# requiring .domain.tld patterns).
|
# requiring .domain.tld patterns).
|
||||||
#
|
#
|
||||||
# transport_maps
|
# transport_maps
|
||||||
@@ -171,13 +185,13 @@
|
|||||||
# Other parameters of interest:
|
# Other parameters of interest:
|
||||||
#
|
#
|
||||||
# local_transport
|
# local_transport
|
||||||
# The mail delivery transport to use when no trans-
|
# The mail delivery transport to use when no trans-
|
||||||
# port is explicitly specified, and the destination
|
# port is explicitly specified, and the destination
|
||||||
# matches $mydestination.
|
# matches $mydestination.
|
||||||
#
|
#
|
||||||
# default_transport
|
# default_transport
|
||||||
# The mail delivery transport to use when no trans-
|
# The mail delivery transport to use when no trans-
|
||||||
# port is explicitly specified, and the destination
|
# port is explicitly specified, and the destination
|
||||||
# does not match $mydestination.
|
# does not match $mydestination.
|
||||||
#
|
#
|
||||||
# mydestination
|
# mydestination
|
||||||
@@ -195,7 +209,7 @@
|
|||||||
# regexp_table(5) format of POSIX regular expression tables
|
# regexp_table(5) format of POSIX regular expression tables
|
||||||
#
|
#
|
||||||
# LICENSE
|
# LICENSE
|
||||||
# The Secure Mailer license must be distributed with this
|
# The Secure Mailer license must be distributed with this
|
||||||
# software.
|
# software.
|
||||||
#
|
#
|
||||||
# AUTHOR(S)
|
# AUTHOR(S)
|
||||||
|
@@ -118,8 +118,7 @@ machine. The default is to receive mail for the machine itself.
|
|||||||
You can specify zero or more domain names, <i>/file/name</i> patterns
|
You can specify zero or more domain names, <i>/file/name</i> patterns
|
||||||
and/or <i>type:name</i> lookup tables, separated by whitespace
|
and/or <i>type:name</i> lookup tables, separated by whitespace
|
||||||
and/or commas. A <i>/file/name</i> is replaced by its contents;
|
and/or commas. A <i>/file/name</i> is replaced by its contents;
|
||||||
<i>type:name</i> requests that a table lookup is done, typically
|
<i>type:name</i> requests that a table lookup is done.
|
||||||
from a <a href="rewrite.html#virtual">virtual</a> database.
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
|
@@ -9,7 +9,7 @@ TRANSPORT(5) TRANSPORT(5)
|
|||||||
|
|
||||||
<b>DESCRIPTION</b>
|
<b>DESCRIPTION</b>
|
||||||
The optional <b>transport</b> table specifies a mapping from
|
The optional <b>transport</b> table specifies a mapping from
|
||||||
domain hierarchies to message delivery transports and/or
|
email addresses to message delivery transports and/or
|
||||||
relay hosts. The mapping is used by the <a href="trivial-rewrite.8.html"><b>trivial-rewrite</b>(8)</a>
|
relay hosts. The mapping is used by the <a href="trivial-rewrite.8.html"><b>trivial-rewrite</b>(8)</a>
|
||||||
daemon.
|
daemon.
|
||||||
|
|
||||||
@@ -27,143 +27,157 @@ TRANSPORT(5) TRANSPORT(5)
|
|||||||
Alternatively, the table can be provided as a regular-
|
Alternatively, the table can be provided as a regular-
|
||||||
expression map where patterns are given as regular expres-
|
expression map where patterns are given as regular expres-
|
||||||
sions. In that case, the lookups are done in a slightly
|
sions. In that case, the lookups are done in a slightly
|
||||||
different way as described below.
|
different way as described in the section titled "REGULAR
|
||||||
|
EXPRESSION TABLES".
|
||||||
|
|
||||||
<b>TABLE</b> <b>FORMAT</b>
|
<b>TABLE</b> <b>FORMAT</b>
|
||||||
The format of the transport table is as follows:
|
The format of the transport table is as follows:
|
||||||
|
|
||||||
<i>pattern</i> <i>result</i>
|
<i>pattern</i> <i>result</i>
|
||||||
When <i>pattern</i> matches the domain, use the corre-
|
When <i>pattern</i> matches the domain, use the corre-
|
||||||
sponding <i>result</i>.
|
sponding <i>result</i>.
|
||||||
|
|
||||||
blank lines and comments
|
blank lines and comments
|
||||||
Empty lines and whitespace-only lines are ignored,
|
Empty lines and whitespace-only lines are ignored,
|
||||||
as are lines whose first non-whitespace character
|
as are lines whose first non-whitespace character
|
||||||
is a `#'.
|
is a `#'.
|
||||||
|
|
||||||
multi-line text
|
multi-line text
|
||||||
A logical line starts with non-whitespace text. A
|
A logical line starts with non-whitespace text. A
|
||||||
line that starts with whitespace continues a logi-
|
line that starts with whitespace continues a logi-
|
||||||
cal line.
|
cal line.
|
||||||
|
|
||||||
In an indexed file, a pattern of `<b>*</b>' matches everything.
|
In an indexed file, a pattern of `<b>*</b>' matches everything.
|
||||||
|
|
||||||
The <i>result</i> is of the form <i>transport</i><b>:</b><i>nexthop</i>. The <i>trans-</i>
|
The <i>result</i> is of the form <i>transport</i><b>:</b><i>nexthop</i>. The <i>trans-</i>
|
||||||
<i>port</i> field specifies a mail delivery transport such as
|
<i>port</i> field specifies a mail delivery transport such as
|
||||||
<b>smtp</b> or <b>local</b>. The <i>nexthop</i> field specifies where and how
|
<b>smtp</b> or <b>local</b>. The <i>nexthop</i> field specifies where and how
|
||||||
to deliver mail. A null <i>transport</i> or <i>nexthop</i> field means
|
to deliver mail. A null <i>transport</i> or <i>nexthop</i> field means
|
||||||
"do not change": use the delivery transport and nexthop
|
"do not change": use the delivery transport and nexthop
|
||||||
information that would be used if no match were found.
|
information that would be used if no match were found.
|
||||||
|
|
||||||
The interpretation of the <i>nexthop</i> field is transport
|
The interpretation of the <i>nexthop</i> field is transport
|
||||||
dependent. In the case of SMTP, specify <i>host</i>:<i>service</i> for a
|
dependent. In the case of SMTP, specify <i>host</i>:<i>service</i> for a
|
||||||
non-default server port, and use [<i>host</i>] or [<i>host</i>]:<i>port</i> in
|
non-default server port, and use [<i>host</i>] or [<i>host</i>]:<i>port</i> in
|
||||||
order to disable MX (mail exchanger) DNS lookups. The []
|
order to disable MX (mail exchanger) DNS lookups. The []
|
||||||
form can also be used with IP addresses instead of host-
|
form can also be used with IP addresses instead of host-
|
||||||
names.
|
names.
|
||||||
|
|
||||||
With lookups from indexed files such as DB or DBM, or from
|
With lookups from indexed files such as DB or DBM, or from
|
||||||
networked tables such as NIS, LDAP or SQL, patterns are
|
networked tables such as NIS, LDAP or SQL, patterns are
|
||||||
tried in the order as listed below:
|
tried in the order as listed below:
|
||||||
|
|
||||||
|
<i>user+extension@domain</i> <i>transport</i>:<i>nexthop</i>
|
||||||
|
Mail for <i>user+extension@domain</i> is delivered through
|
||||||
|
<i>transport</i> to <i>nexthop</i>.
|
||||||
|
|
||||||
|
<i>user@domain</i> <i>transport</i>:<i>nexthop</i>
|
||||||
|
Mail for <i>user@domain</i> is delivered through <i>transport</i>
|
||||||
|
to <i>nexthop</i>.
|
||||||
|
|
||||||
<i>domain</i> <i>transport</i>:<i>nexthop</i>
|
<i>domain</i> <i>transport</i>:<i>nexthop</i>
|
||||||
Mail for <i>domain</i> is delivered through <i>transport</i> to
|
Mail for <i>domain</i> is delivered through <i>transport</i> to
|
||||||
<i>nexthop</i>.
|
<i>nexthop</i>.
|
||||||
|
|
||||||
<i>.domain</i> <i>transport</i>:<i>nexthop</i>
|
<i>.domain</i> <i>transport</i>:<i>nexthop</i>
|
||||||
Mail for any subdomain of <i>domain</i> is delivered
|
Mail for any subdomain of <i>domain</i> is delivered
|
||||||
through <i>transport</i> to <i>nexthop</i>. This applies only
|
through <i>transport</i> to <i>nexthop</i>. This applies only
|
||||||
when the string <b>transport</b><i>_</i><b>maps</b> is not listed in the
|
when the string <b>transport</b><i>_</i><b>maps</b> is not listed in the
|
||||||
<b>parent</b><i>_</i><b>domain</b><i>_</i><b>matches</b><i>_</i><b>subdomains</b> configuration set-
|
<b>parent</b><i>_</i><b>domain</b><i>_</i><b>matches</b><i>_</i><b>subdomains</b> configuration set-
|
||||||
ting. Otherwise, a domain name matches itself and
|
ting. Otherwise, a domain name matches itself and
|
||||||
its subdomains.
|
its subdomains.
|
||||||
|
|
||||||
|
<b>NOTE</b>
|
||||||
|
The special pattern <> represents the null address, and
|
||||||
|
the special pattern <b>*</b> represents any address (i.e. it
|
||||||
|
functions as the wild-card pattern).
|
||||||
|
|
||||||
<b>EXAMPLES</b>
|
<b>EXAMPLES</b>
|
||||||
In order to deliver internal mail directly, while using a
|
In order to deliver internal mail directly, while using a
|
||||||
mail relay for all other mail, specify a null entry for
|
mail relay for all other mail, specify a null entry for
|
||||||
internal destinations (do not change the delivery trans-
|
internal destinations (do not change the delivery trans-
|
||||||
port or the nexthop information) and specify a wildcard
|
port or the nexthop information) and specify a wildcard
|
||||||
for all other destinations. Note that for this trick to
|
for all other destinations. Note that for this trick to
|
||||||
work you should not specify a <b>relayhost</b> in the <b>main.cf</b>
|
work you should not specify a <b>relayhost</b> in the <b>main.cf</b>
|
||||||
file.
|
file.
|
||||||
|
|
||||||
<b>my.domain</b> <b>:</b>
|
<b>my.domain</b> <b>:</b>
|
||||||
<b>.my.domain</b> <b>:</b>
|
<b>.my.domain</b> <b>:</b>
|
||||||
<b>*</b> <b>smtp:outbound-relay.my.domain</b>
|
<b>*</b> <b>smtp:outbound-relay.my.domain</b>
|
||||||
|
|
||||||
In order to send mail for <b>foo.org</b> and its subdomains via
|
In order to send mail for <b>foo.org</b> and its subdomains via
|
||||||
the <b>uucp</b> transport to the UUCP host named <b>foo</b>:
|
the <b>uucp</b> transport to the UUCP host named <b>foo</b>:
|
||||||
|
|
||||||
<b>foo.org</b> <b>uucp:foo</b>
|
<b>foo.org</b> <b>uucp:foo</b>
|
||||||
<b>.foo.org</b> <b>uucp:foo</b>
|
<b>.foo.org</b> <b>uucp:foo</b>
|
||||||
|
|
||||||
When no <i>nexthop</i> host name is specified, the destination
|
When no <i>nexthop</i> host name is specified, the destination
|
||||||
domain name is used instead. For example, the following
|
domain name is used instead. For example, the following
|
||||||
directs mail for <i>user</i>@<b>foo.org</b> via the <b>slow</b> transport to a
|
directs mail for <i>user</i>@<b>foo.org</b> via the <b>slow</b> transport to a
|
||||||
mail exchanger for <b>foo.org</b>. The <b>slow</b> transport could be
|
mail exchanger for <b>foo.org</b>. The <b>slow</b> transport could be
|
||||||
something that runs at most one delivery process at a
|
something that runs at most one delivery process at a
|
||||||
time:
|
time:
|
||||||
|
|
||||||
<b>foo.org</b> <b>slow:</b>
|
<b>foo.org</b> <b>slow:</b>
|
||||||
|
|
||||||
When no <i>transport</i> is specified, Postfix uses either
|
When no <i>transport</i> is specified, Postfix uses either
|
||||||
<b>$local</b><i>_</i><b>transport</b> or <b>$default</b><i>_</i><b>transport</b>, depending on
|
<b>$local</b><i>_</i><b>transport</b> or <b>$default</b><i>_</i><b>transport</b>, depending on
|
||||||
whether the destination matches <b>$mydestination</b>. The fol-
|
whether the destination matches <b>$mydestination</b>. The fol-
|
||||||
lowing sends all mail for <b>foo.org</b> and its subdomains to
|
lowing sends all mail for <b>foo.org</b> and its subdomains to
|
||||||
host <b>gateway.foo.org</b>:
|
host <b>gateway.foo.org</b>:
|
||||||
|
|
||||||
<b>foo.org</b> <b>:[gateway.foo.org]</b>
|
<b>foo.org</b> <b>:[gateway.foo.org]</b>
|
||||||
<b>.foo.org</b> <b>:[gateway.foo.org]</b>
|
<b>.foo.org</b> <b>:[gateway.foo.org]</b>
|
||||||
|
|
||||||
In the above example, the [] are used to suppress MX
|
In the above example, the [] are used to suppress MX
|
||||||
lookups. The result would likely point to your local
|
lookups. The result would likely point to your local
|
||||||
machine.
|
machine.
|
||||||
|
|
||||||
In the case of delivery via SMTP, one may specify <i>host-</i>
|
In the case of delivery via SMTP, one may specify <i>host-</i>
|
||||||
<i>name</i>:<i>service</i> instead of just a host:
|
<i>name</i>:<i>service</i> instead of just a host:
|
||||||
|
|
||||||
<b>foo.org</b> <b>smtp:bar.org:2025</b>
|
<b>foo.org</b> <b>smtp:bar.org:2025</b>
|
||||||
|
|
||||||
This directs mail for <i>user</i>@<b>foo.org</b> to host <b>bar.org</b> port
|
This directs mail for <i>user</i>@<b>foo.org</b> to host <b>bar.org</b> port
|
||||||
<b>2025</b>. Instead of a numerical port a symbolic name may be
|
<b>2025</b>. Instead of a numerical port a symbolic name may be
|
||||||
used. Specify [] around the hostname in order to disable
|
used. Specify [] around the hostname in order to disable
|
||||||
MX lookups.
|
MX lookups.
|
||||||
|
|
||||||
The error mailer can be used to bounce mail:
|
The error mailer can be used to bounce mail:
|
||||||
|
|
||||||
<b>.foo.org</b> <b>error:mail</b> <b>for</b> <b>*.foo.org</b> <b>is</b> <b>not</b> <b>deliv-</b>
|
<b>.foo.org</b> <b>error:mail</b> <b>for</b> <b>*.foo.org</b> <b>is</b> <b>not</b> <b>deliv-</b>
|
||||||
<b>erable</b>
|
<b>erable</b>
|
||||||
|
|
||||||
This causes all mail for <i>user</i>@<i>anything</i><b>.foo.org</b> to be
|
This causes all mail for <i>user</i>@<i>anything</i><b>.foo.org</b> to be
|
||||||
bounced.
|
bounced.
|
||||||
|
|
||||||
<b>REGULAR</b> <b>EXPRESSION</b> <b>TABLES</b>
|
<b>REGULAR</b> <b>EXPRESSION</b> <b>TABLES</b>
|
||||||
This section describes how the table lookups change when
|
This section describes how the table lookups change when
|
||||||
the table is given in the form of regular expressions. For
|
the table is given in the form of regular expressions. For
|
||||||
a description of regular expression lookup table syntax,
|
a description of regular expression lookup table syntax,
|
||||||
see <a href="regexp_table.5.html"><b>regexp</b><i>_</i><b>table</b>(5)</a> or <a href="pcre_table.5.html"><b>pcre</b><i>_</i><b>table</b>(5)</a>.
|
see <a href="regexp_table.5.html"><b>regexp</b><i>_</i><b>table</b>(5)</a> or <a href="pcre_table.5.html"><b>pcre</b><i>_</i><b>table</b>(5)</a>.
|
||||||
|
|
||||||
Each pattern is a regular expression that is applied to
|
Each pattern is a regular expression that is applied to
|
||||||
the entire domain being looked up. Thus, <i>some.domain.hier-</i>
|
the entire domain being looked up. Thus, <i>some.domain.hier-</i>
|
||||||
<i>archy</i> is not broken up into parent domains.
|
<i>archy</i> is not broken up into parent domains.
|
||||||
|
|
||||||
Patterns are applied in the order as specified in the
|
Patterns are applied in the order as specified in the
|
||||||
table, until a pattern is found that matches the search
|
table, until a pattern is found that matches the search
|
||||||
string.
|
string.
|
||||||
|
|
||||||
Results are the same as with indexed file lookups, with
|
Results are the same as with indexed file lookups, with
|
||||||
the additional feature that parenthesized substrings from
|
the additional feature that parenthesized substrings from
|
||||||
the pattern can be interpolated as <b>$1</b>, <b>$2</b> and so on.
|
the pattern can be interpolated as <b>$1</b>, <b>$2</b> and so on.
|
||||||
|
|
||||||
<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
|
||||||
to this topic. See the Postfix <b>main.cf</b> file for syntax
|
to this topic. See the Postfix <b>main.cf</b> file for syntax
|
||||||
details and for default values. Use the <b>postfix</b> <b>reload</b>
|
details and for default values. Use the <b>postfix</b> <b>reload</b>
|
||||||
command after a configuration change.
|
command after a configuration change.
|
||||||
|
|
||||||
<b>parent</b><i>_</i><b>domain</b><i>_</i><b>matches</b><i>_</i><b>subdomains</b>
|
<b>parent</b><i>_</i><b>domain</b><i>_</i><b>matches</b><i>_</i><b>subdomains</b>
|
||||||
List of Postfix features that use <i>domain.tld</i> pat-
|
List of Postfix features that use <i>domain.tld</i> pat-
|
||||||
terns to match <i>sub.domain.tld</i> (as opposed to
|
terns to match <i>sub.domain.tld</i> (as opposed to
|
||||||
requiring <i>.domain.tld</i> patterns).
|
requiring <i>.domain.tld</i> patterns).
|
||||||
|
|
||||||
<b>transport</b><i>_</i><b>maps</b>
|
<b>transport</b><i>_</i><b>maps</b>
|
||||||
@@ -172,13 +186,13 @@ TRANSPORT(5) TRANSPORT(5)
|
|||||||
Other parameters of interest:
|
Other parameters of interest:
|
||||||
|
|
||||||
<b>local</b><i>_</i><b>transport</b>
|
<b>local</b><i>_</i><b>transport</b>
|
||||||
The mail delivery transport to use when no trans-
|
The mail delivery transport to use when no trans-
|
||||||
port is explicitly specified, and the destination
|
port is explicitly specified, and the destination
|
||||||
matches <b>$mydestination</b>.
|
matches <b>$mydestination</b>.
|
||||||
|
|
||||||
<b>default</b><i>_</i><b>transport</b>
|
<b>default</b><i>_</i><b>transport</b>
|
||||||
The mail delivery transport to use when no trans-
|
The mail delivery transport to use when no trans-
|
||||||
port is explicitly specified, and the destination
|
port is explicitly specified, and the destination
|
||||||
does not match <b>$mydestination</b>.
|
does not match <b>$mydestination</b>.
|
||||||
|
|
||||||
<b>mydestination</b>
|
<b>mydestination</b>
|
||||||
@@ -196,7 +210,7 @@ TRANSPORT(5) TRANSPORT(5)
|
|||||||
<a href="regexp_table.5.html">regexp_table(5)</a> format of POSIX regular expression tables
|
<a href="regexp_table.5.html">regexp_table(5)</a> format of POSIX regular expression tables
|
||||||
|
|
||||||
<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>
|
||||||
|
@@ -133,6 +133,9 @@ TRIVIAL-REWRITE(8) TRIVIAL-REWRITE(8)
|
|||||||
List of tables with <i>domain</i> to (<i>transport,</i> <i>nexthop</i>)
|
List of tables with <i>domain</i> to (<i>transport,</i> <i>nexthop</i>)
|
||||||
mappings.
|
mappings.
|
||||||
|
|
||||||
|
<b>transport</b><i>_</i><b>null</b><i>_</i><b>address</b><i>_</i><b>lookup</b><i>_</i><b>key</b>
|
||||||
|
Lookup key to be used for the null address.
|
||||||
|
|
||||||
<b>SEE</b> <b>ALSO</b>
|
<b>SEE</b> <b>ALSO</b>
|
||||||
<a href="master.8.html">master(8)</a> process manager
|
<a href="master.8.html">master(8)</a> process manager
|
||||||
syslogd(8) system logging
|
syslogd(8) system logging
|
||||||
|
@@ -12,8 +12,8 @@ format of Postfix transport table
|
|||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.ad
|
.ad
|
||||||
.fi
|
.fi
|
||||||
The optional \fBtransport\fR table specifies a mapping from domain
|
The optional \fBtransport\fR table specifies a mapping from email
|
||||||
hierarchies to message delivery transports and/or relay hosts. The
|
addresses to message delivery transports and/or relay hosts. The
|
||||||
mapping is used by the \fBtrivial-rewrite\fR(8) daemon.
|
mapping is used by the \fBtrivial-rewrite\fR(8) daemon.
|
||||||
|
|
||||||
Normally, the \fBtransport\fR table is specified as a text file
|
Normally, the \fBtransport\fR table is specified as a text file
|
||||||
@@ -28,7 +28,8 @@ or SQL, the same lookups are done as for ordinary indexed files.
|
|||||||
|
|
||||||
Alternatively, the table can be provided as a regular-expression
|
Alternatively, the table can be provided as a regular-expression
|
||||||
map where patterns are given as regular expressions. In that case,
|
map where patterns are given as regular expressions. In that case,
|
||||||
the lookups are done in a slightly different way as described below.
|
the lookups are done in a slightly different way as described
|
||||||
|
in the section titled "REGULAR EXPRESSION TABLES".
|
||||||
.SH TABLE FORMAT
|
.SH TABLE FORMAT
|
||||||
.na
|
.na
|
||||||
.nf
|
.nf
|
||||||
@@ -64,6 +65,13 @@ can also be used with IP addresses instead of hostnames.
|
|||||||
With lookups from indexed files such as DB or DBM, or from networked
|
With lookups from indexed files such as DB or DBM, or from networked
|
||||||
tables such as NIS, LDAP or SQL, patterns are tried in the order as
|
tables such as NIS, LDAP or SQL, patterns are tried in the order as
|
||||||
listed below:
|
listed below:
|
||||||
|
.IP "\fIuser+extension@domain transport\fR:\fInexthop\fR"
|
||||||
|
Mail for \fIuser+extension@domain\fR is delivered through
|
||||||
|
\fItransport\fR to
|
||||||
|
\fInexthop\fR.
|
||||||
|
.IP "\fIuser@domain transport\fR:\fInexthop\fR"
|
||||||
|
Mail for \fIuser@domain\fR is delivered through \fItransport\fR to
|
||||||
|
\fInexthop\fR.
|
||||||
.IP "\fIdomain transport\fR:\fInexthop\fR"
|
.IP "\fIdomain transport\fR:\fInexthop\fR"
|
||||||
Mail for \fIdomain\fR is delivered through \fItransport\fR to
|
Mail for \fIdomain\fR is delivered through \fItransport\fR to
|
||||||
\fInexthop\fR.
|
\fInexthop\fR.
|
||||||
@@ -73,6 +81,15 @@ Mail for any subdomain of \fIdomain\fR is delivered through
|
|||||||
string \fBtransport_maps\fR is not listed in the
|
string \fBtransport_maps\fR is not listed in the
|
||||||
\fBparent_domain_matches_subdomains\fR configuration setting.
|
\fBparent_domain_matches_subdomains\fR configuration setting.
|
||||||
Otherwise, a domain name matches itself and its subdomains.
|
Otherwise, a domain name matches itself and its subdomains.
|
||||||
|
.PP
|
||||||
|
.SH NOTE
|
||||||
|
.na
|
||||||
|
.nf
|
||||||
|
.ad
|
||||||
|
.fi
|
||||||
|
The special pattern \fB<>\fR represents the null address, and the
|
||||||
|
special pattern \fB*\fR represents any address (i.e. it functions
|
||||||
|
as the wild-card pattern).
|
||||||
.SH EXAMPLES
|
.SH EXAMPLES
|
||||||
.na
|
.na
|
||||||
.nf
|
.nf
|
||||||
|
@@ -127,6 +127,8 @@ to the destination's mail exchanger.
|
|||||||
.IP \fBtransport_maps\fR
|
.IP \fBtransport_maps\fR
|
||||||
List of tables with \fIdomain\fR to (\fItransport, nexthop\fR)
|
List of tables with \fIdomain\fR to (\fItransport, nexthop\fR)
|
||||||
mappings.
|
mappings.
|
||||||
|
.IP \fBtransport_null_address_lookup_key\fR
|
||||||
|
Lookup key to be used for the null address.
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.na
|
.na
|
||||||
.nf
|
.nf
|
||||||
|
@@ -6,8 +6,8 @@
|
|||||||
# SYNOPSIS
|
# SYNOPSIS
|
||||||
# \fBpostmap /etc/postfix/transport\fR
|
# \fBpostmap /etc/postfix/transport\fR
|
||||||
# DESCRIPTION
|
# DESCRIPTION
|
||||||
# The optional \fBtransport\fR table specifies a mapping from domain
|
# The optional \fBtransport\fR table specifies a mapping from email
|
||||||
# hierarchies to message delivery transports and/or relay hosts. The
|
# addresses to message delivery transports and/or relay hosts. The
|
||||||
# mapping is used by the \fBtrivial-rewrite\fR(8) daemon.
|
# mapping is used by the \fBtrivial-rewrite\fR(8) daemon.
|
||||||
#
|
#
|
||||||
# Normally, the \fBtransport\fR table is specified as a text file
|
# Normally, the \fBtransport\fR table is specified as a text file
|
||||||
@@ -22,7 +22,8 @@
|
|||||||
#
|
#
|
||||||
# Alternatively, the table can be provided as a regular-expression
|
# Alternatively, the table can be provided as a regular-expression
|
||||||
# map where patterns are given as regular expressions. In that case,
|
# map where patterns are given as regular expressions. In that case,
|
||||||
# the lookups are done in a slightly different way as described below.
|
# the lookups are done in a slightly different way as described
|
||||||
|
# in the section titled "REGULAR EXPRESSION TABLES".
|
||||||
# TABLE FORMAT
|
# TABLE FORMAT
|
||||||
# .ad
|
# .ad
|
||||||
# .fi
|
# .fi
|
||||||
@@ -56,6 +57,13 @@
|
|||||||
# With lookups from indexed files such as DB or DBM, or from networked
|
# With lookups from indexed files such as DB or DBM, or from networked
|
||||||
# tables such as NIS, LDAP or SQL, patterns are tried in the order as
|
# tables such as NIS, LDAP or SQL, patterns are tried in the order as
|
||||||
# listed below:
|
# listed below:
|
||||||
|
# .IP "\fIuser+extension@domain transport\fR:\fInexthop\fR"
|
||||||
|
# Mail for \fIuser+extension@domain\fR is delivered through
|
||||||
|
# \fItransport\fR to
|
||||||
|
# \fInexthop\fR.
|
||||||
|
# .IP "\fIuser@domain transport\fR:\fInexthop\fR"
|
||||||
|
# Mail for \fIuser@domain\fR is delivered through \fItransport\fR to
|
||||||
|
# \fInexthop\fR.
|
||||||
# .IP "\fIdomain transport\fR:\fInexthop\fR"
|
# .IP "\fIdomain transport\fR:\fInexthop\fR"
|
||||||
# Mail for \fIdomain\fR is delivered through \fItransport\fR to
|
# Mail for \fIdomain\fR is delivered through \fItransport\fR to
|
||||||
# \fInexthop\fR.
|
# \fInexthop\fR.
|
||||||
@@ -65,6 +73,13 @@
|
|||||||
# string \fBtransport_maps\fR is not listed in the
|
# string \fBtransport_maps\fR is not listed in the
|
||||||
# \fBparent_domain_matches_subdomains\fR configuration setting.
|
# \fBparent_domain_matches_subdomains\fR configuration setting.
|
||||||
# Otherwise, a domain name matches itself and its subdomains.
|
# Otherwise, a domain name matches itself and its subdomains.
|
||||||
|
# .PP
|
||||||
|
# NOTE
|
||||||
|
# .ad
|
||||||
|
# .fi
|
||||||
|
# The special pattern \fB<>\fR represents the null address, and the
|
||||||
|
# special pattern \fB*\fR represents any address (i.e. it functions
|
||||||
|
# as the wild-card pattern).
|
||||||
# EXAMPLES
|
# EXAMPLES
|
||||||
# .ad
|
# .ad
|
||||||
# .fi
|
# .fi
|
||||||
|
@@ -25,6 +25,8 @@ Makefile: Makefile.in
|
|||||||
|
|
||||||
test: $(TESTPROG)
|
test: $(TESTPROG)
|
||||||
|
|
||||||
|
tests: test
|
||||||
|
|
||||||
update: ../../libexec/$(PROG)
|
update: ../../libexec/$(PROG)
|
||||||
|
|
||||||
../../libexec/$(PROG): $(PROG)
|
../../libexec/$(PROG): $(PROG)
|
||||||
|
@@ -29,6 +29,8 @@ Makefile: Makefile.in
|
|||||||
|
|
||||||
test: $(TESTPROG)
|
test: $(TESTPROG)
|
||||||
|
|
||||||
|
tests: test
|
||||||
|
|
||||||
update: ../../libexec/$(PROG)
|
update: ../../libexec/$(PROG)
|
||||||
|
|
||||||
../../libexec/$(PROG): $(PROG)
|
../../libexec/$(PROG): $(PROG)
|
||||||
|
@@ -142,12 +142,10 @@ void cleanup_map11_tree(CLEANUP_STATE *state, TOK822 *tree,
|
|||||||
* checking in one place, instead of having error handling code all over
|
* checking in one place, instead of having error handling code all over
|
||||||
* the place.
|
* the place.
|
||||||
*/
|
*/
|
||||||
#define NO_TOKEN_LIMIT 0
|
|
||||||
|
|
||||||
tok822_externalize(temp, tree->head, TOK822_STR_DEFL);
|
tok822_externalize(temp, tree->head, TOK822_STR_DEFL);
|
||||||
cleanup_map11_external(state, temp, maps, propagate);
|
cleanup_map11_external(state, temp, maps, propagate);
|
||||||
tok822_free_tree(tree->head);
|
tok822_free_tree(tree->head);
|
||||||
tree->head = tok822_scan(STR(temp), &tree->tail, NO_TOKEN_LIMIT);
|
tree->head = tok822_scan(STR(temp), &tree->tail);
|
||||||
vstring_free(temp);
|
vstring_free(temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -151,12 +151,10 @@ void cleanup_masquerade_tree(TOK822 *tree, ARGV *masq_domains)
|
|||||||
{
|
{
|
||||||
VSTRING *temp = vstring_alloc(100);
|
VSTRING *temp = vstring_alloc(100);
|
||||||
|
|
||||||
#define NO_TOKEN_LIMIT 0
|
|
||||||
|
|
||||||
tok822_externalize(temp, tree->head, TOK822_STR_DEFL);
|
tok822_externalize(temp, tree->head, TOK822_STR_DEFL);
|
||||||
cleanup_masquerade_external(temp, masq_domains);
|
cleanup_masquerade_external(temp, masq_domains);
|
||||||
tok822_free_tree(tree->head);
|
tok822_free_tree(tree->head);
|
||||||
tree->head = tok822_scan(STR(temp), &tree->tail, NO_TOKEN_LIMIT);
|
tree->head = tok822_scan(STR(temp), &tree->tail);
|
||||||
|
|
||||||
vstring_free(temp);
|
vstring_free(temp);
|
||||||
}
|
}
|
||||||
|
@@ -170,8 +170,9 @@ static void cleanup_rewrite_sender(CLEANUP_STATE *state, HEADER_OPTS *hdr_opts,
|
|||||||
* sender addresses, and regenerate the header line. Finally, pipe the
|
* sender addresses, and regenerate the header line. Finally, pipe the
|
||||||
* result through the header line folding routine.
|
* result through the header line folding routine.
|
||||||
*/
|
*/
|
||||||
tree = tok822_parse(vstring_str(header_buf) + strlen(hdr_opts->name) + 1,
|
tree = tok822_parse_limit(vstring_str(header_buf)
|
||||||
var_token_limit);
|
+ strlen(hdr_opts->name) + 1,
|
||||||
|
var_token_limit);
|
||||||
addr_list = tok822_grep(tree, TOK822_ADDR);
|
addr_list = tok822_grep(tree, TOK822_ADDR);
|
||||||
for (tpp = addr_list; *tpp; tpp++) {
|
for (tpp = addr_list; *tpp; tpp++) {
|
||||||
cleanup_rewrite_tree(*tpp);
|
cleanup_rewrite_tree(*tpp);
|
||||||
@@ -222,8 +223,9 @@ static void cleanup_rewrite_recip(CLEANUP_STATE *state, HEADER_OPTS *hdr_opts,
|
|||||||
* recipient addresses, and regenerate the header line. Finally, pipe the
|
* recipient addresses, and regenerate the header line. Finally, pipe the
|
||||||
* result through the header line folding routine.
|
* result through the header line folding routine.
|
||||||
*/
|
*/
|
||||||
tree = tok822_parse(vstring_str(header_buf) + strlen(hdr_opts->name) + 1,
|
tree = tok822_parse_limit(vstring_str(header_buf)
|
||||||
var_token_limit);
|
+ strlen(hdr_opts->name) + 1,
|
||||||
|
var_token_limit);
|
||||||
addr_list = tok822_grep(tree, TOK822_ADDR);
|
addr_list = tok822_grep(tree, TOK822_ADDR);
|
||||||
for (tpp = addr_list; *tpp; tpp++) {
|
for (tpp = addr_list; *tpp; tpp++) {
|
||||||
cleanup_rewrite_tree(*tpp);
|
cleanup_rewrite_tree(*tpp);
|
||||||
@@ -501,8 +503,6 @@ static void cleanup_header_done_callback(void *context)
|
|||||||
/*
|
/*
|
||||||
* Add a missing (Resent-)From: header.
|
* Add a missing (Resent-)From: header.
|
||||||
*/
|
*/
|
||||||
#define NO_TOKEN_LIMIT 0
|
|
||||||
|
|
||||||
if ((state->headers_seen & (1 << (state->resent[0] ?
|
if ((state->headers_seen & (1 << (state->resent[0] ?
|
||||||
HDR_RESENT_FROM : HDR_FROM))) == 0) {
|
HDR_RESENT_FROM : HDR_FROM))) == 0) {
|
||||||
quote_822_local(state->temp1, *state->sender ?
|
quote_822_local(state->temp1, *state->sender ?
|
||||||
@@ -511,7 +511,7 @@ static void cleanup_header_done_callback(void *context)
|
|||||||
state->resent, vstring_str(state->temp1));
|
state->resent, vstring_str(state->temp1));
|
||||||
if (*state->sender && state->fullname && *state->fullname) {
|
if (*state->sender && state->fullname && *state->fullname) {
|
||||||
vstring_sprintf(state->temp1, "(%s)", state->fullname);
|
vstring_sprintf(state->temp1, "(%s)", state->fullname);
|
||||||
token = tok822_parse(vstring_str(state->temp1), NO_TOKEN_LIMIT);
|
token = tok822_parse(vstring_str(state->temp1));
|
||||||
vstring_strcat(state->temp2, " ");
|
vstring_strcat(state->temp2, " ");
|
||||||
tok822_externalize(state->temp2, token, TOK822_STR_NONE);
|
tok822_externalize(state->temp2, token, TOK822_STR_NONE);
|
||||||
tok822_free_tree(token);
|
tok822_free_tree(token);
|
||||||
|
@@ -80,12 +80,10 @@ void cleanup_rewrite_tree(TOK822 *tree)
|
|||||||
VSTRING *dst = vstring_alloc(100);
|
VSTRING *dst = vstring_alloc(100);
|
||||||
VSTRING *src = vstring_alloc(100);
|
VSTRING *src = vstring_alloc(100);
|
||||||
|
|
||||||
#define NO_TOKEN_LIMIT 0
|
|
||||||
|
|
||||||
tok822_externalize(src, tree->head, TOK822_STR_DEFL);
|
tok822_externalize(src, tree->head, TOK822_STR_DEFL);
|
||||||
cleanup_rewrite_external(dst, STR(src));
|
cleanup_rewrite_external(dst, STR(src));
|
||||||
tok822_free_tree(tree->head);
|
tok822_free_tree(tree->head);
|
||||||
tree->head = tok822_scan(STR(dst), &tree->tail, NO_TOKEN_LIMIT);
|
tree->head = tok822_scan(STR(dst), &tree->tail);
|
||||||
vstring_free(dst);
|
vstring_free(dst);
|
||||||
vstring_free(src);
|
vstring_free(src);
|
||||||
}
|
}
|
||||||
|
@@ -24,6 +24,8 @@ Makefile: Makefile.in
|
|||||||
|
|
||||||
test: $(TESTPROG)
|
test: $(TESTPROG)
|
||||||
|
|
||||||
|
tests: test
|
||||||
|
|
||||||
$(LIB): $(OBJS)
|
$(LIB): $(OBJS)
|
||||||
$(AR) $(ARFL) $(LIB) $?
|
$(AR) $(ARFL) $(LIB) $?
|
||||||
$(RANLIB) $(LIB)
|
$(RANLIB) $(LIB)
|
||||||
|
@@ -8,7 +8,7 @@ WARN = -W -Wformat -Wimplicit -Wmissing-prototypes \
|
|||||||
-Wunused
|
-Wunused
|
||||||
DEFS = -I. -I$(INC_DIR) -D$(SYSTYPE)
|
DEFS = -I. -I$(INC_DIR) -D$(SYSTYPE)
|
||||||
CFLAGS = $(DEBUG) $(OPT) $(DEFS)
|
CFLAGS = $(DEBUG) $(OPT) $(DEFS)
|
||||||
TESTPROG= quote_821_local error_unalias
|
TESTPROG=
|
||||||
PROG = error
|
PROG = error
|
||||||
INC_DIR = ../../include
|
INC_DIR = ../../include
|
||||||
LIBS = ../../lib/libmaster.a ../../lib/libglobal.a ../../lib/libutil.a
|
LIBS = ../../lib/libmaster.a ../../lib/libglobal.a ../../lib/libutil.a
|
||||||
@@ -23,6 +23,8 @@ Makefile: Makefile.in
|
|||||||
|
|
||||||
test: $(TESTPROG)
|
test: $(TESTPROG)
|
||||||
|
|
||||||
|
tests: test
|
||||||
|
|
||||||
update: ../../libexec/$(PROG)
|
update: ../../libexec/$(PROG)
|
||||||
|
|
||||||
../../libexec/$(PROG): $(PROG)
|
../../libexec/$(PROG): $(PROG)
|
||||||
|
@@ -23,6 +23,8 @@ Makefile: Makefile.in
|
|||||||
|
|
||||||
test: $(TESTPROG)
|
test: $(TESTPROG)
|
||||||
|
|
||||||
|
tests: test
|
||||||
|
|
||||||
update: ../../libexec/$(PROG)
|
update: ../../libexec/$(PROG)
|
||||||
|
|
||||||
../../libexec/$(PROG): $(PROG)
|
../../libexec/$(PROG): $(PROG)
|
||||||
|
@@ -19,7 +19,8 @@ SRCS = been_here.c bounce.c canon_addr.c cleanup_strerror.c clnt_stream.c \
|
|||||||
timed_ipc.c tok822_find.c tok822_node.c tok822_parse.c \
|
timed_ipc.c tok822_find.c tok822_node.c tok822_parse.c \
|
||||||
tok822_resolve.c tok822_rewrite.c tok822_tree.c xtext.c bounce_log.c \
|
tok822_resolve.c tok822_rewrite.c tok822_tree.c xtext.c bounce_log.c \
|
||||||
flush_clnt.c mail_conf_time.c mbox_conf.c mbox_open.c abounce.c \
|
flush_clnt.c mail_conf_time.c mbox_conf.c mbox_open.c abounce.c \
|
||||||
verp_sender.c match_parent_style.c mime_state.c header_token.c
|
verp_sender.c match_parent_style.c mime_state.c header_token.c \
|
||||||
|
strip_addr.c
|
||||||
OBJS = been_here.o bounce.o canon_addr.o cleanup_strerror.o clnt_stream.o \
|
OBJS = been_here.o bounce.o canon_addr.o cleanup_strerror.o clnt_stream.o \
|
||||||
debug_peer.o debug_process.o defer.o deliver_completed.o \
|
debug_peer.o debug_process.o defer.o deliver_completed.o \
|
||||||
deliver_flock.o deliver_pass.o deliver_request.o domain_list.o \
|
deliver_flock.o deliver_pass.o deliver_request.o domain_list.o \
|
||||||
@@ -40,7 +41,8 @@ OBJS = been_here.o bounce.o canon_addr.o cleanup_strerror.o clnt_stream.o \
|
|||||||
timed_ipc.o tok822_find.o tok822_node.o tok822_parse.o \
|
timed_ipc.o tok822_find.o tok822_node.o tok822_parse.o \
|
||||||
tok822_resolve.o tok822_rewrite.o tok822_tree.o xtext.o bounce_log.o \
|
tok822_resolve.o tok822_rewrite.o tok822_tree.o xtext.o bounce_log.o \
|
||||||
flush_clnt.o mail_conf_time.o mbox_conf.o mbox_open.o abounce.o \
|
flush_clnt.o mail_conf_time.o mbox_conf.o mbox_open.o abounce.o \
|
||||||
verp_sender.o match_parent_style.o mime_state.o header_token.o
|
verp_sender.o match_parent_style.o mime_state.o header_token.o \
|
||||||
|
strip_addr.o
|
||||||
HDRS = been_here.h bounce.h canon_addr.h cleanup_user.h clnt_stream.h \
|
HDRS = been_here.h bounce.h canon_addr.h cleanup_user.h clnt_stream.h \
|
||||||
config.h debug_peer.h debug_process.h defer.h deliver_completed.h \
|
config.h debug_peer.h debug_process.h defer.h deliver_completed.h \
|
||||||
deliver_flock.h deliver_pass.h deliver_request.h domain_list.h \
|
deliver_flock.h deliver_pass.h deliver_request.h domain_list.h \
|
||||||
@@ -58,7 +60,7 @@ HDRS = been_here.h bounce.h canon_addr.h cleanup_user.h clnt_stream.h \
|
|||||||
sys_exits.h timed_ipc.h tok822.h xtext.h bounce_log.h flush_clnt.h \
|
sys_exits.h timed_ipc.h tok822.h xtext.h bounce_log.h flush_clnt.h \
|
||||||
mbox_conf.h mbox_open.h abounce.h qmqp_proto.h verp_sender.h \
|
mbox_conf.h mbox_open.h abounce.h qmqp_proto.h verp_sender.h \
|
||||||
match_parent_style.h quote_flags.h mime_state.h header_token.h \
|
match_parent_style.h quote_flags.h mime_state.h header_token.h \
|
||||||
lex_822.h
|
lex_822.h strip_addr.h
|
||||||
TESTSRC = rec2stream.c stream2rec.c recdump.c
|
TESTSRC = rec2stream.c stream2rec.c recdump.c
|
||||||
WARN = -W -Wformat -Wimplicit -Wmissing-prototypes \
|
WARN = -W -Wformat -Wimplicit -Wmissing-prototypes \
|
||||||
-Wparentheses -Wstrict-prototypes -Wswitch -Wuninitialized \
|
-Wparentheses -Wstrict-prototypes -Wswitch -Wuninitialized \
|
||||||
@@ -71,7 +73,7 @@ TESTPROG= domain_list dot_lockfile mail_addr_crunch mail_addr_find \
|
|||||||
mail_addr_map mail_date maps mynetworks mypwd namadr_list \
|
mail_addr_map mail_date maps mynetworks mypwd namadr_list \
|
||||||
off_cvt quote_822_local rec2stream recdump resolve_clnt \
|
off_cvt quote_822_local rec2stream recdump resolve_clnt \
|
||||||
resolve_local rewrite_clnt stream2rec string_list tok822_parse \
|
resolve_local rewrite_clnt stream2rec string_list tok822_parse \
|
||||||
quote_821_local mail_conf_time mime_state
|
quote_821_local mail_conf_time mime_state strip_addr
|
||||||
|
|
||||||
LIBS = ../../lib/libutil.a
|
LIBS = ../../lib/libutil.a
|
||||||
LIB_DIR = ../../lib
|
LIB_DIR = ../../lib
|
||||||
@@ -219,7 +221,13 @@ mime_state: $(LIB) $(LIBS)
|
|||||||
$(CC) -DTEST $(CFLAGS) -o $@ $@.c $(LIB) $(LIBS) $(SYSLIBS)
|
$(CC) -DTEST $(CFLAGS) -o $@ $@.c $(LIB) $(LIBS) $(SYSLIBS)
|
||||||
mv junk $@.o
|
mv junk $@.o
|
||||||
|
|
||||||
tests: tok822_test mime_test mime_nest mime_8bit mime_dom mime_trunc
|
strip_addr: $(LIB) $(LIBS)
|
||||||
|
mv $@.o junk
|
||||||
|
$(CC) -DTEST $(CFLAGS) -o $@ $@.c $(LIB) $(LIBS) $(SYSLIBS)
|
||||||
|
mv junk $@.o
|
||||||
|
|
||||||
|
tests: tok822_test mime_test mime_nest mime_8bit mime_dom mime_trunc \
|
||||||
|
strip_addr_test tok822_limit_test
|
||||||
|
|
||||||
tok822_test: tok822_parse tok822_parse.in tok822_parse.ref
|
tok822_test: tok822_parse tok822_parse.in tok822_parse.ref
|
||||||
./tok822_parse <tok822_parse.in >tok822_parse.tmp
|
./tok822_parse <tok822_parse.in >tok822_parse.tmp
|
||||||
@@ -251,6 +259,11 @@ mime_trunc: mime_state mime_trunc.in mime_trunc.ref
|
|||||||
diff mime_trunc.ref mime_trunc.tmp
|
diff mime_trunc.ref mime_trunc.tmp
|
||||||
rm -f mime_trunc.tmp
|
rm -f mime_trunc.tmp
|
||||||
|
|
||||||
|
tok822_limit_test: tok822_parse tok822_limit.in tok822_limit.ref
|
||||||
|
./tok822_parse <tok822_limit.in >tok822_limit.tmp
|
||||||
|
diff tok822_limit.ref tok822_limit.tmp
|
||||||
|
rm -f tok822_limit.tmp
|
||||||
|
|
||||||
printfck: $(OBJS) $(PROG)
|
printfck: $(OBJS) $(PROG)
|
||||||
rm -rf printfck
|
rm -rf printfck
|
||||||
mkdir printfck
|
mkdir printfck
|
||||||
@@ -259,6 +272,10 @@ printfck: $(OBJS) $(PROG)
|
|||||||
set -e; for i in *.c; do printfck -f .printfck $$i >printfck/$$i; done
|
set -e; for i in *.c; do printfck -f .printfck $$i >printfck/$$i; done
|
||||||
cd printfck; make "INC_DIR=../../../include" `cd ..; ls *.o`
|
cd printfck; make "INC_DIR=../../../include" `cd ..; ls *.o`
|
||||||
|
|
||||||
|
strip_addr_test: strip_addr strip_addr.ref
|
||||||
|
./strip_addr 2>strip_addr.tmp
|
||||||
|
diff strip_addr.ref strip_addr.tmp
|
||||||
|
rm -f strip_addr.tmp
|
||||||
lint:
|
lint:
|
||||||
lint $(DEFS) $(SRCS) $(LINTFIX)
|
lint $(DEFS) $(SRCS) $(LINTFIX)
|
||||||
|
|
||||||
@@ -512,7 +529,7 @@ mail_addr_find.o: ../../include/stringops.h
|
|||||||
mail_addr_find.o: ../../include/vstring.h
|
mail_addr_find.o: ../../include/vstring.h
|
||||||
mail_addr_find.o: ../../include/mymalloc.h
|
mail_addr_find.o: ../../include/mymalloc.h
|
||||||
mail_addr_find.o: mail_params.h
|
mail_addr_find.o: mail_params.h
|
||||||
mail_addr_find.o: split_addr.h
|
mail_addr_find.o: strip_addr.h
|
||||||
mail_addr_find.o: mail_addr_find.h
|
mail_addr_find.o: mail_addr_find.h
|
||||||
mail_addr_find.o: maps.h
|
mail_addr_find.o: maps.h
|
||||||
mail_addr_find.o: resolve_local.h
|
mail_addr_find.o: resolve_local.h
|
||||||
@@ -1070,6 +1087,11 @@ string_list.o: ../../include/sys_defs.h
|
|||||||
string_list.o: ../../include/match_list.h
|
string_list.o: ../../include/match_list.h
|
||||||
string_list.o: string_list.h
|
string_list.o: string_list.h
|
||||||
string_list.o: ../../include/match_ops.h
|
string_list.o: ../../include/match_ops.h
|
||||||
|
strip_addr.o: strip_addr.c
|
||||||
|
strip_addr.o: ../../include/sys_defs.h
|
||||||
|
strip_addr.o: ../../include/mymalloc.h
|
||||||
|
strip_addr.o: split_addr.h
|
||||||
|
strip_addr.o: strip_addr.h
|
||||||
sys_exits.o: sys_exits.c
|
sys_exits.o: sys_exits.c
|
||||||
sys_exits.o: ../../include/sys_defs.h
|
sys_exits.o: ../../include/sys_defs.h
|
||||||
sys_exits.o: ../../include/msg.h
|
sys_exits.o: ../../include/msg.h
|
||||||
|
@@ -78,9 +78,7 @@ ARGV *mail_addr_crunch(const char *string, const char *extension)
|
|||||||
* the result to external (quoted) form. Optionally apply the extension
|
* the result to external (quoted) form. Optionally apply the extension
|
||||||
* to each address found.
|
* to each address found.
|
||||||
*/
|
*/
|
||||||
#define NO_TOKEN_LIMIT 0
|
tree = tok822_parse(string);
|
||||||
|
|
||||||
tree = tok822_parse(string, NO_TOKEN_LIMIT);
|
|
||||||
addr_list = tok822_grep(tree, TOK822_ADDR);
|
addr_list = tok822_grep(tree, TOK822_ADDR);
|
||||||
for (tpp = addr_list; *tpp; tpp++) {
|
for (tpp = addr_list; *tpp; tpp++) {
|
||||||
tok822_externalize(extern_addr, tpp[0]->head, TOK822_STR_DEFL);
|
tok822_externalize(extern_addr, tpp[0]->head, TOK822_STR_DEFL);
|
||||||
|
@@ -81,7 +81,7 @@
|
|||||||
/* Global library. */
|
/* Global library. */
|
||||||
|
|
||||||
#include <mail_params.h>
|
#include <mail_params.h>
|
||||||
#include <split_addr.h>
|
#include <strip_addr.h>
|
||||||
#include <mail_addr_find.h>
|
#include <mail_addr_find.h>
|
||||||
#include <resolve_local.h>
|
#include <resolve_local.h>
|
||||||
|
|
||||||
@@ -97,7 +97,6 @@ const char *mail_addr_find(MAPS *path, const char *address, char **extp)
|
|||||||
const char *result;
|
const char *result;
|
||||||
char *ratsign = 0;
|
char *ratsign = 0;
|
||||||
char *full_key;
|
char *full_key;
|
||||||
char *extent;
|
|
||||||
char *bare_key;
|
char *bare_key;
|
||||||
char *saved_ext;
|
char *saved_ext;
|
||||||
|
|
||||||
@@ -108,21 +107,7 @@ const char *mail_addr_find(MAPS *path, const char *address, char **extp)
|
|||||||
if (*var_rcpt_delim == 0) {
|
if (*var_rcpt_delim == 0) {
|
||||||
bare_key = saved_ext = 0;
|
bare_key = saved_ext = 0;
|
||||||
} else {
|
} else {
|
||||||
bare_key = mystrdup(full_key);
|
bare_key = strip_addr(full_key, &saved_ext, *var_rcpt_delim);
|
||||||
if ((ratsign = strrchr(bare_key, '@')) != 0)
|
|
||||||
*ratsign = 0;
|
|
||||||
if ((extent = split_addr(bare_key, *var_rcpt_delim)) != 0) {
|
|
||||||
extent -= 1;
|
|
||||||
*extent = *var_rcpt_delim; /* XXX this is unclean */
|
|
||||||
saved_ext = mystrdup(extent); /* XXX maybe omit delimiter ? */
|
|
||||||
if (ratsign != 0) {
|
|
||||||
*ratsign = '@';
|
|
||||||
memmove(extent, ratsign, strlen(ratsign) + 1);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
myfree(bare_key);
|
|
||||||
bare_key = saved_ext = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -1558,6 +1558,10 @@ extern bool var_strict_encoding;
|
|||||||
#define DEF_SENDER_ROUTING 0
|
#define DEF_SENDER_ROUTING 0
|
||||||
extern bool var_sender_routing;
|
extern bool var_sender_routing;
|
||||||
|
|
||||||
|
#define VAR_XPORT_NULL_KEY "transport_null_address_lookup_key"
|
||||||
|
#define DEF_XPORT_NULL_KEY "<>"
|
||||||
|
extern char *var_xport_null_key;
|
||||||
|
|
||||||
/* LICENSE
|
/* LICENSE
|
||||||
/* .ad
|
/* .ad
|
||||||
/* .fi
|
/* .fi
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
* Patches change the patchlevel and the release date. Snapshots change the
|
* Patches change the patchlevel and the release date. Snapshots change the
|
||||||
* release date only, unless they include the same bugfix as a patch release.
|
* release date only, unless they include the same bugfix as a patch release.
|
||||||
*/
|
*/
|
||||||
#define MAIL_RELEASE_DATE "20020605"
|
#define MAIL_RELEASE_DATE "20020610"
|
||||||
|
|
||||||
#define VAR_MAIL_VERSION "mail_version"
|
#define VAR_MAIL_VERSION "mail_version"
|
||||||
#define DEF_MAIL_VERSION "1.1.11-" MAIL_RELEASE_DATE
|
#define DEF_MAIL_VERSION "1.1.11-" MAIL_RELEASE_DATE
|
||||||
|
@@ -133,7 +133,7 @@ void resolve_clnt_query(const char *addr, RESOLVE_REPLY *reply)
|
|||||||
/*
|
/*
|
||||||
* Peek at the cache.
|
* Peek at the cache.
|
||||||
*/
|
*/
|
||||||
if (strcmp(addr, STR(last_addr)) == 0) {
|
if (*addr && strcmp(addr, STR(last_addr)) == 0) {
|
||||||
vstring_strcpy(reply->transport, STR(last_reply.transport));
|
vstring_strcpy(reply->transport, STR(last_reply.transport));
|
||||||
vstring_strcpy(reply->nexthop, STR(last_reply.nexthop));
|
vstring_strcpy(reply->nexthop, STR(last_reply.nexthop));
|
||||||
vstring_strcpy(reply->recipient, STR(last_reply.recipient));
|
vstring_strcpy(reply->recipient, STR(last_reply.recipient));
|
||||||
@@ -179,7 +179,7 @@ void resolve_clnt_query(const char *addr, RESOLVE_REPLY *reply)
|
|||||||
STR(reply->nexthop), STR(reply->recipient));
|
STR(reply->nexthop), STR(reply->recipient));
|
||||||
if (STR(reply->transport)[0] == 0)
|
if (STR(reply->transport)[0] == 0)
|
||||||
msg_warn("%s: null transport result for: <%s>", myname, addr);
|
msg_warn("%s: null transport result for: <%s>", myname, addr);
|
||||||
else if (STR(reply->recipient)[0] == 0)
|
else if (STR(reply->recipient)[0] == 0 && *addr != 0)
|
||||||
msg_warn("%s: null recipient result for: <%s>", myname, addr);
|
msg_warn("%s: null recipient result for: <%s>", myname, addr);
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
|
211
postfix/src/global/strip_addr.c
Normal file
211
postfix/src/global/strip_addr.c
Normal file
@@ -0,0 +1,211 @@
|
|||||||
|
/*++
|
||||||
|
/* NAME
|
||||||
|
/* strip_addr 3
|
||||||
|
/* SUMMARY
|
||||||
|
/* strip extension from full or localpart-only address
|
||||||
|
/* SYNOPSIS
|
||||||
|
/* #include <strip_addr.h>
|
||||||
|
/*
|
||||||
|
/* char *strip_addr(address, extension, delimiter)
|
||||||
|
/* const char *address;
|
||||||
|
/* char **extension;
|
||||||
|
/* int delimiter;
|
||||||
|
/* DESCRIPTION
|
||||||
|
/* strip_addr() takes an address and either returns a null
|
||||||
|
/* pointer when the address contains no address extension,
|
||||||
|
/* or returns a copy of the address without address extension.
|
||||||
|
/* The caller is expected to pass the copy to myfree().
|
||||||
|
/*
|
||||||
|
/* Arguments:
|
||||||
|
/* .IP address
|
||||||
|
/* Address localpart or user@domain form.
|
||||||
|
/* .IP extension
|
||||||
|
/* A null pointer, or the address of a pointer that is set to
|
||||||
|
/* the address of a dynamic memory copy of the address extension
|
||||||
|
/* that had to be chopped off.
|
||||||
|
/* The copy includes the recipient address delimiter.
|
||||||
|
/* The caller is expected to pass the copy to myfree().
|
||||||
|
/* .IP delimiter
|
||||||
|
/* Recipient address delimiter.
|
||||||
|
/* SEE ALSO
|
||||||
|
/* split_addr(3) strip extension from localpart
|
||||||
|
/* 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>
|
||||||
|
|
||||||
|
/* Utility library. */
|
||||||
|
|
||||||
|
#include <mymalloc.h>
|
||||||
|
|
||||||
|
/* Global library. */
|
||||||
|
|
||||||
|
#include <split_addr.h>
|
||||||
|
#include <strip_addr.h>
|
||||||
|
|
||||||
|
/* strip_addr - strip extension from address */
|
||||||
|
|
||||||
|
char *strip_addr(const char *full, char **extension, int delimiter)
|
||||||
|
{
|
||||||
|
char *ratsign;
|
||||||
|
char *extent;
|
||||||
|
char *saved_ext;
|
||||||
|
char *stripped;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* A quick test to eliminate inputs without delimiter anywhere.
|
||||||
|
*/
|
||||||
|
if (delimiter == 0 || strchr(full, delimiter) == 0) {
|
||||||
|
stripped = saved_ext = 0;
|
||||||
|
} else {
|
||||||
|
stripped = mystrdup(full);
|
||||||
|
if ((ratsign = strrchr(stripped, '@')) != 0)
|
||||||
|
*ratsign = 0;
|
||||||
|
if ((extent = split_addr(stripped, delimiter)) != 0) {
|
||||||
|
extent -= 1;
|
||||||
|
if (extension) {
|
||||||
|
*extent = delimiter;
|
||||||
|
saved_ext = mystrdup(extent);
|
||||||
|
*extent = 0;
|
||||||
|
} else
|
||||||
|
saved_ext = 0;
|
||||||
|
if (ratsign != 0) {
|
||||||
|
*ratsign = '@';
|
||||||
|
memmove(extent, ratsign, strlen(ratsign) + 1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
myfree(stripped);
|
||||||
|
stripped = saved_ext = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (extension)
|
||||||
|
*extension = saved_ext;
|
||||||
|
return (stripped);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef TEST
|
||||||
|
|
||||||
|
#include <msg.h>
|
||||||
|
#include <mail_params.h>
|
||||||
|
|
||||||
|
char *var_double_bounce_sender = DEF_DOUBLE_BOUNCE;
|
||||||
|
|
||||||
|
int main(int unused_argc, char **unused_argv)
|
||||||
|
{
|
||||||
|
char *extension;
|
||||||
|
char *stripped;
|
||||||
|
int delim = '-';
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Incredible. This function takes only three arguments, and the tests
|
||||||
|
* already take more lines of code than the code being tested.
|
||||||
|
*/
|
||||||
|
stripped = strip_addr("foo", (char **) 0, 0);
|
||||||
|
if (stripped != 0)
|
||||||
|
msg_panic("strip_addr botch 1");
|
||||||
|
|
||||||
|
stripped = strip_addr("foo", &extension, 0);
|
||||||
|
if (stripped != 0)
|
||||||
|
msg_panic("strip_addr botch 2");
|
||||||
|
if (extension != 0)
|
||||||
|
msg_panic("strip_addr botch 3");
|
||||||
|
|
||||||
|
stripped = strip_addr("foo", (char **) 0, delim);
|
||||||
|
if (stripped != 0)
|
||||||
|
msg_panic("strip_addr botch 4");
|
||||||
|
|
||||||
|
stripped = strip_addr("foo", &extension, delim);
|
||||||
|
if (stripped != 0)
|
||||||
|
msg_panic("strip_addr botch 5");
|
||||||
|
if (extension != 0)
|
||||||
|
msg_panic("strip_addr botch 6");
|
||||||
|
|
||||||
|
stripped = strip_addr("foo@bar", (char **) 0, 0);
|
||||||
|
if (stripped != 0)
|
||||||
|
msg_panic("strip_addr botch 7");
|
||||||
|
|
||||||
|
stripped = strip_addr("foo@bar", &extension, 0);
|
||||||
|
if (stripped != 0)
|
||||||
|
msg_panic("strip_addr botch 8");
|
||||||
|
if (extension != 0)
|
||||||
|
msg_panic("strip_addr botch 9");
|
||||||
|
|
||||||
|
stripped = strip_addr("foo@bar", (char **) 0, delim);
|
||||||
|
if (stripped != 0)
|
||||||
|
msg_panic("strip_addr botch 10");
|
||||||
|
|
||||||
|
stripped = strip_addr("foo@bar", &extension, delim);
|
||||||
|
if (stripped != 0)
|
||||||
|
msg_panic("strip_addr botch 11");
|
||||||
|
if (extension != 0)
|
||||||
|
msg_panic("strip_addr botch 12");
|
||||||
|
|
||||||
|
stripped = strip_addr("foo-ext", (char **) 0, 0);
|
||||||
|
if (stripped != 0)
|
||||||
|
msg_panic("strip_addr botch 13");
|
||||||
|
|
||||||
|
stripped = strip_addr("foo-ext", &extension, 0);
|
||||||
|
if (stripped != 0)
|
||||||
|
msg_panic("strip_addr botch 14");
|
||||||
|
if (extension != 0)
|
||||||
|
msg_panic("strip_addr botch 15");
|
||||||
|
|
||||||
|
stripped = strip_addr("foo-ext", (char **) 0, delim);
|
||||||
|
if (stripped == 0)
|
||||||
|
msg_panic("strip_addr botch 16");
|
||||||
|
msg_info("wanted: foo-ext -> %s", "foo");
|
||||||
|
msg_info("strip_addr foo-ext -> %s", stripped);
|
||||||
|
myfree(stripped);
|
||||||
|
|
||||||
|
stripped = strip_addr("foo-ext", &extension, delim);
|
||||||
|
if (stripped == 0)
|
||||||
|
msg_panic("strip_addr botch 17");
|
||||||
|
if (extension == 0)
|
||||||
|
msg_panic("strip_addr botch 18");
|
||||||
|
msg_info("wanted: foo-ext -> %s %s", "foo", "-ext");
|
||||||
|
msg_info("strip_addr foo-ext -> %s %s", stripped, extension);
|
||||||
|
myfree(stripped);
|
||||||
|
myfree(extension);
|
||||||
|
|
||||||
|
stripped = strip_addr("foo-ext@bar", (char **) 0, 0);
|
||||||
|
if (stripped != 0)
|
||||||
|
msg_panic("strip_addr botch 19");
|
||||||
|
|
||||||
|
stripped = strip_addr("foo-ext@bar", &extension, 0);
|
||||||
|
if (stripped != 0)
|
||||||
|
msg_panic("strip_addr botch 20");
|
||||||
|
if (extension != 0)
|
||||||
|
msg_panic("strip_addr botch 21");
|
||||||
|
|
||||||
|
stripped = strip_addr("foo-ext@bar", (char **) 0, delim);
|
||||||
|
if (stripped == 0)
|
||||||
|
msg_panic("strip_addr botch 22");
|
||||||
|
msg_info("wanted: foo-ext@bar -> %s", "foo@bar");
|
||||||
|
msg_info("strip_addr foo-ext@bar -> %s", stripped);
|
||||||
|
myfree(stripped);
|
||||||
|
|
||||||
|
stripped = strip_addr("foo-ext@bar", &extension, delim);
|
||||||
|
if (stripped == 0)
|
||||||
|
msg_panic("strip_addr botch 23");
|
||||||
|
if (extension == 0)
|
||||||
|
msg_panic("strip_addr botch 24");
|
||||||
|
msg_info("wanted: foo-ext@bar -> %s %s", "foo@bar", "-ext");
|
||||||
|
msg_info("strip_addr foo-ext@bar -> %s %s", stripped, extension);
|
||||||
|
myfree(stripped);
|
||||||
|
myfree(extension);
|
||||||
|
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
29
postfix/src/global/strip_addr.h
Normal file
29
postfix/src/global/strip_addr.h
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
#ifndef _STRIP_ADDR_H_INCLUDED_
|
||||||
|
#define _STRIP_ADDR_H_INCLUDED_
|
||||||
|
|
||||||
|
/*++
|
||||||
|
/* NAME
|
||||||
|
/* strip_addr 3h
|
||||||
|
/* SUMMARY
|
||||||
|
/* strip extension from full address
|
||||||
|
/* SYNOPSIS
|
||||||
|
/* #include <strip_addr.h>
|
||||||
|
/* DESCRIPTION
|
||||||
|
/* .nf
|
||||||
|
|
||||||
|
/* External interface. */
|
||||||
|
|
||||||
|
extern char *strip_addr(const char *, 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
|
8
postfix/src/global/strip_addr.ref
Normal file
8
postfix/src/global/strip_addr.ref
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
unknown: wanted: foo-ext -> foo
|
||||||
|
unknown: strip_addr foo-ext -> foo
|
||||||
|
unknown: wanted: foo-ext -> foo -ext
|
||||||
|
unknown: strip_addr foo-ext -> foo -ext
|
||||||
|
unknown: wanted: foo-ext@bar -> foo@bar
|
||||||
|
unknown: strip_addr foo-ext@bar -> foo@bar
|
||||||
|
unknown: wanted: foo-ext@bar -> foo@bar -ext
|
||||||
|
unknown: strip_addr foo-ext@bar -> foo@bar -ext
|
@@ -74,12 +74,15 @@ extern TOK822 **tok822_grep(TOK822 *, int);
|
|||||||
/*
|
/*
|
||||||
* tok822_parse.c
|
* tok822_parse.c
|
||||||
*/
|
*/
|
||||||
extern TOK822 *tok822_scan(const char *, TOK822 **, int);
|
extern TOK822 *tok822_scan_limit(const char *, TOK822 **, int);
|
||||||
extern TOK822 *tok822_scan_addr(const char *);
|
extern TOK822 *tok822_scan_addr(const char *);
|
||||||
extern TOK822 *tok822_parse(const char *, int);
|
extern TOK822 *tok822_parse_limit(const char *, int);
|
||||||
extern VSTRING *tok822_externalize(VSTRING *, TOK822 *, int);
|
extern VSTRING *tok822_externalize(VSTRING *, TOK822 *, int);
|
||||||
extern VSTRING *tok822_internalize(VSTRING *, TOK822 *, int);
|
extern VSTRING *tok822_internalize(VSTRING *, TOK822 *, int);
|
||||||
|
|
||||||
|
#define tok822_scan(cp, ptr) tok822_scan_limit((cp), (ptr), 0)
|
||||||
|
#define tok822_parse(cp) tok822_parse_limit((cp), 0)
|
||||||
|
|
||||||
#define TOK822_STR_NONE (0)
|
#define TOK822_STR_NONE (0)
|
||||||
#define TOK822_STR_WIPE (1<<0)
|
#define TOK822_STR_WIPE (1<<0)
|
||||||
#define TOK822_STR_TERM (1<<1)
|
#define TOK822_STR_TERM (1<<1)
|
||||||
|
1
postfix/src/global/tok822_limit.in
Normal file
1
postfix/src/global/tok822_limit.in
Normal file
@@ -0,0 +1 @@
|
|||||||
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
91
postfix/src/global/tok822_limit.ref
Normal file
91
postfix/src/global/tok822_limit.ref
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
>>>1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22<<<
|
||||||
|
|
||||||
|
Parse tree:
|
||||||
|
address
|
||||||
|
atom "1"
|
||||||
|
OP ","
|
||||||
|
address
|
||||||
|
atom "2"
|
||||||
|
OP ","
|
||||||
|
address
|
||||||
|
atom "3"
|
||||||
|
OP ","
|
||||||
|
address
|
||||||
|
atom "4"
|
||||||
|
OP ","
|
||||||
|
address
|
||||||
|
atom "5"
|
||||||
|
OP ","
|
||||||
|
address
|
||||||
|
atom "6"
|
||||||
|
OP ","
|
||||||
|
address
|
||||||
|
atom "7"
|
||||||
|
OP ","
|
||||||
|
address
|
||||||
|
atom "8"
|
||||||
|
OP ","
|
||||||
|
address
|
||||||
|
atom "9"
|
||||||
|
OP ","
|
||||||
|
address
|
||||||
|
atom "10"
|
||||||
|
OP ","
|
||||||
|
address
|
||||||
|
atom "11"
|
||||||
|
OP ","
|
||||||
|
address
|
||||||
|
atom "12"
|
||||||
|
OP ","
|
||||||
|
address
|
||||||
|
atom "13"
|
||||||
|
OP ","
|
||||||
|
address
|
||||||
|
atom "14"
|
||||||
|
OP ","
|
||||||
|
address
|
||||||
|
atom "15"
|
||||||
|
OP ","
|
||||||
|
address
|
||||||
|
atom "16"
|
||||||
|
OP ","
|
||||||
|
address
|
||||||
|
atom "17"
|
||||||
|
OP ","
|
||||||
|
address
|
||||||
|
atom "18"
|
||||||
|
OP ","
|
||||||
|
address
|
||||||
|
atom "19"
|
||||||
|
OP ","
|
||||||
|
address
|
||||||
|
atom "20"
|
||||||
|
|
||||||
|
Internalized:
|
||||||
|
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
|
||||||
|
|
||||||
|
Externalized, no newlines inserted:
|
||||||
|
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
|
||||||
|
|
||||||
|
Externalized, newlines inserted:
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
4,
|
||||||
|
5,
|
||||||
|
6,
|
||||||
|
7,
|
||||||
|
8,
|
||||||
|
9,
|
||||||
|
10,
|
||||||
|
11,
|
||||||
|
12,
|
||||||
|
13,
|
||||||
|
14,
|
||||||
|
15,
|
||||||
|
16,
|
||||||
|
17,
|
||||||
|
18,
|
||||||
|
19,
|
||||||
|
20
|
||||||
|
|
@@ -6,15 +6,22 @@
|
|||||||
/* SYNOPSIS
|
/* SYNOPSIS
|
||||||
/* #include <tok822.h>
|
/* #include <tok822.h>
|
||||||
/*
|
/*
|
||||||
/* TOK822 *tok822_scan(str, tailp, limit)
|
/* TOK822 *tok822_scan_limit(str, tailp, limit)
|
||||||
/* const char *str;
|
/* const char *str;
|
||||||
/* TOK822 **tailp;
|
/* TOK822 **tailp;
|
||||||
/* int limit;
|
/* int limit;
|
||||||
/*
|
/*
|
||||||
/* TOK822 *tok822_parse(str, limit)
|
/* TOK822 *tok822_scan(str, tailp)
|
||||||
|
/* const char *str;
|
||||||
|
/* TOK822 **tailp;
|
||||||
|
/*
|
||||||
|
/* TOK822 *tok822_parse_limit(str, limit)
|
||||||
/* const char *str;
|
/* const char *str;
|
||||||
/* int limit;
|
/* int limit;
|
||||||
/*
|
/*
|
||||||
|
/* TOK822 *tok822_parse(str)
|
||||||
|
/* const char *str;
|
||||||
|
/*
|
||||||
/* TOK822 *tok822_scan_addr(str)
|
/* TOK822 *tok822_scan_addr(str)
|
||||||
/* const char *str;
|
/* const char *str;
|
||||||
/*
|
/*
|
||||||
@@ -38,6 +45,8 @@
|
|||||||
/* tok822_scan() converts the external-form string in \fIstr\fR
|
/* tok822_scan() converts the external-form string in \fIstr\fR
|
||||||
/* to a linear token list. The \fItailp\fR argument is a null pointer
|
/* to a linear token list. The \fItailp\fR argument is a null pointer
|
||||||
/* or receives the pointer value of the last result list element.
|
/* or receives the pointer value of the last result list element.
|
||||||
|
/*
|
||||||
|
/* tok822_scan_limit() implements tok822_scan(), which is a macro.
|
||||||
/* The \fIlimit\fR argument is either zero or an upper bound on the
|
/* The \fIlimit\fR argument is either zero or an upper bound on the
|
||||||
/* number of tokens produced.
|
/* number of tokens produced.
|
||||||
/*
|
/*
|
||||||
@@ -45,6 +54,8 @@
|
|||||||
/* \fIstr\fR to the corresponding token tree. The parser is permissive
|
/* \fIstr\fR to the corresponding token tree. The parser is permissive
|
||||||
/* and will not throw away information that it does not understand.
|
/* and will not throw away information that it does not understand.
|
||||||
/* The parser adds missing commas between addresses.
|
/* The parser adds missing commas between addresses.
|
||||||
|
/*
|
||||||
|
/* tok822_parse_limit() implements tok822_parse(), which is a macro.
|
||||||
/* The \fIlimit\fR argument is either zero or an upper bound on the
|
/* The \fIlimit\fR argument is either zero or an upper bound on the
|
||||||
/* number of tokens produced.
|
/* number of tokens produced.
|
||||||
/*
|
/*
|
||||||
@@ -320,9 +331,9 @@ static int tok822_append_space(TOK822 *tp)
|
|||||||
return (NON_OPERATOR(tp) && NON_OPERATOR(next));
|
return (NON_OPERATOR(tp) && NON_OPERATOR(next));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* tok822_scan - tokenize string */
|
/* tok822_scan_limit - tokenize string */
|
||||||
|
|
||||||
TOK822 *tok822_scan(const char *str, TOK822 **tailp, int tok_count_limit)
|
TOK822 *tok822_scan_limit(const char *str, TOK822 **tailp, int tok_count_limit)
|
||||||
{
|
{
|
||||||
TOK822 *head = 0;
|
TOK822 *head = 0;
|
||||||
TOK822 *tail = 0;
|
TOK822 *tail = 0;
|
||||||
@@ -372,9 +383,9 @@ TOK822 *tok822_scan(const char *str, TOK822 **tailp, int tok_count_limit)
|
|||||||
return (head);
|
return (head);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* tok822_parse - translate external string to token tree */
|
/* tok822_parse_limit - translate external string to token tree */
|
||||||
|
|
||||||
TOK822 *tok822_parse(const char *str, int tok_count_limit)
|
TOK822 *tok822_parse_limit(const char *str, int tok_count_limit)
|
||||||
{
|
{
|
||||||
TOK822 *head;
|
TOK822 *head;
|
||||||
TOK822 *tail;
|
TOK822 *tail;
|
||||||
@@ -390,7 +401,7 @@ TOK822 *tok822_parse(const char *str, int tok_count_limit)
|
|||||||
* token list that contains all tokens, we can always convert back to
|
* token list that contains all tokens, we can always convert back to
|
||||||
* string form.
|
* string form.
|
||||||
*/
|
*/
|
||||||
if ((first_token = tok822_scan(str, &last_token, tok_count_limit)) == 0)
|
if ((first_token = tok822_scan_limit(str, &last_token, tok_count_limit)) == 0)
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -547,7 +558,7 @@ TOK822 *tok822_scan_addr(const char *addr)
|
|||||||
{
|
{
|
||||||
TOK822 *tree = tok822_alloc(TOK822_ADDR, (char *) 0);
|
TOK822 *tree = tok822_alloc(TOK822_ADDR, (char *) 0);
|
||||||
|
|
||||||
tree->head = tok822_scan(addr, &tree->tail, 0);
|
tree->head = tok822_scan(addr, &tree->tail);
|
||||||
return (tree);
|
return (tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -598,7 +609,7 @@ int main(int unused_argc, char **unused_argv)
|
|||||||
}
|
}
|
||||||
if (!isatty(vstream_fileno(VSTREAM_IN)))
|
if (!isatty(vstream_fileno(VSTREAM_IN)))
|
||||||
vstream_printf(">>>%s<<<\n\n", vstring_str(buf));
|
vstream_printf(">>>%s<<<\n\n", vstring_str(buf));
|
||||||
list = tok822_parse(vstring_str(buf), TEST_TOKEN_LIMIT);
|
list = tok822_parse_limit(vstring_str(buf), TEST_TOKEN_LIMIT);
|
||||||
vstream_printf("Parse tree:\n");
|
vstream_printf("Parse tree:\n");
|
||||||
tok822_print(list, 0);
|
tok822_print(list, 0);
|
||||||
vstream_printf("\n");
|
vstream_printf("\n");
|
||||||
|
@@ -53,8 +53,6 @@ TOK822 *tok822_rewrite(TOK822 *addr, const char *how)
|
|||||||
* the result. Shipping external form is much simpler than shipping parse
|
* the result. Shipping external form is much simpler than shipping parse
|
||||||
* trees.
|
* trees.
|
||||||
*/
|
*/
|
||||||
#define NO_TOKEN_LIMIT 0
|
|
||||||
|
|
||||||
tok822_externalize(input_ext_form, addr->head, TOK822_STR_DEFL);
|
tok822_externalize(input_ext_form, addr->head, TOK822_STR_DEFL);
|
||||||
if (msg_verbose)
|
if (msg_verbose)
|
||||||
msg_info("tok822_rewrite: input: %s", vstring_str(input_ext_form));
|
msg_info("tok822_rewrite: input: %s", vstring_str(input_ext_form));
|
||||||
@@ -62,8 +60,7 @@ TOK822 *tok822_rewrite(TOK822 *addr, const char *how)
|
|||||||
if (msg_verbose)
|
if (msg_verbose)
|
||||||
msg_info("tok822_rewrite: result: %s", vstring_str(canon_ext_form));
|
msg_info("tok822_rewrite: result: %s", vstring_str(canon_ext_form));
|
||||||
tok822_free_tree(addr->head);
|
tok822_free_tree(addr->head);
|
||||||
addr->head = tok822_scan(vstring_str(canon_ext_form), &addr->tail,
|
addr->head = tok822_scan(vstring_str(canon_ext_form), &addr->tail);
|
||||||
NO_TOKEN_LIMIT);
|
|
||||||
|
|
||||||
vstring_free(input_ext_form);
|
vstring_free(input_ext_form);
|
||||||
vstring_free(canon_ext_form);
|
vstring_free(canon_ext_form);
|
||||||
|
@@ -12,7 +12,7 @@ WARN = -W -Wformat -Wimplicit -Wmissing-prototypes \
|
|||||||
-Wunused
|
-Wunused
|
||||||
DEFS = -I. -I$(INC_DIR) -D$(SYSTYPE)
|
DEFS = -I. -I$(INC_DIR) -D$(SYSTYPE)
|
||||||
CFLAGS = $(DEBUG) $(OPT) $(DEFS)
|
CFLAGS = $(DEBUG) $(OPT) $(DEFS)
|
||||||
TESTPROG= quote_821_local
|
TESTPROG=
|
||||||
PROG = lmtp
|
PROG = lmtp
|
||||||
INC_DIR = ../../include
|
INC_DIR = ../../include
|
||||||
LIBS = ../../lib/libmaster.a ../../lib/libglobal.a ../../lib/libdns.a ../../lib/libutil.a
|
LIBS = ../../lib/libmaster.a ../../lib/libglobal.a ../../lib/libdns.a ../../lib/libutil.a
|
||||||
@@ -27,6 +27,8 @@ Makefile: Makefile.in
|
|||||||
|
|
||||||
test: $(TESTPROG)
|
test: $(TESTPROG)
|
||||||
|
|
||||||
|
tests: test
|
||||||
|
|
||||||
update: ../../libexec/$(PROG)
|
update: ../../libexec/$(PROG)
|
||||||
|
|
||||||
../../libexec/$(PROG): $(PROG)
|
../../libexec/$(PROG): $(PROG)
|
||||||
@@ -49,9 +51,6 @@ clean:
|
|||||||
|
|
||||||
tidy: clean
|
tidy: clean
|
||||||
|
|
||||||
quote_821_local: quote_821_local.c $(LIBS)
|
|
||||||
$(CC) $(CFLAGS) -DTEST -o $@ $@.c $(LIBS) $(SYSLIBS)
|
|
||||||
|
|
||||||
depend: $(MAKES)
|
depend: $(MAKES)
|
||||||
(sed '1,/^# do not edit/!d' Makefile.in; \
|
(sed '1,/^# do not edit/!d' Makefile.in; \
|
||||||
set -e; for i in [a-z][a-z0-9]*.c; do \
|
set -e; for i in [a-z][a-z0-9]*.c; do \
|
||||||
|
@@ -29,6 +29,8 @@ Makefile: Makefile.in
|
|||||||
|
|
||||||
test: $(TESTPROG)
|
test: $(TESTPROG)
|
||||||
|
|
||||||
|
tests: test
|
||||||
|
|
||||||
update: ../../libexec/$(PROG)
|
update: ../../libexec/$(PROG)
|
||||||
|
|
||||||
../../libexec/$(PROG): $(PROG)
|
../../libexec/$(PROG): $(PROG)
|
||||||
|
@@ -177,9 +177,7 @@ int deliver_token_string(LOCAL_STATE state, USER_ATTR usr_attr,
|
|||||||
if (msg_verbose)
|
if (msg_verbose)
|
||||||
msg_info("deliver_token_string: %s", string);
|
msg_info("deliver_token_string: %s", string);
|
||||||
|
|
||||||
#define NO_TOKEN_LIMIT 0
|
tree = tok822_parse(string);
|
||||||
|
|
||||||
tree = tok822_parse(string, NO_TOKEN_LIMIT);
|
|
||||||
for (addr = tree; addr != 0; addr = addr->next) {
|
for (addr = tree; addr != 0; addr = addr->next) {
|
||||||
if (addr->type == TOK822_ADDR) {
|
if (addr->type == TOK822_ADDR) {
|
||||||
if (addr_count)
|
if (addr_count)
|
||||||
|
@@ -35,6 +35,8 @@ $(PROG): $(OBJS) $(LIBS)
|
|||||||
|
|
||||||
test: $(TESTPROG)
|
test: $(TESTPROG)
|
||||||
|
|
||||||
|
tests: test
|
||||||
|
|
||||||
$(LIB): $(LIB_OBJ)
|
$(LIB): $(LIB_OBJ)
|
||||||
$(AR) $(ARFL) $(LIB) $?
|
$(AR) $(ARFL) $(LIB) $?
|
||||||
$(RANLIB) $(LIB)
|
$(RANLIB) $(LIB)
|
||||||
|
@@ -29,6 +29,8 @@ Makefile: Makefile.in
|
|||||||
|
|
||||||
test: $(TESTPROG)
|
test: $(TESTPROG)
|
||||||
|
|
||||||
|
tests: test
|
||||||
|
|
||||||
update: ../../libexec/n$(PROG)
|
update: ../../libexec/n$(PROG)
|
||||||
|
|
||||||
../../libexec/n$(PROG): $(PROG)
|
../../libexec/n$(PROG): $(PROG)
|
||||||
|
@@ -654,6 +654,11 @@ static void qmgr_message_resolve(QMGR_MESSAGE *message)
|
|||||||
if (!STREQ(recipient->address, STR(reply.recipient)))
|
if (!STREQ(recipient->address, STR(reply.recipient)))
|
||||||
UPDATE(recipient->address, STR(reply.recipient));
|
UPDATE(recipient->address, STR(reply.recipient));
|
||||||
}
|
}
|
||||||
|
if (recipient->address[0] == 0) {
|
||||||
|
qmgr_bounce_recipient(message, recipient,
|
||||||
|
"null recipient address");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* XXX The nexthop destination is also used as lookup key for the
|
* XXX The nexthop destination is also used as lookup key for the
|
||||||
|
@@ -23,6 +23,8 @@ Makefile: Makefile.in
|
|||||||
|
|
||||||
test: $(TESTPROG)
|
test: $(TESTPROG)
|
||||||
|
|
||||||
|
tests: test
|
||||||
|
|
||||||
update: ../../libexec/$(PROG)
|
update: ../../libexec/$(PROG)
|
||||||
|
|
||||||
../../libexec/$(PROG): $(PROG)
|
../../libexec/$(PROG): $(PROG)
|
||||||
|
@@ -8,7 +8,7 @@ WARN = -W -Wformat -Wimplicit -Wmissing-prototypes \
|
|||||||
-Wunused
|
-Wunused
|
||||||
DEFS = -I. -I$(INC_DIR) -D$(SYSTYPE)
|
DEFS = -I. -I$(INC_DIR) -D$(SYSTYPE)
|
||||||
CFLAGS = $(DEBUG) $(OPT) $(DEFS)
|
CFLAGS = $(DEBUG) $(OPT) $(DEFS)
|
||||||
TESTPROG= quote_821_local pipe_unalias
|
TESTPROG=
|
||||||
PROG = pipe
|
PROG = pipe
|
||||||
INC_DIR = ../../include
|
INC_DIR = ../../include
|
||||||
LIBS = ../../lib/libmaster.a ../../lib/libglobal.a ../../lib/libutil.a
|
LIBS = ../../lib/libmaster.a ../../lib/libglobal.a ../../lib/libutil.a
|
||||||
@@ -23,6 +23,8 @@ Makefile: Makefile.in
|
|||||||
|
|
||||||
test: $(TESTPROG)
|
test: $(TESTPROG)
|
||||||
|
|
||||||
|
tests: test
|
||||||
|
|
||||||
update: ../../libexec/$(PROG)
|
update: ../../libexec/$(PROG)
|
||||||
|
|
||||||
../../libexec/$(PROG): $(PROG)
|
../../libexec/$(PROG): $(PROG)
|
||||||
|
@@ -23,7 +23,7 @@ Makefile: Makefile.in
|
|||||||
|
|
||||||
update: ../../bin/$(PROG)
|
update: ../../bin/$(PROG)
|
||||||
|
|
||||||
test: test1 test2
|
tests: test1 test2
|
||||||
|
|
||||||
test1: $(PROG) map.in map-abc1.ref map-ghi1.ref map-ABC1.ref
|
test1: $(PROG) map.in map-abc1.ref map-ghi1.ref map-ABC1.ref
|
||||||
./$(PROG) map.in
|
./$(PROG) map.in
|
||||||
|
@@ -249,10 +249,7 @@ static void postalias(char *map_type, char *path_name, int postalias_flags,
|
|||||||
* Tokenize the input, so that we do the right thing when a quoted
|
* Tokenize the input, so that we do the right thing when a quoted
|
||||||
* localpart contains special characters such as "@", ":" and so on.
|
* localpart contains special characters such as "@", ":" and so on.
|
||||||
*/
|
*/
|
||||||
#define NO_TOKEN_LIMIT 0
|
if ((tok_list = tok822_scan(STR(line_buffer), (TOK822 **) 0)) == 0)
|
||||||
|
|
||||||
if ((tok_list = tok822_scan(STR(line_buffer), (TOK822 **) 0,
|
|
||||||
NO_TOKEN_LIMIT)) == 0)
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -23,6 +23,8 @@ Makefile: Makefile.in
|
|||||||
|
|
||||||
test: $(TESTPROG)
|
test: $(TESTPROG)
|
||||||
|
|
||||||
|
tests: test
|
||||||
|
|
||||||
update: ../../bin/$(PROG)
|
update: ../../bin/$(PROG)
|
||||||
|
|
||||||
../../bin/$(PROG): $(PROG)
|
../../bin/$(PROG): $(PROG)
|
||||||
|
@@ -33,6 +33,8 @@ Makefile: Makefile.in
|
|||||||
|
|
||||||
test: $(TESTPROG)
|
test: $(TESTPROG)
|
||||||
|
|
||||||
|
tests: test
|
||||||
|
|
||||||
update: ../../bin/$(PROG) $(SAMPLES)
|
update: ../../bin/$(PROG) $(SAMPLES)
|
||||||
|
|
||||||
../../bin/$(PROG): $(PROG)
|
../../bin/$(PROG): $(PROG)
|
||||||
|
@@ -23,6 +23,8 @@ Makefile: Makefile.in
|
|||||||
|
|
||||||
test: $(TESTPROG)
|
test: $(TESTPROG)
|
||||||
|
|
||||||
|
tests: test
|
||||||
|
|
||||||
update: ../../bin/$(PROG)
|
update: ../../bin/$(PROG)
|
||||||
|
|
||||||
../../bin/$(PROG): $(PROG)
|
../../bin/$(PROG): $(PROG)
|
||||||
|
@@ -24,6 +24,8 @@ Makefile: Makefile.in
|
|||||||
|
|
||||||
test: $(TESTPROG)
|
test: $(TESTPROG)
|
||||||
|
|
||||||
|
tests: test
|
||||||
|
|
||||||
update: ../../bin/$(PROG)
|
update: ../../bin/$(PROG)
|
||||||
|
|
||||||
../../bin/$(PROG): $(PROG)
|
../../bin/$(PROG): $(PROG)
|
||||||
|
@@ -23,6 +23,8 @@ Makefile: Makefile.in
|
|||||||
|
|
||||||
test: $(TESTPROG)
|
test: $(TESTPROG)
|
||||||
|
|
||||||
|
tests: test
|
||||||
|
|
||||||
update: ../../bin/$(PROG)
|
update: ../../bin/$(PROG)
|
||||||
|
|
||||||
../../bin/$(PROG): $(PROG)
|
../../bin/$(PROG): $(PROG)
|
||||||
|
@@ -23,6 +23,8 @@ Makefile: Makefile.in
|
|||||||
|
|
||||||
test: $(TESTPROG)
|
test: $(TESTPROG)
|
||||||
|
|
||||||
|
tests: test
|
||||||
|
|
||||||
update: ../../bin/$(PROG)
|
update: ../../bin/$(PROG)
|
||||||
|
|
||||||
../../bin/$(PROG): $(PROG)
|
../../bin/$(PROG): $(PROG)
|
||||||
|
@@ -24,6 +24,8 @@ Makefile: Makefile.in
|
|||||||
|
|
||||||
test: $(TESTPROG)
|
test: $(TESTPROG)
|
||||||
|
|
||||||
|
tests: test
|
||||||
|
|
||||||
update: ../../bin/$(PROG)
|
update: ../../bin/$(PROG)
|
||||||
|
|
||||||
../../bin/$(PROG): $(PROG)
|
../../bin/$(PROG): $(PROG)
|
||||||
|
@@ -26,7 +26,7 @@ update: ../../bin/$(PROG)
|
|||||||
../../bin/$(PROG): $(PROG)
|
../../bin/$(PROG): $(PROG)
|
||||||
cp $(PROG) ../../bin
|
cp $(PROG) ../../bin
|
||||||
|
|
||||||
test: test1 test2
|
tests: test1 test2
|
||||||
|
|
||||||
test1: $(PROG) map.in map-abc1.ref map-ghi1.ref map-ABC1.ref
|
test1: $(PROG) map.in map-abc1.ref map-ghi1.ref map-ABC1.ref
|
||||||
./$(PROG) map.in
|
./$(PROG) map.in
|
||||||
|
@@ -23,6 +23,8 @@ Makefile: Makefile.in
|
|||||||
|
|
||||||
test: $(TESTPROG)
|
test: $(TESTPROG)
|
||||||
|
|
||||||
|
tests: test
|
||||||
|
|
||||||
update: ../../bin/$(PROG)
|
update: ../../bin/$(PROG)
|
||||||
|
|
||||||
../../bin/$(PROG): $(PROG)
|
../../bin/$(PROG): $(PROG)
|
||||||
|
@@ -23,6 +23,8 @@ Makefile: Makefile.in
|
|||||||
|
|
||||||
test: $(TESTPROG)
|
test: $(TESTPROG)
|
||||||
|
|
||||||
|
tests: test
|
||||||
|
|
||||||
update: ../../bin/$(PROG)
|
update: ../../bin/$(PROG)
|
||||||
|
|
||||||
../../bin/$(PROG): $(PROG)
|
../../bin/$(PROG): $(PROG)
|
||||||
|
@@ -27,6 +27,8 @@ Makefile: Makefile.in
|
|||||||
|
|
||||||
test: $(TESTPROG)
|
test: $(TESTPROG)
|
||||||
|
|
||||||
|
tests: test
|
||||||
|
|
||||||
update: ../../libexec/$(PROG)
|
update: ../../libexec/$(PROG)
|
||||||
|
|
||||||
../../libexec/$(PROG): $(PROG)
|
../../libexec/$(PROG): $(PROG)
|
||||||
|
@@ -534,6 +534,11 @@ static void qmgr_message_resolve(QMGR_MESSAGE *message)
|
|||||||
if (!STREQ(recipient->address, STR(reply.recipient)))
|
if (!STREQ(recipient->address, STR(reply.recipient)))
|
||||||
UPDATE(recipient->address, STR(reply.recipient));
|
UPDATE(recipient->address, STR(reply.recipient));
|
||||||
}
|
}
|
||||||
|
if (recipient->address[0] == 0) {
|
||||||
|
qmgr_bounce_recipient(message, recipient,
|
||||||
|
"null recipient address");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* XXX The nexthop destination is also used as lookup key for the
|
* XXX The nexthop destination is also used as lookup key for the
|
||||||
|
@@ -8,7 +8,7 @@ WARN = -W -Wformat -Wimplicit -Wmissing-prototypes \
|
|||||||
-Wunused
|
-Wunused
|
||||||
DEFS = -I. -I$(INC_DIR) -D$(SYSTYPE)
|
DEFS = -I. -I$(INC_DIR) -D$(SYSTYPE)
|
||||||
CFLAGS = $(DEBUG) $(OPT) $(DEFS)
|
CFLAGS = $(DEBUG) $(OPT) $(DEFS)
|
||||||
TESTPROG= qmqpd_token qmqpd_check
|
TESTPROG=
|
||||||
PROG = qmqpd
|
PROG = qmqpd
|
||||||
INC_DIR = ../../include
|
INC_DIR = ../../include
|
||||||
LIBS = ../../lib/libmaster.a ../../lib/libglobal.a ../../lib/libdns.a ../../lib/libutil.a
|
LIBS = ../../lib/libmaster.a ../../lib/libglobal.a ../../lib/libdns.a ../../lib/libutil.a
|
||||||
@@ -23,6 +23,8 @@ Makefile: Makefile.in
|
|||||||
|
|
||||||
test: $(TESTPROG)
|
test: $(TESTPROG)
|
||||||
|
|
||||||
|
tests: test
|
||||||
|
|
||||||
update: ../../libexec/$(PROG)
|
update: ../../libexec/$(PROG)
|
||||||
|
|
||||||
../../libexec/$(PROG): $(PROG)
|
../../libexec/$(PROG): $(PROG)
|
||||||
@@ -64,8 +66,6 @@ depend: $(MAKES)
|
|||||||
done) | grep -v '[.][o][:][ ][/]' >$$$$ && mv $$$$ Makefile.in
|
done) | grep -v '[.][o][:][ ][/]' >$$$$ && mv $$$$ Makefile.in
|
||||||
@$(EXPORT) make -f Makefile.in Makefile 1>&2
|
@$(EXPORT) make -f Makefile.in Makefile 1>&2
|
||||||
|
|
||||||
tests:
|
|
||||||
|
|
||||||
# do not edit below this line - it is generated by 'make depend'
|
# do not edit below this line - it is generated by 'make depend'
|
||||||
qmqpd.o: qmqpd.c
|
qmqpd.o: qmqpd.c
|
||||||
qmqpd.o: ../../include/sys_defs.h
|
qmqpd.o: ../../include/sys_defs.h
|
||||||
|
@@ -23,6 +23,8 @@ Makefile: Makefile.in
|
|||||||
|
|
||||||
test: $(TESTPROG)
|
test: $(TESTPROG)
|
||||||
|
|
||||||
|
tests: test
|
||||||
|
|
||||||
update: ../../bin/$(PROG)
|
update: ../../bin/$(PROG)
|
||||||
|
|
||||||
../../bin/$(PROG): $(PROG)
|
../../bin/$(PROG): $(PROG)
|
||||||
|
@@ -379,10 +379,8 @@ static void enqueue(const int flags, const char *encoding, const char *sender,
|
|||||||
* pickup would not be able to run chrooted, and it may not be desirable
|
* pickup would not be able to run chrooted, and it may not be desirable
|
||||||
* to use login names at all.
|
* to use login names at all.
|
||||||
*/
|
*/
|
||||||
#define NO_TOKEN_LIMIT 0
|
|
||||||
|
|
||||||
if (sender != 0) {
|
if (sender != 0) {
|
||||||
tree = tok822_parse(sender, NO_TOKEN_LIMIT);
|
tree = tok822_parse(sender);
|
||||||
for (naddr = 0, tp = tree; tp != 0; tp = tp->next)
|
for (naddr = 0, tp = tree; tp != 0; tp = tp->next)
|
||||||
if (tp->type == TOK822_ADDR)
|
if (tp->type == TOK822_ADDR)
|
||||||
naddr++, tok822_internalize(buf, tp->head, TOK822_STR_DEFL);
|
naddr++, tok822_internalize(buf, tp->head, TOK822_STR_DEFL);
|
||||||
@@ -435,7 +433,7 @@ static void enqueue(const int flags, const char *encoding, const char *sender,
|
|||||||
rec_fputs(dst, REC_TYPE_VERP, verp_delims);
|
rec_fputs(dst, REC_TYPE_VERP, verp_delims);
|
||||||
if (recipients) {
|
if (recipients) {
|
||||||
for (cpp = recipients; *cpp != 0; cpp++) {
|
for (cpp = recipients; *cpp != 0; cpp++) {
|
||||||
tree = tok822_parse(*cpp, NO_TOKEN_LIMIT);
|
tree = tok822_parse(*cpp);
|
||||||
for (tp = tree; tp != 0; tp = tp->next) {
|
for (tp = tree; tp != 0; tp = tp->next) {
|
||||||
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);
|
||||||
|
@@ -23,6 +23,8 @@ Makefile: Makefile.in
|
|||||||
|
|
||||||
test: $(TESTPROG)
|
test: $(TESTPROG)
|
||||||
|
|
||||||
|
tests: test
|
||||||
|
|
||||||
update: ../../libexec/$(PROG)
|
update: ../../libexec/$(PROG)
|
||||||
|
|
||||||
../../libexec/$(PROG): $(PROG)
|
../../libexec/$(PROG): $(PROG)
|
||||||
|
@@ -27,6 +27,8 @@ Makefile: Makefile.in
|
|||||||
|
|
||||||
test: $(TESTPROG)
|
test: $(TESTPROG)
|
||||||
|
|
||||||
|
tests: test
|
||||||
|
|
||||||
update: ../../libexec/$(PROG)
|
update: ../../libexec/$(PROG)
|
||||||
|
|
||||||
../../libexec/$(PROG): $(PROG)
|
../../libexec/$(PROG): $(PROG)
|
||||||
|
@@ -196,7 +196,7 @@ smtpd_check.o: ../../include/mail_conf.h
|
|||||||
smtpd_check.o: ../../include/maps.h
|
smtpd_check.o: ../../include/maps.h
|
||||||
smtpd_check.o: ../../include/mail_addr_find.h
|
smtpd_check.o: ../../include/mail_addr_find.h
|
||||||
smtpd_check.o: ../../include/match_parent_style.h
|
smtpd_check.o: ../../include/match_parent_style.h
|
||||||
smtpd_check.o: ../../include/split_addr.h
|
smtpd_check.o: ../../include/strip_addr.h
|
||||||
smtpd_check.o: smtpd.h
|
smtpd_check.o: smtpd.h
|
||||||
smtpd_check.o: ../../include/mail_stream.h
|
smtpd_check.o: ../../include/mail_stream.h
|
||||||
smtpd_check.o: smtpd_sasl_glue.h
|
smtpd_check.o: smtpd_sasl_glue.h
|
||||||
|
@@ -591,17 +591,15 @@ static char *extract_addr(SMTPD_STATE *state, SMTPD_TOKEN *arg,
|
|||||||
* XXX We have only one address parser, written according to the rules of
|
* XXX We have only one address parser, written according to the rules of
|
||||||
* RFC 822. That standard differs subtly from RFC 821.
|
* RFC 822. That standard differs subtly from RFC 821.
|
||||||
*/
|
*/
|
||||||
#define NO_TOKEN_LIMIT 0
|
|
||||||
|
|
||||||
if (msg_verbose)
|
if (msg_verbose)
|
||||||
msg_info("%s: input: %s", myname, STR(arg->vstrval));
|
msg_info("%s: input: %s", myname, STR(arg->vstrval));
|
||||||
if (STR(arg->vstrval)[0] == '<'
|
if (STR(arg->vstrval)[0] == '<'
|
||||||
&& STR(arg->vstrval)[LEN(arg->vstrval) - 1] == '>') {
|
&& STR(arg->vstrval)[LEN(arg->vstrval) - 1] == '>') {
|
||||||
junk = mystrndup(STR(arg->vstrval) + 1, LEN(arg->vstrval) - 2);
|
junk = mystrndup(STR(arg->vstrval) + 1, LEN(arg->vstrval) - 2);
|
||||||
tree = tok822_parse(junk, NO_TOKEN_LIMIT);
|
tree = tok822_parse(junk);
|
||||||
myfree(junk);
|
myfree(junk);
|
||||||
} else
|
} else
|
||||||
tree = tok822_parse(STR(arg->vstrval), NO_TOKEN_LIMIT);
|
tree = tok822_parse(STR(arg->vstrval));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find trouble.
|
* Find trouble.
|
||||||
|
@@ -78,9 +78,17 @@ mail bad-sender@ok.domain
|
|||||||
recipient_restrictions hash:./smtpd_check_access
|
recipient_restrictions hash:./smtpd_check_access
|
||||||
# Expect: REJECT
|
# Expect: REJECT
|
||||||
rcpt reject@dunno.domain
|
rcpt reject@dunno.domain
|
||||||
|
# Expect: REJECT
|
||||||
|
recipient_delimiter +
|
||||||
|
rcpt reject+ext@dunno.domain
|
||||||
|
recipient_delimiter |
|
||||||
# Expect: OK
|
# Expect: OK
|
||||||
rcpt ok@dunno.domain
|
rcpt ok@dunno.domain
|
||||||
# Expect: OK
|
# Expect: OK
|
||||||
|
recipient_delimiter +
|
||||||
|
rcpt ok+ext@dunno.domain
|
||||||
|
recipient_delimiter |
|
||||||
|
# Expect: OK
|
||||||
rcpt anyone@dunno.domain
|
rcpt anyone@dunno.domain
|
||||||
# Expect: OK
|
# Expect: OK
|
||||||
rcpt bad-sender@dunno.domain
|
rcpt bad-sender@dunno.domain
|
||||||
|
@@ -121,10 +121,25 @@ OK
|
|||||||
>>> rcpt reject@dunno.domain
|
>>> rcpt reject@dunno.domain
|
||||||
./smtpd_check: reject: RCPT from bar.duno.com[44.33.44.33]: 554 <reject@dunno.domain>: Recipient address rejected: Access denied; from=<bad-sender@ok.domain> to=<reject@dunno.domain>
|
./smtpd_check: reject: RCPT from bar.duno.com[44.33.44.33]: 554 <reject@dunno.domain>: Recipient address rejected: Access denied; from=<bad-sender@ok.domain> to=<reject@dunno.domain>
|
||||||
554 <reject@dunno.domain>: Recipient address rejected: Access denied
|
554 <reject@dunno.domain>: Recipient address rejected: Access denied
|
||||||
|
>>> # Expect: REJECT
|
||||||
|
>>> recipient_delimiter +
|
||||||
|
OK
|
||||||
|
>>> rcpt reject+ext@dunno.domain
|
||||||
|
./smtpd_check: reject: RCPT from bar.duno.com[44.33.44.33]: 554 <reject+ext@dunno.domain>: Recipient address rejected: Access denied; from=<bad-sender@ok.domain> to=<reject+ext@dunno.domain>
|
||||||
|
554 <reject+ext@dunno.domain>: Recipient address rejected: Access denied
|
||||||
|
>>> recipient_delimiter |
|
||||||
|
OK
|
||||||
>>> # Expect: OK
|
>>> # Expect: OK
|
||||||
>>> rcpt ok@dunno.domain
|
>>> rcpt ok@dunno.domain
|
||||||
OK
|
OK
|
||||||
>>> # Expect: OK
|
>>> # Expect: OK
|
||||||
|
>>> recipient_delimiter +
|
||||||
|
OK
|
||||||
|
>>> rcpt ok+ext@dunno.domain
|
||||||
|
OK
|
||||||
|
>>> recipient_delimiter |
|
||||||
|
OK
|
||||||
|
>>> # Expect: OK
|
||||||
>>> rcpt anyone@dunno.domain
|
>>> rcpt anyone@dunno.domain
|
||||||
OK
|
OK
|
||||||
>>> # Expect: OK
|
>>> # Expect: OK
|
||||||
|
@@ -290,7 +290,7 @@
|
|||||||
#include <maps.h>
|
#include <maps.h>
|
||||||
#include <mail_addr_find.h>
|
#include <mail_addr_find.h>
|
||||||
#include <match_parent_style.h>
|
#include <match_parent_style.h>
|
||||||
#include <split_addr.h>
|
#include <strip_addr.h>
|
||||||
|
|
||||||
/* Application-specific. */
|
/* Application-specific. */
|
||||||
|
|
||||||
@@ -1717,7 +1717,6 @@ static int check_mail_access(SMTPD_STATE *state, const char *table,
|
|||||||
int status;
|
int status;
|
||||||
char *local_at;
|
char *local_at;
|
||||||
char *bare_addr;
|
char *bare_addr;
|
||||||
char *bare_ext;
|
|
||||||
char *bare_at;
|
char *bare_at;
|
||||||
|
|
||||||
if (msg_verbose)
|
if (msg_verbose)
|
||||||
@@ -1745,19 +1744,7 @@ static int check_mail_access(SMTPD_STATE *state, const char *table,
|
|||||||
if (*var_rcpt_delim == 0) {
|
if (*var_rcpt_delim == 0) {
|
||||||
bare_addr = 0;
|
bare_addr = 0;
|
||||||
} else {
|
} else {
|
||||||
bare_addr = mystrdup(addr);
|
bare_addr = strip_addr(addr, (char **) 0, *var_rcpt_delim);
|
||||||
if ((bare_at = strrchr(bare_addr, '@')) != 0)
|
|
||||||
*bare_at = 0;
|
|
||||||
if ((bare_ext = split_addr(bare_addr, *var_rcpt_delim)) != 0) {
|
|
||||||
if (bare_at != 0) {
|
|
||||||
*bare_at = '@';
|
|
||||||
memmove(bare_ext - 1, bare_at, strlen(bare_at) + 1);
|
|
||||||
bare_at = bare_ext - 1;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
myfree(bare_addr);
|
|
||||||
bare_addr = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CHECK_MAIL_ACCESS_RETURN(x) \
|
#define CHECK_MAIL_ACCESS_RETURN(x) \
|
||||||
@@ -1824,6 +1811,7 @@ static int check_mail_access(SMTPD_STATE *state, const char *table,
|
|||||||
* Look up user@ if the address has an extension. XXX Same problem here.
|
* Look up user@ if the address has an extension. XXX Same problem here.
|
||||||
*/
|
*/
|
||||||
if (bare_addr) {
|
if (bare_addr) {
|
||||||
|
bare_at = strrchr(bare_addr, '@');
|
||||||
local_at = (bare_at ? mystrndup(bare_addr, bare_at + 1 - bare_addr) :
|
local_at = (bare_at ? mystrndup(bare_addr, bare_at + 1 - bare_addr) :
|
||||||
mystrdup(bare_addr));
|
mystrdup(bare_addr));
|
||||||
status = check_access(state, table, local_at, PARTIAL, found,
|
status = check_access(state, table, local_at, PARTIAL, found,
|
||||||
@@ -2623,6 +2611,7 @@ char *var_perm_mx_networks;
|
|||||||
char *var_par_dom_match;
|
char *var_par_dom_match;
|
||||||
char *var_smtpd_null_key;
|
char *var_smtpd_null_key;
|
||||||
char *var_smtpd_snd_auth_maps;
|
char *var_smtpd_snd_auth_maps;
|
||||||
|
char *var_double_bounce_sender;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *name;
|
char *name;
|
||||||
@@ -2648,6 +2637,7 @@ static STRING_TABLE string_table[] = {
|
|||||||
VAR_PAR_DOM_MATCH, DEF_PAR_DOM_MATCH, &var_par_dom_match,
|
VAR_PAR_DOM_MATCH, DEF_PAR_DOM_MATCH, &var_par_dom_match,
|
||||||
VAR_SMTPD_SND_AUTH_MAPS, DEF_SMTPD_SND_AUTH_MAPS, &var_smtpd_snd_auth_maps,
|
VAR_SMTPD_SND_AUTH_MAPS, DEF_SMTPD_SND_AUTH_MAPS, &var_smtpd_snd_auth_maps,
|
||||||
VAR_SMTPD_NULL_KEY, DEF_SMTPD_NULL_KEY, &var_smtpd_null_key,
|
VAR_SMTPD_NULL_KEY, DEF_SMTPD_NULL_KEY, &var_smtpd_null_key,
|
||||||
|
VAR_DOUBLE_BOUNCE, DEF_DOUBLE_BOUNCE, &var_double_bounce_sender,
|
||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -2812,10 +2802,10 @@ void resolve_clnt_free(RESOLVE_REPLY *reply)
|
|||||||
vstring_free(reply->recipient);
|
vstring_free(reply->recipient);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_SASL_AUTH
|
|
||||||
|
|
||||||
bool var_smtpd_sasl_enable = 0;
|
bool var_smtpd_sasl_enable = 0;
|
||||||
|
|
||||||
|
#ifdef USE_SASL_AUTH
|
||||||
|
|
||||||
/* smtpd_sasl_connect - stub */
|
/* smtpd_sasl_connect - stub */
|
||||||
|
|
||||||
void smtpd_sasl_connect(SMTPD_STATE *state)
|
void smtpd_sasl_connect(SMTPD_STATE *state)
|
||||||
|
@@ -34,6 +34,8 @@ qmqp-source: qmqp-source.o $(LIBS)
|
|||||||
|
|
||||||
test: $(TESTPROG)
|
test: $(TESTPROG)
|
||||||
|
|
||||||
|
tests: test
|
||||||
|
|
||||||
update: ../../bin/smtp-source ../../bin/smtp-sink ../../bin/qmqp-source
|
update: ../../bin/smtp-source ../../bin/smtp-sink ../../bin/qmqp-source
|
||||||
|
|
||||||
../../bin/smtp-source: smtp-source
|
../../bin/smtp-source: smtp-source
|
||||||
|
@@ -23,6 +23,8 @@ Makefile: Makefile.in
|
|||||||
|
|
||||||
test: $(TESTPROG)
|
test: $(TESTPROG)
|
||||||
|
|
||||||
|
tests: test
|
||||||
|
|
||||||
update: ../../libexec/$(PROG)
|
update: ../../libexec/$(PROG)
|
||||||
|
|
||||||
../../libexec/$(PROG): $(PROG)
|
../../libexec/$(PROG): $(PROG)
|
||||||
|
@@ -28,6 +28,8 @@ Makefile: Makefile.in
|
|||||||
|
|
||||||
test: $(TESTPROG)
|
test: $(TESTPROG)
|
||||||
|
|
||||||
|
tests: test
|
||||||
|
|
||||||
$(BIN_DIR)/$(PROG): $(PROG)
|
$(BIN_DIR)/$(PROG): $(PROG)
|
||||||
cp $(PROG) $@
|
cp $(PROG) $@
|
||||||
|
|
||||||
@@ -109,6 +111,7 @@ transport.o: ../../include/split_at.h
|
|||||||
transport.o: ../../include/dict.h
|
transport.o: ../../include/dict.h
|
||||||
transport.o: ../../include/vstream.h
|
transport.o: ../../include/vstream.h
|
||||||
transport.o: ../../include/argv.h
|
transport.o: ../../include/argv.h
|
||||||
|
transport.o: ../../include/strip_addr.h
|
||||||
transport.o: ../../include/mail_params.h
|
transport.o: ../../include/mail_params.h
|
||||||
transport.o: ../../include/maps.h
|
transport.o: ../../include/maps.h
|
||||||
transport.o: ../../include/match_parent_style.h
|
transport.o: ../../include/match_parent_style.h
|
||||||
|
@@ -134,13 +134,10 @@ void resolve_addr(char *addr, VSTRING *channel, VSTRING *nexthop,
|
|||||||
/*
|
/*
|
||||||
* A lone empty string becomes the postmaster.
|
* A lone empty string becomes the postmaster.
|
||||||
*/
|
*/
|
||||||
#define NO_TOKEN_LIMIT 0
|
|
||||||
|
|
||||||
if (tree->head == tree->tail && tree->head->type == TOK822_QSTRING
|
if (tree->head == tree->tail && tree->head->type == TOK822_QSTRING
|
||||||
&& VSTRING_LEN(tree->head->vstr) == 0) {
|
&& VSTRING_LEN(tree->head->vstr) == 0) {
|
||||||
tok822_free(tree->head);
|
tok822_free(tree->head);
|
||||||
tree->head = tok822_scan(MAIL_ADDR_POSTMASTER, &tree->tail,
|
tree->head = tok822_scan(MAIL_ADDR_POSTMASTER, &tree->tail);
|
||||||
NO_TOKEN_LIMIT);
|
|
||||||
rewrite_tree(REWRITE_CANON, tree);
|
rewrite_tree(REWRITE_CANON, tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,10 +193,9 @@ void resolve_addr(char *addr, VSTRING *channel, VSTRING *nexthop,
|
|||||||
if (saved_domain) {
|
if (saved_domain) {
|
||||||
tok822_sub_append(tree, saved_domain);
|
tok822_sub_append(tree, saved_domain);
|
||||||
saved_domain = 0;
|
saved_domain = 0;
|
||||||
} else {
|
} else if (tree->head) {
|
||||||
tok822_sub_append(tree, tok822_alloc('@', (char *) 0));
|
tok822_sub_append(tree, tok822_alloc('@', (char *) 0));
|
||||||
tok822_sub_append(tree, tok822_scan(var_myhostname, (TOK822 **) 0,
|
tok822_sub_append(tree, tok822_scan(var_myhostname, (TOK822 **) 0));
|
||||||
NO_TOKEN_LIMIT));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tok822_internalize(nextrcpt, tree, TOK822_STR_DEFL);
|
tok822_internalize(nextrcpt, tree, TOK822_STR_DEFL);
|
||||||
@@ -247,7 +243,7 @@ void resolve_addr(char *addr, VSTRING *channel, VSTRING *nexthop,
|
|||||||
* transport maps cannot return zero-length hostnames.
|
* transport maps cannot return zero-length hostnames.
|
||||||
*/
|
*/
|
||||||
if (*var_transport_maps)
|
if (*var_transport_maps)
|
||||||
transport_lookup(strrchr(STR(nextrcpt), '@') + 1, channel, nexthop);
|
transport_lookup(STR(nextrcpt), channel, nexthop);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Clean up.
|
* Clean up.
|
||||||
|
@@ -151,12 +151,9 @@ void rewrite_tree(char *unused_ruleset, TOK822 *tree)
|
|||||||
/*
|
/*
|
||||||
* Append missing @origin
|
* Append missing @origin
|
||||||
*/
|
*/
|
||||||
#define NO_TOKEN_LIMIT 0
|
|
||||||
|
|
||||||
else if (var_append_at_myorigin != 0) {
|
else if (var_append_at_myorigin != 0) {
|
||||||
domain = tok822_sub_append(tree, tok822_alloc('@', (char *) 0));
|
domain = tok822_sub_append(tree, tok822_alloc('@', (char *) 0));
|
||||||
tok822_sub_append(tree, tok822_scan(var_myorigin, (TOK822 **) 0,
|
tok822_sub_append(tree, tok822_scan(var_myorigin, (TOK822 **) 0));
|
||||||
NO_TOKEN_LIMIT));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,8 +165,7 @@ void rewrite_tree(char *unused_ruleset, TOK822 *tree)
|
|||||||
&& tok822_find_type(domain, TOK822_DOMLIT) == 0
|
&& tok822_find_type(domain, TOK822_DOMLIT) == 0
|
||||||
&& tok822_find_type(domain, '.') == 0) {
|
&& tok822_find_type(domain, '.') == 0) {
|
||||||
tok822_sub_append(tree, tok822_alloc('.', (char *) 0));
|
tok822_sub_append(tree, tok822_alloc('.', (char *) 0));
|
||||||
tok822_sub_append(tree, tok822_scan(var_mydomain, (TOK822 **) 0,
|
tok822_sub_append(tree, tok822_scan(var_mydomain, (TOK822 **) 0));
|
||||||
NO_TOKEN_LIMIT));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -8,13 +8,13 @@
|
|||||||
/*
|
/*
|
||||||
/* void transport_init()
|
/* void transport_init()
|
||||||
/*
|
/*
|
||||||
/* int transport_lookup(domain, channel, nexthop)
|
/* int transport_lookup(address, channel, nexthop)
|
||||||
/* const char *domain;
|
/* const char *address;
|
||||||
/* VSTRING *channel;
|
/* VSTRING *channel;
|
||||||
/* VSTRING *nexthop;
|
/* VSTRING *nexthop;
|
||||||
/* DESCRIPTION
|
/* DESCRIPTION
|
||||||
/* This module implements access to the table that maps transport
|
/* This module implements access to the table that maps transport
|
||||||
/* domains to (channel, nexthop) tuples.
|
/* user@domain addresses to (channel, nexthop) tuples.
|
||||||
/*
|
/*
|
||||||
/* transport_init() performs initializations that should be
|
/* transport_init() performs initializations that should be
|
||||||
/* done before the process enters the chroot jail, and
|
/* done before the process enters the chroot jail, and
|
||||||
@@ -28,6 +28,7 @@
|
|||||||
/* should be tried again.
|
/* should be tried again.
|
||||||
/* SEE ALSO
|
/* SEE ALSO
|
||||||
/* maps(3), multi-dictionary search
|
/* maps(3), multi-dictionary search
|
||||||
|
/* strip_addr(3), strip extension from address
|
||||||
/* transport(5), format of transport map
|
/* transport(5), format of transport map
|
||||||
/* FILES
|
/* FILES
|
||||||
/* /etc/postfix/transport*
|
/* /etc/postfix/transport*
|
||||||
@@ -60,6 +61,7 @@
|
|||||||
|
|
||||||
/* Global library. */
|
/* Global library. */
|
||||||
|
|
||||||
|
#include <strip_addr.h>
|
||||||
#include <mail_params.h>
|
#include <mail_params.h>
|
||||||
#include <maps.h>
|
#include <maps.h>
|
||||||
#include <match_parent_style.h>
|
#include <match_parent_style.h>
|
||||||
@@ -104,11 +106,24 @@ void transport_wildcard_init(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* check_maps_find - map lookup with extreme prejudice */
|
||||||
|
|
||||||
|
static const char *check_maps_find(MAPS *maps, const char *key, int flags)
|
||||||
|
{
|
||||||
|
const char *value;
|
||||||
|
|
||||||
|
if ((value = maps_find(maps, key, flags)) == 0 && dict_errno != 0)
|
||||||
|
msg_fatal("transport table lookup problem.");
|
||||||
|
return (value);
|
||||||
|
}
|
||||||
|
|
||||||
/* transport_lookup - map a transport domain */
|
/* transport_lookup - map a transport domain */
|
||||||
|
|
||||||
int transport_lookup(const char *domain, VSTRING *channel, VSTRING *nexthop)
|
int transport_lookup(const char *addr, VSTRING *channel, VSTRING *nexthop)
|
||||||
{
|
{
|
||||||
char *low_domain = lowercase(mystrdup(domain));
|
char *full_addr = lowercase(mystrdup(*addr ? addr : var_xport_null_key));
|
||||||
|
char *stripped_addr = 0;
|
||||||
|
char *ratsign = 0;
|
||||||
const char *name;
|
const char *name;
|
||||||
const char *next;
|
const char *next;
|
||||||
const char *value;
|
const char *value;
|
||||||
@@ -119,51 +134,102 @@ int transport_lookup(const char *domain, VSTRING *channel, VSTRING *nexthop)
|
|||||||
|
|
||||||
#define FULL 0
|
#define FULL 0
|
||||||
#define PARTIAL DICT_FLAG_FIXED
|
#define PARTIAL DICT_FLAG_FIXED
|
||||||
|
#define STRNE strcmp
|
||||||
int maps_flag = FULL;
|
#define DISCARD_EXTENSION ((char **) 0)
|
||||||
|
|
||||||
if (transport_path == 0)
|
if (transport_path == 0)
|
||||||
msg_panic("transport_lookup: missing initialization");
|
msg_panic("transport_lookup: missing initialization");
|
||||||
|
|
||||||
|
if (STRNE(full_addr, var_xport_null_key) && STRNE(full_addr, "*"))
|
||||||
|
if ((ratsign = strrchr(full_addr, '@')) == 0)
|
||||||
|
msg_panic("transport_lookup: bad address: \"%s\"", full_addr);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
* Look up the full address with the FULL flag to include regexp maps in
|
||||||
|
* the query.
|
||||||
|
*/
|
||||||
|
if ((value = check_maps_find(transport_path, full_addr, FULL)) != 0) {
|
||||||
|
found = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If this is a special address such as <> or *, not user@domain, then we
|
||||||
|
* are done now.
|
||||||
|
*/
|
||||||
|
else if (ratsign == 0) {
|
||||||
|
found = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If the full address did not match, and there is an address extension,
|
||||||
|
* look up the stripped address with the PARTIAL flag to avoid matching
|
||||||
|
* partial lookup keys with regular expressions.
|
||||||
|
*/
|
||||||
|
else if ((stripped_addr = strip_addr(full_addr, DISCARD_EXTENSION,
|
||||||
|
*var_rcpt_delim)) != 0
|
||||||
|
&& (value = check_maps_find(transport_path, stripped_addr,
|
||||||
|
PARTIAL)) != 0) {
|
||||||
|
found = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If the full and stripped address lookup fails, try domain name lookup.
|
||||||
|
*
|
||||||
* Keep stripping domain components until nothing is left or until a
|
* Keep stripping domain components until nothing is left or until a
|
||||||
* matching entry is found.
|
* matching entry is found.
|
||||||
*
|
*
|
||||||
* If the entry specifies no nexthop host and/or delivery channel, do not
|
* After checking the full domain name, check for .upper.domain, to
|
||||||
* change caller-provided information.
|
* distinguish between the parent domain and it's decendants, a la
|
||||||
*
|
* sendmail and tcp wrappers.
|
||||||
* If we find no match, then return the wildcard entry, if any.
|
|
||||||
*
|
|
||||||
* After checking the full name, check for .upper.domain, to distinguish
|
|
||||||
* between the upper domain and it's decendants, ala sendmail and tcp
|
|
||||||
* wrappers.
|
|
||||||
*
|
*
|
||||||
* Before changing the DB lookup result, make a copy first, in order to
|
* Before changing the DB lookup result, make a copy first, in order to
|
||||||
* avoid DB cache corruption.
|
* avoid DB cache corruption.
|
||||||
*
|
*
|
||||||
* Specify if a key is partial or full, to avoid matching partial keys with
|
* Specify that the lookup key is partial, to avoid matching partial keys
|
||||||
* regular expressions.
|
* with regular expressions.
|
||||||
*/
|
*/
|
||||||
for (name = low_domain; /* void */ ; name = next) {
|
else if (found == 0) {
|
||||||
if ((value = maps_find(transport_path, name, maps_flag)) != 0) {
|
for (name = ratsign + 1; /* void */ ; name = next) {
|
||||||
saved_value = mystrdup(value);
|
if ((value = maps_find(transport_path, name, PARTIAL)) != 0) {
|
||||||
if ((host = split_at(saved_value, ':')) != 0 && *host != 0)
|
found = 1;
|
||||||
vstring_strcpy(nexthop, host);
|
break;
|
||||||
if (*(transport = saved_value) != 0)
|
}
|
||||||
vstring_strcpy(channel, transport);
|
if ((next = strchr(name + 1, '.')) == 0)
|
||||||
myfree(saved_value);
|
break;
|
||||||
found = 1;
|
if (transport_match_parent_style == MATCH_FLAG_PARENT)
|
||||||
break;
|
next++;
|
||||||
} else if (dict_errno != 0) {
|
|
||||||
msg_fatal("transport table lookup problem");
|
|
||||||
}
|
}
|
||||||
if ((next = strchr(name + 1, '.')) == 0)
|
|
||||||
break;
|
|
||||||
if (transport_match_parent_style == MATCH_FLAG_PARENT)
|
|
||||||
next++;
|
|
||||||
maps_flag = PARTIAL;
|
|
||||||
}
|
}
|
||||||
myfree(low_domain);
|
|
||||||
|
/*
|
||||||
|
* XXX user+ext@ and user@ lookups for domains that resolve locally?
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We found an answer in the transport table. Use the results to
|
||||||
|
* override transport and/or next-hop information.
|
||||||
|
*/
|
||||||
|
if (found == 1) {
|
||||||
|
saved_value = mystrdup(value);
|
||||||
|
if ((host = split_at(saved_value, ':')) != 0 && *host != 0) {
|
||||||
|
#if 0
|
||||||
|
if (strchr(host, '@'))
|
||||||
|
vstring_strcpy(recipient, host);
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
vstring_strcpy(nexthop, host);
|
||||||
|
}
|
||||||
|
if (*(transport = saved_value) != 0)
|
||||||
|
vstring_strcpy(channel, transport);
|
||||||
|
myfree(saved_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Clean up.
|
||||||
|
*/
|
||||||
|
myfree(full_addr);
|
||||||
|
if (stripped_addr)
|
||||||
|
myfree(stripped_addr);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fall back to the wild-card entry.
|
* Fall back to the wild-card entry.
|
||||||
|
@@ -111,6 +111,8 @@
|
|||||||
/* .IP \fBtransport_maps\fR
|
/* .IP \fBtransport_maps\fR
|
||||||
/* List of tables with \fIdomain\fR to (\fItransport, nexthop\fR)
|
/* List of tables with \fIdomain\fR to (\fItransport, nexthop\fR)
|
||||||
/* mappings.
|
/* mappings.
|
||||||
|
/* .IP \fBtransport_null_address_lookup_key\fR
|
||||||
|
/* Lookup key to be used for the null address.
|
||||||
/* SEE ALSO
|
/* SEE ALSO
|
||||||
/* master(8) process manager
|
/* master(8) process manager
|
||||||
/* syslogd(8) system logging
|
/* syslogd(8) system logging
|
||||||
@@ -174,6 +176,7 @@ bool var_append_at_myorigin;
|
|||||||
bool var_percent_hack;
|
bool var_percent_hack;
|
||||||
char *var_local_transport;
|
char *var_local_transport;
|
||||||
int var_resolve_dequoted;
|
int var_resolve_dequoted;
|
||||||
|
char *var_xport_null_key;
|
||||||
|
|
||||||
/* rewrite_service - read request and send reply */
|
/* rewrite_service - read request and send reply */
|
||||||
|
|
||||||
@@ -239,6 +242,7 @@ int main(int argc, char **argv)
|
|||||||
static CONFIG_STR_TABLE str_table[] = {
|
static CONFIG_STR_TABLE str_table[] = {
|
||||||
VAR_TRANSPORT_MAPS, DEF_TRANSPORT_MAPS, &var_transport_maps, 0, 0,
|
VAR_TRANSPORT_MAPS, DEF_TRANSPORT_MAPS, &var_transport_maps, 0, 0,
|
||||||
VAR_LOCAL_TRANSPORT, DEF_LOCAL_TRANSPORT, &var_local_transport, 0, 0,
|
VAR_LOCAL_TRANSPORT, DEF_LOCAL_TRANSPORT, &var_local_transport, 0, 0,
|
||||||
|
VAR_XPORT_NULL_KEY, DEF_XPORT_NULL_KEY, &var_xport_null_key, 1, 0,
|
||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
static CONFIG_BOOL_TABLE bool_table[] = {
|
static CONFIG_BOOL_TABLE bool_table[] = {
|
||||||
|
@@ -23,6 +23,8 @@ Makefile: Makefile.in
|
|||||||
|
|
||||||
test: $(TESTPROG)
|
test: $(TESTPROG)
|
||||||
|
|
||||||
|
tests: test
|
||||||
|
|
||||||
update: ../../libexec/$(PROG)
|
update: ../../libexec/$(PROG)
|
||||||
|
|
||||||
../../libexec/$(PROG): $(PROG)
|
../../libexec/$(PROG): $(PROG)
|
||||||
|
Reference in New Issue
Block a user