[comp.mail.uucp] Smail3.1 and Filter

graham@netwrx1.UUCP (James Graham) (07/12/90)

	I am using Smail3.1 patch level 18 on an AT&T 3B2 with SVR3.1. I
am trying to use the "pipe" transport to utilize the "filter" program
provided with ELM 2.3. It appears that when Smail locates the .forward
file it executes the shell as the sender userid rather the the userid
for which the filter is assigned. This causes problems. Any clues as to what my
configuration error might be, I would appreciate any assistance.

	I have attached my smail/lib/config and smail/lib/transport
configuration files. I am using the defaults for the rest. I have also
attached the result of the filter program error messages.

Thanks
Jim Graham

==============================================================================
  James M. Graham		Usenet:	  uunet!netwrx1!graham
  NetWorks One			Internet: graham%netwrx1@uunet.uu.net
  Vienna, Virginia		Voice:    (703) 827-7767

Filter error log:
#
# Filter errors for the the "approved" account
#
filter (cg): Couldn't read user filter rules file!
filter (cg): Mailing message to cg

Config file:

# @(#)config	1.5 2/20/89 04:09:13

# This file defines the default state for all variables that can be
# set in the smail config file.  By modifying either the source file
# src/config.h or conf/EDITME the actual default state can be changed.
# Thus, this should be matched up against these two files before
# assuming it is completely correct.

+auto_mkdir
auto_mkdir_mode = 0755
console = /dev/console
copying_file = COPYING
date_field = "Date: $date"
delivery_mode = background
director_file = directors
# +flock_mailbox 		# under 4.3BSD
-flock_mailbox			# otherwise
fnlock_interval = 5
fnlock_mode = 0666
fnlock_retries = 3
grades = "special-delivery:9:air-mail:A:first-class:C:bulk:a:junk:n"
hit_table_len = 241
-hostnames
-lock_by_name			# on BSD systems or System V.2/V.3
# +lock_by_name			# otherwise
lock_mode = 0444
log_mode = 0644
logfile = /usr/spool/smail/log/logfile
max_hop_count = 20
-max_load_ave
max_message_size = 100k
# message_buf_size = 4096	# for machines with small memories
message_buf_size = 100k		# otherwise
message_id_field = "Message-Id: <$message_id@$primary_name>"
message_log_mode = 0664
method_dir = methods
-more_hostnames
nobody = nobody			# under 4.3BSD or SunOS
# nobody = guest		# another possibility
open_interval = 2
open_retries = 0		# if an atomic rename() is available
# open_retries = 2		# otherwise
paniclog = /usr/spool/smail/log/paniclog
postmaster_address = root
-queue_only
received_field = "Received: by $primary_name ($version_string)
	id <$message_id@$primary_name>; $spool_date"
-require_configs
return_path_field = "Return-Path: <$sender>"
router_file = routers
-second_config_file
smail = /usr/lib/sendmail
# smail_lib_dir = /usr/lib/smail
smail_lib_dir = /usr/local/smail/lib
-smart_path
-smart_transport
-smart_user
spool_dirs = /usr/spool/smail
spool_grade = C
spool_mode = 0640		# under System V
# spool_mode = 0440		# otherwise
transport_file = transports
-trusted
-trusted_groups
-uucp_name
visible_domains = nw1.com:uucp
-visible_name

Transport file:

#ident "@(#)/usr/src/amdahl/cmd/smail/samples/bigsite/bargw/transports	5.1 4/13/89 15:41:57"

# See smail(5) for a complete description of the contents of this
# file.

# local - deliver mail to local users
#
# Tell smail to append directly to user mailbox files in the /usr/mail
# directory.
local:	driver = appendfile,		# append message to a file
	return_path,			# include a Return-Path: field
	local,				# use local forms for delivery
	from,				# supply a From_ envelope line
	unix_from_hack;			# insert > before From in body

	file = /usr/mail/${lc:user},	# use this location for System V
	group = mail,			# group to own file for System V
	mode = 0660,			# under System V, group mail can access
	suffix = "\n",			# append an extra newline
	append_as_user,

# pipe - deliver mail to shell commands
#
# This is used implicitly when smail encounters addresses which begin with
# a vertical bar character, such as "|/usr/lib/news/recnews talk.bizarre".
# The vertical bar is removed from the address before being given to the
# transport.
pipe:	driver = pipe,			# pipe message to another program
	return_path, local, from, unix_from_hack;

	cmd = "/bin/sh -c $user",	# send address to the Bourne Shell
	parent_env,			# environment info from parent addr
#	pipe_as_user,			# use user-id associated with address
	umask = 0022,			# umask for child process
	-log_output,			# do not log stdout/stderr
	ignore_status,			# exit status may be bogus, ignore it
	ignore_write_errors,		# ignore broken pipes

