diff --git a/postfix/.indent.pro b/postfix/.indent.pro
index b38eded21..715b1fb48 100644
--- a/postfix/.indent.pro
+++ b/postfix/.indent.pro
@@ -35,6 +35,7 @@
-TEXPAND_ATTR
-TFILE
-TFORWARD_INFO
+-TFW_CONTEXT
-THEADER_OPTS
-THTABLE
-THTABLE_INFO
diff --git a/postfix/HISTORY b/postfix/HISTORY
index fa3b5c41d..d086c75c6 100644
--- a/postfix/HISTORY
+++ b/postfix/HISTORY
@@ -2413,6 +2413,17 @@ Apologies for any names omitted.
and would go through .forward again). Problem reported by
Roman Dolejsi, Prague University of Economics.
+19990324
+
+ Bugfix: missing map name in check_xxx_access restrictions
+ could casue a segmentation error. Lamont Jones, Hewlett-
+ Packard.
+
+ Feature: forward_path configuration parameter (default:
+ $home/.forward$recipient_delimiter$extension,$home/.forward).
+ Based on initial code by Philip A. Prindeville, Mirapoint,
+ Inc., USA. Files: local/dotforward.c.
+
Future:
Planned: must be able to list the same hash table in
diff --git a/postfix/bounce/.indent.pro b/postfix/bounce/.indent.pro
index b38eded21..715b1fb48 100644
--- a/postfix/bounce/.indent.pro
+++ b/postfix/bounce/.indent.pro
@@ -35,6 +35,7 @@
-TEXPAND_ATTR
-TFILE
-TFORWARD_INFO
+-TFW_CONTEXT
-THEADER_OPTS
-THTABLE
-THTABLE_INFO
diff --git a/postfix/cleanup/.indent.pro b/postfix/cleanup/.indent.pro
index b38eded21..715b1fb48 100644
--- a/postfix/cleanup/.indent.pro
+++ b/postfix/cleanup/.indent.pro
@@ -35,6 +35,7 @@
-TEXPAND_ATTR
-TFILE
-TFORWARD_INFO
+-TFW_CONTEXT
-THEADER_OPTS
-THTABLE
-THTABLE_INFO
diff --git a/postfix/conf/postfix-script-nosgid b/postfix/conf/postfix-script-nosgid
index f46984aae..41a59bb88 100755
--- a/postfix/conf/postfix-script-nosgid
+++ b/postfix/conf/postfix-script-nosgid
@@ -165,7 +165,7 @@ check)
-exec $WARN not owned by root: {} \;
find $daemon_directory/. $config_directory/. \
- \( -perm -020 -or -perm -002 \) \
+ \( -perm -020 -o -perm -002 \) \
-exec $WARN group or other writable: {} \;
find $queue_directory/* $config_directory/* -name '*core' \
diff --git a/postfix/conf/postfix-script-sgid b/postfix/conf/postfix-script-sgid
index f6ddf6f19..56fdb263b 100755
--- a/postfix/conf/postfix-script-sgid
+++ b/postfix/conf/postfix-script-sgid
@@ -165,7 +165,7 @@ check)
-exec $WARN not owned by root: {} \;
find $daemon_directory/. $config_directory/. \
- \( -perm -020 -or -perm -002 \) \
+ \( -perm -020 -o -perm -002 \) \
-exec $WARN group or other writable: {} \;
find $queue_directory/* $config_directory/* -name '*core' \
diff --git a/postfix/dns/.indent.pro b/postfix/dns/.indent.pro
index b38eded21..715b1fb48 100644
--- a/postfix/dns/.indent.pro
+++ b/postfix/dns/.indent.pro
@@ -35,6 +35,7 @@
-TEXPAND_ATTR
-TFILE
-TFORWARD_INFO
+-TFW_CONTEXT
-THEADER_OPTS
-THTABLE
-THTABLE_INFO
diff --git a/postfix/fsstone/.indent.pro b/postfix/fsstone/.indent.pro
index b38eded21..715b1fb48 100644
--- a/postfix/fsstone/.indent.pro
+++ b/postfix/fsstone/.indent.pro
@@ -35,6 +35,7 @@
-TEXPAND_ATTR
-TFILE
-TFORWARD_INFO
+-TFW_CONTEXT
-THEADER_OPTS
-THTABLE
-THTABLE_INFO
diff --git a/postfix/global/.indent.pro b/postfix/global/.indent.pro
index b38eded21..715b1fb48 100644
--- a/postfix/global/.indent.pro
+++ b/postfix/global/.indent.pro
@@ -35,6 +35,7 @@
-TEXPAND_ATTR
-TFILE
-TFORWARD_INFO
+-TFW_CONTEXT
-THEADER_OPTS
-THTABLE
-THTABLE_INFO
diff --git a/postfix/global/mail_params.h b/postfix/global/mail_params.h
index b18de0e08..ef3f83f60 100644
--- a/postfix/global/mail_params.h
+++ b/postfix/global/mail_params.h
@@ -306,7 +306,7 @@ extern char *var_fallback_transport;
* Local delivery: path to per-user forwarding file.
*/
#define VAR_FORWARD_PATH "forward_path"
-#define DEF_FORWARD_PATH "$home/.forward"
+#define DEF_FORWARD_PATH "$home/.forward${recipient_delimiter}${extension},$home/.forward"
extern char *var_forward_path;
#define VAR_RCPT_DELIM "recipient_delimiter"
diff --git a/postfix/global/mail_version.h b/postfix/global/mail_version.h
index d1240368d..55012855b 100644
--- a/postfix/global/mail_version.h
+++ b/postfix/global/mail_version.h
@@ -15,7 +15,7 @@
* Version of this program.
*/
#define VAR_MAIL_VERSION "mail_version"
-#define DEF_MAIL_VERSION "Snapshot-19990323"
+#define DEF_MAIL_VERSION "Snapshot-19990324"
extern char *var_mail_version;
/* LICENSE
diff --git a/postfix/html/local.8.html b/postfix/html/local.8.html
index dbc3cffcc..3b06a2cec 100644
--- a/postfix/html/local.8.html
+++ b/postfix/html/local.8.html
@@ -252,11 +252,11 @@ LOCAL(8) LOCAL(8)
alias_maps
List of alias databases.
- local_command_shell
- Shell to use for external command execution (for
- example, /some/where/smrsh -c). When a shell is
- specified, it is invoked even when the command con-
- tains no shell built-in commands or meta
+ forward_path
+ Search list for .forward files. The following
+ macros are recognized: $home (home directory),
+ $user (login name), $extension (address extension),
+ $recipient_delimiter (address extension delimiter).
@@ -269,7 +269,12 @@ LOCAL(8) LOCAL(8)
LOCAL(8) LOCAL(8)
- characters.
+ local_command_shell
+ Shell to use for external command execution (for
+ example, /some/where/smrsh -c). When a shell is
+ specified, it is invoked even when the command con-
+ tains no shell built-in commands or meta charac-
+ ters.
owner_request_special
Give special treatment to owner-xxx and xxx-request
@@ -319,11 +324,6 @@ LOCAL(8) LOCAL(8)
Time in seconds between successive attempts to
acquire an exclusive lock.
- stale_lock_time
- Limit the time after which a stale lock is removed.
-
-
-
5
@@ -335,6 +335,9 @@ LOCAL(8) LOCAL(8)
LOCAL(8) LOCAL(8)
+ stale_lock_time
+ Limit the time after which a stale lock is removed.
+
Resource controls
command_time_limit
Limit the amount of time for delivery to external
@@ -385,9 +388,6 @@ LOCAL(8) LOCAL(8)
syslogd(8) system logging
qmgr(8) queue manager
-LICENSE
- The Secure Mailer license must be distributed with this
- software.
@@ -401,6 +401,10 @@ LOCAL(8) LOCAL(8)
LOCAL(8) LOCAL(8)
+LICENSE
+ The Secure Mailer license must be distributed with this
+ software.
+
AUTHOR(S)
Wietse Venema
IBM T.J. Watson Research
@@ -449,10 +453,6 @@ LOCAL(8) LOCAL(8)
-
-
-
-
diff --git a/postfix/local/.indent.pro b/postfix/local/.indent.pro
index b38eded21..715b1fb48 100644
--- a/postfix/local/.indent.pro
+++ b/postfix/local/.indent.pro
@@ -35,6 +35,7 @@
-TEXPAND_ATTR
-TFILE
-TFORWARD_INFO
+-TFW_CONTEXT
-THEADER_OPTS
-THTABLE
-THTABLE_INFO
diff --git a/postfix/local/Makefile.in b/postfix/local/Makefile.in
index a1436e0ca..91c0f429e 100644
--- a/postfix/local/Makefile.in
+++ b/postfix/local/Makefile.in
@@ -152,10 +152,12 @@ dotforward.o: ../include/lstat_as.h
dotforward.o: ../include/iostuff.h
dotforward.o: ../include/stringops.h
dotforward.o: ../include/mymalloc.h
+dotforward.o: ../include/mac_parse.h
dotforward.o: ../include/mypwd.h
dotforward.o: ../include/bounce.h
dotforward.o: ../include/been_here.h
dotforward.o: ../include/mail_params.h
+dotforward.o: ../include/config.h
dotforward.o: local.h
dotforward.o: ../include/tok822.h
dotforward.o: ../include/resolve_clnt.h
diff --git a/postfix/local/dotforward.c b/postfix/local/dotforward.c
index 2c0f2c001..2544f3fe5 100644
--- a/postfix/local/dotforward.c
+++ b/postfix/local/dotforward.c
@@ -12,15 +12,11 @@
/* int *statusp;
/* DESCRIPTION
/* deliver_dotforward() delivers a message to the destinations
-/* listed in a recipient's $HOME/.forward file. The result is
-/* zero when no acceptable $HOME/.forward file was found, or when
+/* listed in a recipient's .forward file(s) as specified through
+/* the forward_path configuration parameter. The result is
+/* zero when no acceptable .forward file was found, or when
/* a recipient is listed in her own .forward file.
/*
-/* When mail is sent to an extended address (e.g., user+foo),
-/* the address extension is appended to the .forward file name
-/* (e.g., .forward+foo). When that file does not exist, .forward
-/* is used instead.
-/*
/* Arguments:
/* .IP state
/* Message delivery attributes (sender, recipient etc.).
@@ -71,6 +67,7 @@
#include
#include
#include
+#include
/* Global library. */
@@ -78,6 +75,7 @@
#include
#include
#include
+#include
/* Application-specific. */
@@ -86,6 +84,56 @@
#define NO 0
#define YES 1
+ /*
+ * A little helper structure for message-specific context.
+ */
+typedef struct {
+ int failures; /* $name not available */
+ struct mypasswd *pwd; /* recipient */
+ char *extension; /* address extension */
+ VSTRING *path; /* result */
+} FW_CONTEXT;
+
+/* dotforward_parse_callback - callback for mac_parse */
+
+static void dotforward_parse_callback(int type, VSTRING *buf, char *context)
+{
+ char *myname = "dotforward_parse_callback";
+ FW_CONTEXT *fw_context = (FW_CONTEXT *) context;
+ char *ptr;
+
+ /*
+ * Find out what data to substitute.
+ */
+ if (type == MAC_PARSE_VARNAME) {
+ if (strcmp(vstring_str(buf), "home") == 0)
+ ptr = fw_context->pwd->pw_dir;
+ else if (strcmp(vstring_str(buf), "user") == 0)
+ ptr = fw_context->pwd->pw_name;
+ else if (strcmp(vstring_str(buf), "extension") == 0)
+ ptr = fw_context->extension;
+ else if (strcmp(vstring_str(buf), "recipient_delimiter") == 0)
+ ptr = var_rcpt_delim;
+ else
+ msg_fatal("unknown macro $%s in %s", vstring_str(buf),
+ VAR_FORWARD_PATH);
+ } else {
+ ptr = vstring_str(buf);
+ }
+
+ /*
+ * Append the data, or record that the data was not available.
+ */
+ if (msg_verbose)
+ msg_info("%s: %s = %s", myname, vstring_str(buf),
+ ptr ? ptr : "(unavailable)");
+ if (ptr == 0) {
+ fw_context->failures++;
+ } else {
+ vstring_strcat(fw_context->path, ptr);
+ }
+}
+
/* deliver_dotforward - expand contents of .forward file */
int deliver_dotforward(LOCAL_STATE state, USER_ATTR usr_attr, int *statusp)
@@ -100,7 +148,11 @@ int deliver_dotforward(LOCAL_STATE state, USER_ATTR usr_attr, int *statusp)
int forward_found = NO;
int lookup_status;
int addr_count;
- char *extension;
+ char *saved_forward_path;
+ char *lhs;
+ char *next;
+ const char *forward_path;
+ FW_CONTEXT fw_context;
/*
* Make verbose logging easier to understand.
@@ -109,6 +161,16 @@ int deliver_dotforward(LOCAL_STATE state, USER_ATTR usr_attr, int *statusp)
if (msg_verbose)
MSG_LOG_STATE(myname, state);
+ /*
+ * Skip this module if per-user forwarding is disabled. XXX We need to
+ * extend the config_XXX() interface to request no expansion of $names in
+ * the given value or in the default value.
+ */
+ if ((forward_path = config_lookup(VAR_FORWARD_PATH)) == 0)
+ forward_path = DEF_FORWARD_PATH;
+ if (*forward_path == 0)
+ return (NO);
+
/*
* DUPLICATE/LOOP ELIMINATION
*
@@ -173,36 +235,36 @@ int deliver_dotforward(LOCAL_STATE state, USER_ATTR usr_attr, int *statusp)
* Assume that usernames do not have file system meta characters. Open
* the .forward file as the user. Ignore files that aren't regular files,
* files that are owned by the wrong user, or files that have world write
- * permission enabled. We take no special precautions to deal with home
- * directories imported via NFS, because mailbox and .forward files
- * should always be local to the host running the delivery process.
- * Anything else is just asking for trouble when a server goes down
- * (either the mailbox server or the home directory server).
- *
- * With mail to user+foo, try ~/.forward+foo before ~/.forward. Ignore foo
- * when it contains '/' or when forward+foo does not exist.
+ * permission enabled.
*/
#define STR(x) vstring_str(x)
status = 0;
path = vstring_alloc(100);
- extension = state.msg_attr.extension;
- if (extension && strchr(extension, '/')) {
- msg_warn("%s: address with illegal extension: %s",
- state.msg_attr.queue_id, state.msg_attr.recipient);
- extension = 0;
- }
- if (extension != 0) {
- vstring_sprintf(path, "%s/.forward%c%s", mypwd->pw_dir,
- var_rcpt_delim[0], extension);
- if ((lookup_status = lstat_as(STR(path), &st,
- usr_attr.uid, usr_attr.gid)) < 0)
- extension = 0;
- }
- if (extension == 0) {
- vstring_sprintf(path, "%s/.forward", mypwd->pw_dir);
- lookup_status = lstat_as(STR(path), &st, usr_attr.uid, usr_attr.gid);
+ saved_forward_path = mystrdup(forward_path);
+ next = saved_forward_path;
+
+ fw_context.pwd = mypwd;
+ fw_context.extension = state.msg_attr.extension;
+ fw_context.path = path;
+
+ lookup_status = -1;
+
+ while ((lhs = mystrtok(&next, ", \t\r\n")) != 0) {
+ fw_context.failures = 0;
+ VSTRING_RESET(path);
+ mac_parse(lhs, dotforward_parse_callback, (char *) &fw_context);
+ if (fw_context.failures == 0) {
+ lookup_status = lstat_as(STR(path), &st,
+ usr_attr.uid, usr_attr.gid);
+ if (msg_verbose)
+ msg_info("%s: path %s status %d", myname,
+ STR(path), lookup_status);
+ if (lookup_status >= 0)
+ break;
+ }
}
+
if (lookup_status >= 0) {
if (S_ISREG(st.st_mode) == 0) {
msg_warn("file %s is not a regular file", STR(path));
@@ -228,6 +290,7 @@ int deliver_dotforward(LOCAL_STATE state, USER_ATTR usr_attr, int *statusp)
* Clean up.
*/
vstring_free(path);
+ myfree(saved_forward_path);
mypwfree(mypwd);
*statusp = status;
diff --git a/postfix/local/local.c b/postfix/local/local.c
index 1daed8a35..8102e6846 100644
--- a/postfix/local/local.c
+++ b/postfix/local/local.c
@@ -212,6 +212,11 @@
/* .fi
/* .IP \fBalias_maps\fR
/* List of alias databases.
+/* .IP \fBforward_path\fR
+/* Search list for .forward files. The following macros are recognized:
+/* \fB$home\fR (home directory), \fB$user\fR (login name),
+/* \fB$extension\fR (address extension), \fB$recipient_delimiter\fR
+/* (address extension delimiter).
/* .IP \fBlocal_command_shell\fR
/* Shell to use for external command execution (for example,
/* /some/where/smrsh -c).
@@ -370,6 +375,7 @@ int var_biff;
char *var_mail_spool_dir;
char *var_mailbox_transport;
char *var_fallback_transport;
+char *var_forward_path;
int local_cmd_deliver_mask;
int local_file_deliver_mask;
@@ -535,6 +541,15 @@ int main(int argc, char **argv)
0,
};
+ /*
+ * XXX We need to extend the config_XXX() interface to request no $name
+ * expansion in a given value or in the default value.
+ */
+ static CONFIG_STR_TABLE straight_str_table[] = {
+ VAR_FORWARD_PATH, DEF_FORWARD_PATH, &var_forward_path, 0, 0,
+ 0,
+ };
+
single_server_main(argc, argv, local_service,
MAIL_SERVER_INT_TABLE, int_table,
MAIL_SERVER_STR_TABLE, str_table,
diff --git a/postfix/local/recipient.c b/postfix/local/recipient.c
index 5ee0836fd..fd09619c8 100644
--- a/postfix/local/recipient.c
+++ b/postfix/local/recipient.c
@@ -127,6 +127,11 @@ static int deliver_switch(LOCAL_STATE state, USER_ATTR usr_attr)
if (*var_rcpt_delim)
state.msg_attr.extension =
split_addr(state.msg_attr.local, *var_rcpt_delim);
+ if (state.msg_attr.extension && strchr(state.msg_attr.extension, '/')) {
+ msg_warn("%s: address with illegal extension: %s",
+ state.msg_attr.queue_id, state.msg_attr.recipient);
+ state.msg_attr.extension = 0;
+ }
if (state.msg_attr.extension && deliver_alias(state, usr_attr, &status))
return (status);
diff --git a/postfix/man/man8/local.8 b/postfix/man/man8/local.8
index d16dbd529..1f5215778 100644
--- a/postfix/man/man8/local.8
+++ b/postfix/man/man8/local.8
@@ -240,6 +240,11 @@ a configuration change.
.fi
.IP \fBalias_maps\fR
List of alias databases.
+.IP \fBforward_path\fR
+Search list for .forward files. The following macros are recognized:
+\fB$home\fR (home directory), \fB$user\fR (login name),
+\fB$extension\fR (address extension), \fB$recipient_delimiter\fR
+(address extension delimiter).
.IP \fBlocal_command_shell\fR
Shell to use for external command execution (for example,
/some/where/smrsh -c).
diff --git a/postfix/master/.indent.pro b/postfix/master/.indent.pro
index b38eded21..715b1fb48 100644
--- a/postfix/master/.indent.pro
+++ b/postfix/master/.indent.pro
@@ -35,6 +35,7 @@
-TEXPAND_ATTR
-TFILE
-TFORWARD_INFO
+-TFW_CONTEXT
-THEADER_OPTS
-THTABLE
-THTABLE_INFO
diff --git a/postfix/pickup/.indent.pro b/postfix/pickup/.indent.pro
index b38eded21..715b1fb48 100644
--- a/postfix/pickup/.indent.pro
+++ b/postfix/pickup/.indent.pro
@@ -35,6 +35,7 @@
-TEXPAND_ATTR
-TFILE
-TFORWARD_INFO
+-TFW_CONTEXT
-THEADER_OPTS
-THTABLE
-THTABLE_INFO
diff --git a/postfix/pipe/.indent.pro b/postfix/pipe/.indent.pro
index b38eded21..715b1fb48 100644
--- a/postfix/pipe/.indent.pro
+++ b/postfix/pipe/.indent.pro
@@ -35,6 +35,7 @@
-TEXPAND_ATTR
-TFILE
-TFORWARD_INFO
+-TFW_CONTEXT
-THEADER_OPTS
-THTABLE
-THTABLE_INFO
diff --git a/postfix/postalias/.indent.pro b/postfix/postalias/.indent.pro
index b38eded21..715b1fb48 100644
--- a/postfix/postalias/.indent.pro
+++ b/postfix/postalias/.indent.pro
@@ -35,6 +35,7 @@
-TEXPAND_ATTR
-TFILE
-TFORWARD_INFO
+-TFW_CONTEXT
-THEADER_OPTS
-THTABLE
-THTABLE_INFO
diff --git a/postfix/postcat/.indent.pro b/postfix/postcat/.indent.pro
index b38eded21..715b1fb48 100644
--- a/postfix/postcat/.indent.pro
+++ b/postfix/postcat/.indent.pro
@@ -35,6 +35,7 @@
-TEXPAND_ATTR
-TFILE
-TFORWARD_INFO
+-TFW_CONTEXT
-THEADER_OPTS
-THTABLE
-THTABLE_INFO
diff --git a/postfix/postconf/.indent.pro b/postfix/postconf/.indent.pro
index b38eded21..715b1fb48 100644
--- a/postfix/postconf/.indent.pro
+++ b/postfix/postconf/.indent.pro
@@ -35,6 +35,7 @@
-TEXPAND_ATTR
-TFILE
-TFORWARD_INFO
+-TFW_CONTEXT
-THEADER_OPTS
-THTABLE
-THTABLE_INFO
diff --git a/postfix/postdrop/.indent.pro b/postfix/postdrop/.indent.pro
index b38eded21..715b1fb48 100644
--- a/postfix/postdrop/.indent.pro
+++ b/postfix/postdrop/.indent.pro
@@ -35,6 +35,7 @@
-TEXPAND_ATTR
-TFILE
-TFORWARD_INFO
+-TFW_CONTEXT
-THEADER_OPTS
-THTABLE
-THTABLE_INFO
diff --git a/postfix/postfix/.indent.pro b/postfix/postfix/.indent.pro
index b38eded21..715b1fb48 100644
--- a/postfix/postfix/.indent.pro
+++ b/postfix/postfix/.indent.pro
@@ -35,6 +35,7 @@
-TEXPAND_ATTR
-TFILE
-TFORWARD_INFO
+-TFW_CONTEXT
-THEADER_OPTS
-THTABLE
-THTABLE_INFO
diff --git a/postfix/postkick/.indent.pro b/postfix/postkick/.indent.pro
index b38eded21..715b1fb48 100644
--- a/postfix/postkick/.indent.pro
+++ b/postfix/postkick/.indent.pro
@@ -35,6 +35,7 @@
-TEXPAND_ATTR
-TFILE
-TFORWARD_INFO
+-TFW_CONTEXT
-THEADER_OPTS
-THTABLE
-THTABLE_INFO
diff --git a/postfix/postlock/.indent.pro b/postfix/postlock/.indent.pro
index b38eded21..715b1fb48 100644
--- a/postfix/postlock/.indent.pro
+++ b/postfix/postlock/.indent.pro
@@ -35,6 +35,7 @@
-TEXPAND_ATTR
-TFILE
-TFORWARD_INFO
+-TFW_CONTEXT
-THEADER_OPTS
-THTABLE
-THTABLE_INFO
diff --git a/postfix/postlog/.indent.pro b/postfix/postlog/.indent.pro
index b38eded21..715b1fb48 100644
--- a/postfix/postlog/.indent.pro
+++ b/postfix/postlog/.indent.pro
@@ -35,6 +35,7 @@
-TEXPAND_ATTR
-TFILE
-TFORWARD_INFO
+-TFW_CONTEXT
-THEADER_OPTS
-THTABLE
-THTABLE_INFO
diff --git a/postfix/postmap/.indent.pro b/postfix/postmap/.indent.pro
index b38eded21..715b1fb48 100644
--- a/postfix/postmap/.indent.pro
+++ b/postfix/postmap/.indent.pro
@@ -35,6 +35,7 @@
-TEXPAND_ATTR
-TFILE
-TFORWARD_INFO
+-TFW_CONTEXT
-THEADER_OPTS
-THTABLE
-THTABLE_INFO
diff --git a/postfix/postsuper/.indent.pro b/postfix/postsuper/.indent.pro
index b38eded21..715b1fb48 100644
--- a/postfix/postsuper/.indent.pro
+++ b/postfix/postsuper/.indent.pro
@@ -35,6 +35,7 @@
-TEXPAND_ATTR
-TFILE
-TFORWARD_INFO
+-TFW_CONTEXT
-THEADER_OPTS
-THTABLE
-THTABLE_INFO
diff --git a/postfix/qmgr/.indent.pro b/postfix/qmgr/.indent.pro
index b38eded21..715b1fb48 100644
--- a/postfix/qmgr/.indent.pro
+++ b/postfix/qmgr/.indent.pro
@@ -35,6 +35,7 @@
-TEXPAND_ATTR
-TFILE
-TFORWARD_INFO
+-TFW_CONTEXT
-THEADER_OPTS
-THTABLE
-THTABLE_INFO
diff --git a/postfix/sendmail/.indent.pro b/postfix/sendmail/.indent.pro
index b38eded21..715b1fb48 100644
--- a/postfix/sendmail/.indent.pro
+++ b/postfix/sendmail/.indent.pro
@@ -35,6 +35,7 @@
-TEXPAND_ATTR
-TFILE
-TFORWARD_INFO
+-TFW_CONTEXT
-THEADER_OPTS
-THTABLE
-THTABLE_INFO
diff --git a/postfix/showq/.indent.pro b/postfix/showq/.indent.pro
index b38eded21..715b1fb48 100644
--- a/postfix/showq/.indent.pro
+++ b/postfix/showq/.indent.pro
@@ -35,6 +35,7 @@
-TEXPAND_ATTR
-TFILE
-TFORWARD_INFO
+-TFW_CONTEXT
-THEADER_OPTS
-THTABLE
-THTABLE_INFO
diff --git a/postfix/smtp/.indent.pro b/postfix/smtp/.indent.pro
index b38eded21..715b1fb48 100644
--- a/postfix/smtp/.indent.pro
+++ b/postfix/smtp/.indent.pro
@@ -35,6 +35,7 @@
-TEXPAND_ATTR
-TFILE
-TFORWARD_INFO
+-TFW_CONTEXT
-THEADER_OPTS
-THTABLE
-THTABLE_INFO
diff --git a/postfix/smtpd/.indent.pro b/postfix/smtpd/.indent.pro
index b38eded21..715b1fb48 100644
--- a/postfix/smtpd/.indent.pro
+++ b/postfix/smtpd/.indent.pro
@@ -35,6 +35,7 @@
-TEXPAND_ATTR
-TFILE
-TFORWARD_INFO
+-TFW_CONTEXT
-THEADER_OPTS
-THTABLE
-THTABLE_INFO
diff --git a/postfix/smtpd/smtpd_check.c b/postfix/smtpd/smtpd_check.c
index 6c1b2f916..705f5b4cf 100644
--- a/postfix/smtpd/smtpd_check.c
+++ b/postfix/smtpd/smtpd_check.c
@@ -1106,7 +1106,7 @@ static int is_map_command(char *name, char *command, char ***argp)
*/
if (strcasecmp(name, command) != 0) {
return (0);
- } else if (*argp == 0 || strchr(*(*argp += 1), ':') == 0) {
+ } else if (*(*argp + 1) == 0 || strchr(*(*argp += 1), ':') == 0) {
msg_warn("restriction %s requires maptype:mapname", command);
longjmp(smtpd_check_buf, -1);
} else {
diff --git a/postfix/smtpstone/.indent.pro b/postfix/smtpstone/.indent.pro
index b38eded21..715b1fb48 100644
--- a/postfix/smtpstone/.indent.pro
+++ b/postfix/smtpstone/.indent.pro
@@ -35,6 +35,7 @@
-TEXPAND_ATTR
-TFILE
-TFORWARD_INFO
+-TFW_CONTEXT
-THEADER_OPTS
-THTABLE
-THTABLE_INFO
diff --git a/postfix/trivial-rewrite/.indent.pro b/postfix/trivial-rewrite/.indent.pro
index b38eded21..715b1fb48 100644
--- a/postfix/trivial-rewrite/.indent.pro
+++ b/postfix/trivial-rewrite/.indent.pro
@@ -35,6 +35,7 @@
-TEXPAND_ATTR
-TFILE
-TFORWARD_INFO
+-TFW_CONTEXT
-THEADER_OPTS
-THTABLE
-THTABLE_INFO
diff --git a/postfix/util/.indent.pro b/postfix/util/.indent.pro
index b38eded21..715b1fb48 100644
--- a/postfix/util/.indent.pro
+++ b/postfix/util/.indent.pro
@@ -35,6 +35,7 @@
-TEXPAND_ATTR
-TFILE
-TFORWARD_INFO
+-TFW_CONTEXT
-THEADER_OPTS
-THTABLE
-THTABLE_INFO