RECVMUX(7)                                                          RECVMUX(7)



NAME
       recvmux - receive a stream via tcpmux

SYNOPSIS
       recvmux  [-M]  [-D  spool] [-m mode] [-N name] [-R regexp] [-s subject]
       [untrusted]
       recvmux -h
       recvmux -V

DESCRIPTION
       Sometimes you need a straightforward way to store  a  message  under  a
       rock.  Write a file in a directory for each of several hosts, then pro-
       cess them after all of them have made the dead-drop.  When you  need  a
       place to gather the data recvmux is your friend.

       Any  host that can reach the "drop host" via TCP port 1 can chat up the
       recvmux service (by that name or an alias) to deposit a stream of bytes
       in  a  file  named for the client host's IP address.  That file will be
       overwritten in-place until it is processed by some external  structure.

       Another  way  to  do  this would be via e-mail.  And one can use the -M
       option and the procmail(1) filter to chain to  this  service  (see  the
       examples below).

       In  either  case the first line of the stream is matched against regexp
       in an attempt to find a better filename than  the  IP  address  of  the
       client  host.  If this expression matches, then the first set of paren-
       thesis sets the name of the host (which cannot be the empty string).

       In the case where the stream came from an out-of-band process (not from
       an  client  connection) the command-line may specify a subject which is
       matched against the same regexp to to set the filename.  The first line
       match, above, supersedes any subject match.

OPTIONS
       -D spool
              This  option  specifies the directory to store incoming streams.
              The default is the home directory of the real uid  of  the  pro-
              cesses.

       -h
              Display only a brief help message.

       -M
              Notify  the  program  that stdin is not a socket.  This prevents
              the service from sending the RFC1078 reply codes back to a  non-
              existent client.

       -m mode
              Force the mode on the file to this octal mode, rather than using
              just the inherited umask.

       -N name
              Force the name of the client host to be name.  This disables the
              regexp  search  for the hostname, but the name is still filtered
              for leading dots, slashes, and other security checks.

       -R regexp
              Specify a perl regular expression to extract the  desired  file-
              name from the first line of the stream, or from subject.

       -s subject
              Scan  this  e-mail  subject  for default name via Iregexp.  This
              becomes the new default name.

       -V
              Show only version information.

       untrusted
              CIDRs to forbid any network access.  Often used to limit  access
              to trusted local networks.

EXAMPLES
       recvmux -V
              Output the standard version information, and the default regexp.

       recvmux -h
              Output only a brief help message.

       tcpmux/storage stream tcp nowait storage:sample /usr/local/libexec/recvmux recvmux -D /var/storage
              Collect reports for the "storage" tcpmux service in /var/storage
              under the login "storage" in group "sample".  The default regexp
              is in-place to name incoming files where the first line contains
              an mk(1l) marked line with the hostname quoted.

       tcpmux/diag stream tcp nowait diag /usr/local/libexec/recvmux recvmux 10.0/8 192.168.0.0/16
              Allow  local  networks  that are not elements of the RFC1918 ten
              and one-ninety-two  spaces  to  dead-drop  diagnostic  files  in
              ~diag.

       # for a hostname on the subject line
       :0 HbwE : lock
       * ^Subject:[    ]*\/..*
       | /usr/local/libexec/recvmux -M -m 0644 -D $HOME -R '\s*(.*)' -s "$MATCH"
              A sample use as a procmail(1) filter.  Scan a subject header for
              a client hostname, the whole subject line is taken as the  host-
              name.

BUGS
       The  inclusion  of  the  marked line in the output is a fine point.  It
       might be argued that we should consume the line as a parameter,  rather
       than  including  it  in the output file.  That would be correct, except
       that the line may still be a valid parameter to mk(1l) to perform  some
       other task we might require later.

       The  composition  of  the  default  regular expression doesn't make any
       sence at first glance: it is trying to extract  the  hostname  from  an
       mk(1l) marked line.  For example:
              # $Which: ${echo-echo} 'nostromo' $$
       Note  that this expression expects the training double-dollar, which is
       usually not supplied in most mk marked lines.  This is used as a sanity
       check, or some minor security through obscurity, if you like.

       The exclusion of specified networks may be less clever than an explicit
       allow list.

       The use of -M is not canonical: it  usually  masks  the  reply  with  a
       generic  (rather  than removing it).  The prompts Mark and Go are triv-
       ial, so no masking is (presently) supported.

AUTHOR
       KS Braunsdorf
       NonPlayer Character Guild
       mux at ksb.npcguild.org

SEE ALSO
       sh(1), tcpmux(8l) or inetd(8), muxsend(1l), mk(1l), op(1l), perl(1)



                                     LOCAL                          RECVMUX(7)

NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXAMPLES | BUGS | AUTHOR | SEE ALSO