# file - deliver mail to files
#
# This is used implicitly when smail encounters addresses which begin with
# a slash or squiggle character, such as "/usr/info/list_messages" or
# perhaps "~/Mail/inbox".
file:	driver = appendfile,
	return_path, local, from, unix_from_hack;

	file = $user,			# file is taken from address
	append_as_user,			# use user-id associated with address
	expand_user,			# expand ~ and $ within address
	suffix = "\n",
	mode = 0644

# uux - deliver to the rmail program on a remote UUCP site
#
# As many as five recipient addresses will be delivered to the remote
# host in one UUCP transaction.
uux:	driver = pipe,
	uucp,				# use UUCP-style addressing forms
	from,				# supply a From_ envelope line
	max_addrs = 5,			# at most 5 addresses per invocation
	max_chars = 200;		# at most 200 chars of addresses

	# the -r flag prevents immediate delivery, parentheses around the
	# $user variable prevent special interpretation by uux.
	cmd = "/usr/bin/uux - -r -g$grade $host!rmail $((${strip:user})$)",
	umask = 0022,
	pipe_as_sender

# uux_one_addr - deliver mail over UUCP to a remote host that can take
#		 one address at a time.
#
# This is often necessary when delivering to a site running an unmodified
# version of 4.1BSD.
uux_one_addr:
	driver = pipe,
	uucp,				# use UUCP-style addressing forms
	from;				# supply a From_ envelope line

	# the -r flag prevents immediate delivery
	cmd = "/usr/bin/uux - -r -g$grade $host!rmail (${strip:user})",
	umask = 0022, pipe_as_sender

# demand - deliver to a remote rmail program, polling on demand
demand:	driver = pipe,
	uucp, from, max_addrs = 5, max_chars = 200;

	# with no -r flag, try to contact remote site immediately
	cmd = "/usr/bin/uux - -g$grade $host!rmail $(($user)$)",
	umask = 0022, pipe_as_sender

# uusmtp - deliver to the rsmtp program on a remote UUCP site
#
# Deliver using a simple Batched SMTP protocol to the remote machine.
# This allows much more arbitrary addresses to be used.  It also
# removes the limit on recipient addresses per invocation of uux.
uusmtp:	driver = pipe,
	bsmtp,				# send batched SMTP commands
	-max_addrs,			# there is no limit on the number or
	-max_chars;			#   total size of recipient addresses.

	# supply -r to prevent immedate delivery, the recipient addresses
	# are stored in the data sent to the standard input of rsmtp.
	cmd = "/usr/bin/uux - -r -g$grade $host!rsmtp",
	umask = 0022, pipe_as_sender

# demand_uusmtp - deliver to a remote rsmtp program, polling on demand
demand_uusmtp:
	driver = pipe,
	bsmtp, -max_addrs, -max_chars;

	# with no -r flag, try to contact remote site immediately
	cmd = "/usr/bin/uux - -g$grade $host!rsmtp",
	umask = 0022, pipe_as_sender

# smtp - deliver using SMTP over TCP/IP
#
# Connect to a remote host using TCP/IP and initiate an SMTP conversation
# to deliver the message.  The smtp transport is included only if BSD
# networking exists.

# NOTE:	It may be necessary to restrict max_addrs to 100, as this is the
#	lower limit SMTP requires an implementation to handle for one
#	message.
#smtp:	driver = smtp,
#	-max_addrs,
#	-max_chars

-- 
==============================================================================
  James M. Graham		Usenet:	  uunet!netwrx1!graham
  NetWorks One			Internet: graham%netwrx1@uunet.uu.net
  Vienna, Virginia		Voice:    (703) 827-7767

tron@tolerant.com (Ron Karr) (07/15/90)

In article <1149@netwrx1.UUCP> graham@netwrx1.UUCP (James Graham) writes:
>
>	I am using Smail3.1 patch level 18 on an AT&T 3B2 with SVR3.1. I
>am trying to use the "pipe" transport to utilize the "filter" program
>provided with ELM 2.3. It appears that when Smail locates the .forward
>file it executes the shell as the sender userid rather the the userid
>for which the filter is assigned. This causes problems. Any clues as to what my
>configuration error might be, I would appreciate any assistance.
>
> ....
>
>pipe:	driver = pipe,			# pipe message to another program
>	return_path, local, from, unix_from_hack;
>
>	cmd = "/bin/sh -c $user",	# send address to the Bourne Shell
>	parent_env,			# environment info from parent addr
>#	pipe_as_user,			# use user-id associated with address
>	umask = 0022,			# umask for child process
>	-log_output,			# do not log stdout/stderr
>	ignore_status,			# exit status may be bogus, ignore it
>	ignore_write_errors,		# ignore broken pipes

One problem could be that you turned off this capability by commenting
out the pipe_as_user attribute.  This is the attribute that tells smail3
to use the appropriate user of the .forward file as the user for executing
programs in the .forward file.
-- 
	tron  |-<=>-|		ARPAnet:  tolsoft!tron@apple.com
      tron@tolerant.com		UUCPnet:  {amdahl,apple,hoptoad}!tolsoft!tron