mgetty+sendfax port, nice getty replacement with fax/ppp recognition support

This commit is contained in:
form 1998-05-04 05:22:02 +00:00
parent 6e39f8203e
commit ec74d93014
20 changed files with 1172 additions and 0 deletions

View File

@ -0,0 +1,45 @@
# New ports collection makefile for: mgetty+sendfax
# Version required: 1.1.14
# Date created: 27 April 1998
# Whom: form
#
DISTNAME= mgetty1.1.14-Apr02
PKGNAME= mgetty-1.1.14
CATEGORIES= comms
MASTER_SITES= ftp://ftp.leo.org/pub/comp/os/unix/networking/mgetty/
MAINTAINER= form@vs.itam.nsc.ru
WRKSRC= ${WRKDIR}/mgetty-1.1.14
MAKE_FLAGS= prefix=${PREFIX} -f
MAN1= coverpg.1 fax.1 faxq.1 faxrm.1 faxrunq.1 faxspool.1 \
g3cat.1 g32pbm.1 pbm2g3.1 pvf.1 zplay.1
MAN4= mgettydefs.4
MAN5= faxqueue.5
MAN8= sendfax.8 mgetty.8 callback.8 faxrunqd.8
MGETTY_ETC?= /etc/mgetty
pre-build:
.if defined(AUTO_PPP)
CFLAGS+= "-DAUTO_PPP"
.else
@${ECHO} "***"
@${ECHO} "*** You're building mgetty without PPP detection support."
@${ECHO} "*** If you want to enable it, type \"make AUTO_PPP=yes\""
@${ECHO} "***"
.endif
pre-install:
@(cd ${WRKSRC}/doc; ${MAKE} manpages)
.if !defined(BATCH)
post-install:
@(cd ${PKGDIR}; export PKG_PREFIX=${PREFIX}; /usr/bin/perl INSTALL _ POST-INSTALL)
.endif
post-install:
@(cd ${PKGDIR}; export PKG_PREFIX=${PREFIX} MGETTY_ETC=${MGETTY_ETC}; /usr/bin/perl INSTALL _ POST-INSTALL)
.include <bsd.port.mk>

View File

@ -0,0 +1 @@
MD5 (mgetty1.1.14-Apr02.tar.gz) = d7d8961036b7c1a09ddb529e78bf36cd

View File

@ -0,0 +1,17 @@
--- fax/faxspool.in.orig Fri Aug 8 21:43:55 1997
+++ fax/faxspool.in Mon Dec 29 22:31:59 1997
@@ -299,11 +299,11 @@
# user name (for authentification)
##########
-if user=`logname 2>/dev/null`
-then :
+if [ `id -u` = 0 ]; then
+ user=root
else
id=`id`
- user=`expr "$id" : "[^( ]*(\([^)]*\)"`
+ user=`logname`
fi
test -z "$user" && user=$LOGNAME
test -z "$user" && user=$USER

View File

@ -0,0 +1,183 @@
*** Makefile.orig Fri Apr 3 04:07:51 1998
--- Makefile Mon Apr 27 18:16:49 1998
***************
*** 4,11 ****
#
# this is the C compiler to use (on SunOS, the standard "cc" does not
# grok my code, so please use gcc there. On ISC 4.0, use "icc".).
! CC=gcc
! #CC=cc
#
#### C Compiler Flags ####
#
--- 4,11 ----
#
# this is the C compiler to use (on SunOS, the standard "cc" does not
# grok my code, so please use gcc there. On ISC 4.0, use "icc".).
! #CC=gcc
! CC=cc
#
#### C Compiler Flags ####
#
***************
*** 108,114 ****
# prompt first. Don't forget to activate the /AutoPPP/ line in login.config!
#
#CFLAGS=-Wall -O2 -pipe -DSECUREWARE -DUSE_POLL
! CFLAGS=-O2 -Wall -pipe
#CFLAGS=-O -DSVR4
#CFLAGS=-O -DSVR4 -DSVR42
#CFLAGS=-O -DUSE_POLL
--- 108,114 ----
# prompt first. Don't forget to activate the /AutoPPP/ line in login.config!
#
#CFLAGS=-Wall -O2 -pipe -DSECUREWARE -DUSE_POLL
! #CFLAGS=-O2 -Wall -pipe
#CFLAGS=-O -DSVR4
#CFLAGS=-O -DSVR4 -DSVR42
#CFLAGS=-O -DUSE_POLL
***************
*** 151,157 ****
# For Linux, add "-lutil" if the linker complains about "updwtmp".
#
LDFLAGS=
! LIBS=
#LIBS=-lprot -lsocket # SCO Unix
#LIBS=-lsocket
#LIBS=-lbsd # OSF/1
--- 151,157 ----
# For Linux, add "-lutil" if the linker complains about "updwtmp".
#
LDFLAGS=
! LIBS=-lutil
#LIBS=-lprot -lsocket # SCO Unix
#LIBS=-lsocket
#LIBS=-lbsd # OSF/1
***************
*** 199,205 ****
#
# where the configuration files (*.config, aliases, fax.allow/deny) go to
#
! CONFDIR=$(prefix)/etc/mgetty+sendfax
#CONFDIR=/etc/default/
#
#
--- 199,205 ----
#
# where the configuration files (*.config, aliases, fax.allow/deny) go to
#
! CONFDIR=/etc/mgetty+sendfax
#CONFDIR=/etc/default/
#
#
***************
*** 261,269 ****
# please use the "mg.echo" program provided in the compat/ subdirectory.
# Set ECHO="mg.echo" and INSTALL_MECHO to mg.echo
#
! ECHO="echo"
#
! # INSTALL_MECHO=mg.echo
#
# for mgetty, that's it. If you want to use the voice
--- 261,269 ----
# please use the "mg.echo" program provided in the compat/ subdirectory.
# Set ECHO="mg.echo" and INSTALL_MECHO to mg.echo
#
! ECHO="mg.echo"
#
! INSTALL_MECHO=mg.echo
#
# for mgetty, that's it. If you want to use the voice
***************
*** 271,277 ****
# To maintain security, I recommend creating a new group for
# users who are allowed to manipulate the recorded voice messages.
! PHONE_GROUP=phone
PHONE_PERMS=770
# Add -DNO_STRSTR to CFLAGS if you don't have strstr().
--- 271,277 ----
# To maintain security, I recommend creating a new group for
# users who are allowed to manipulate the recorded voice messages.
! PHONE_GROUP=dialer
PHONE_PERMS=770
# Add -DNO_STRSTR to CFLAGS if you don't have strstr().
***************
*** 303,309 ****
all: bin-all doc-all
! bin-all: mgetty sendfax newslock subdirs call-back
# a few C files need extra compiler arguments
--- 303,309 ----
all: bin-all doc-all
! bin-all: mgetty sendfax newslock subdirs call-back vgetty
# a few C files need extra compiler arguments
***************
*** 563,577 ****
cd bindist; gtar cvvfz mgetty$(MR).$(SR)-bin.tgz *
! install: install.bin install.doc
install.bin: mgetty sendfax newslock \
! login.config mgetty.config sendfax.config
#
# binaries
#
-test -d $(BINDIR) || ( ./mkidirs $(BINDIR) ; chmod 755 $(BINDIR) )
! $(INSTALL) -m 755 newslock $(BINDIR)
-test -d $(SBINDIR) || ( ./mkidirs $(SBINDIR) ; chmod 755 $(SBINDIR) )
-mv -f $(SBINDIR)/mgetty $(SBINDIR)/mgetty.old
--- 563,577 ----
cd bindist; gtar cvvfz mgetty$(MR).$(SR)-bin.tgz *
! install: install.bin install.doc install-vgetty
install.bin: mgetty sendfax newslock \
! login.config #mgetty.config sendfax.config
#
# binaries
#
-test -d $(BINDIR) || ( ./mkidirs $(BINDIR) ; chmod 755 $(BINDIR) )
! $(INSTALL) -s -m 755 newslock $(BINDIR)
-test -d $(SBINDIR) || ( ./mkidirs $(SBINDIR) ; chmod 755 $(SBINDIR) )
-mv -f $(SBINDIR)/mgetty $(SBINDIR)/mgetty.old
***************
*** 587,596 ****
( ./mkidirs $(CONFDIR); chmod 755 $(CONFDIR))
test -f $(CONFDIR)/login.config || \
$(INSTALL) -o root -m 600 login.config $(CONFDIR)/
! test -f $(CONFDIR)/mgetty.config || \
! $(INSTALL) -o root -m 600 mgetty.config $(CONFDIR)/
! test -f $(CONFDIR)/sendfax.config || \
! $(INSTALL) -o root -m 644 sendfax.config $(CONFDIR)/
test -f $(CONFDIR)/dialin.config || \
$(INSTALL) -o root -m 600 dialin.config $(CONFDIR)/
test -f $(CONFDIR)/faxrunq.config || \
--- 587,596 ----
( ./mkidirs $(CONFDIR); chmod 755 $(CONFDIR))
test -f $(CONFDIR)/login.config || \
$(INSTALL) -o root -m 600 login.config $(CONFDIR)/
! # test -f $(CONFDIR)/mgetty.config || \
! # $(INSTALL) -o root -m 600 mgetty.config $(CONFDIR)/
! # test -f $(CONFDIR)/sendfax.config || \
! # $(INSTALL) -o root -m 644 sendfax.config $(CONFDIR)/
test -f $(CONFDIR)/dialin.config || \
$(INSTALL) -o root -m 600 dialin.config $(CONFDIR)/
test -f $(CONFDIR)/faxrunq.config || \

View File

@ -0,0 +1,19 @@
--- voice/Makefile.orig Mon Dec 29 23:06:36 1997
+++ voice/Makefile Mon Dec 29 23:07:18 1997
@@ -89,11 +89,11 @@
done
$(INSTALL) -m 644 man/man1/zplay.1 $(MAN1DIR)
$(INSTALL) -m 644 man/man1/pvf.1 $(MAN1DIR)
- cd $(MAN1DIR); \
- for i in $(PVFTOOLS); \
- do \
- $(RM) -f $$i.1; $(LN) -s pvf.1 $$i.1; \
- done
+# cd $(MAN1DIR); \
+# for i in $(PVFTOOLS); \
+# do \
+# $(RM) -f $$i.1; $(LN) -s pvf.1 $$i.1; \
+# done
# [ -d $(VOICE_DIR) ] || mkdir $(VOICE_DIR)
# [ -d $(VOICE_DIR)/incoming ] || mkdir $(VOICE_DIR)/incoming
# chown 0 $(VOICE_DIR)/incoming

View File

@ -0,0 +1,11 @@
--- doc/Makefile.orig Fri Nov 28 04:33:26 1997
+++ doc/Makefile Mon Dec 29 22:31:59 1997
@@ -26,7 +26,7 @@
all:
-doc-all: mgetty.asc mgetty.info mgetty.dvi mgetty.ps fmt-manpages $(MANSRC)
+doc-all: mgetty.asc mgetty.info fmt-manpages $(MANSRC)
manpages: $(MANSRC)

View File

@ -0,0 +1,19 @@
*** syslibs.h.orig Mon Apr 27 18:21:02 1998
--- syslibs.h Mon Apr 27 18:30:27 1998
***************
*** 7,13 ****
#include <stdlib.h>
#endif
! #if !defined( __bsdi__ ) && !defined(__FreeBSD__) && !defined(NeXT)
#include <malloc.h>
#endif
--- 7,13 ----
#include <stdlib.h>
#endif
! #if !defined( __bsdi__ ) && !defined(__FreeBSD__) && !defined(NeXT) && !defined(__OpenBSD__)
#include <malloc.h>
#endif

View File

@ -0,0 +1,19 @@
*** logfile.c.orig Mon Apr 27 18:30:52 1998
--- logfile.c Mon Apr 27 18:31:12 1998
***************
*** 53,59 ****
of those systems that _do_ declare them, it won't hurt */
extern int sys_nerr;
! #if !defined(__NetBSD__) && !defined( __FreeBSD__ ) && !defined(__GLIBC__)
extern char *sys_errlist[];
#endif
--- 53,59 ----
of those systems that _do_ declare them, it won't hurt */
extern int sys_nerr;
! #if !defined(__NetBSD__) && !defined( __FreeBSD__ ) && !defined(__GLIBC__) && !defined(__OpenBSD__)
extern char *sys_errlist[];
#endif

View File

@ -0,0 +1,19 @@
*** mgetty.c.orig Mon Apr 27 18:31:37 1998
--- mgetty.c Mon Apr 27 18:32:15 1998
***************
*** 88,94 ****
/* prototypes for system functions (that are missing in some
* system header files)
*/
! #ifndef __NetBSD__
time_t time _PROTO(( long * tloc ));
#endif
--- 88,94 ----
/* prototypes for system functions (that are missing in some
* system header files)
*/
! #if !defined(__NetBSD__) && !defined(__OpenBSD__)
time_t time _PROTO(( long * tloc ));
#endif

View File

@ -0,0 +1,19 @@
*** sendfax.c.orig Mon Apr 27 18:32:45 1998
--- sendfax.c Mon Apr 27 18:33:27 1998
***************
*** 40,46 ****
extern time_t call_start; /* for accounting */
/* seems to missing nearly everywhere */
! #ifndef __NetBSD__
time_t time _PROTO(( long * tloc ));
#endif
--- 40,46 ----
extern time_t call_start; /* for accounting */
/* seems to missing nearly everywhere */
! #if !defined(__NetBSD__) && !defined(__OpenBSD__)
time_t time _PROTO(( long * tloc ));
#endif

View File

@ -0,0 +1,19 @@
*** mgetty.h.orig Mon Apr 27 18:48:20 1998
--- mgetty.h Mon Apr 27 18:48:42 1998
***************
*** 61,67 ****
/* bsd stuff */
#if defined(__BSD_NET2__) || defined(__386BSD__) || \
! defined(__NetBSD__) || defined(__FreeBSD__)
# include <sys/param.h> /* defines BSD, BSD4_3 and BSD4_4 */
# ifndef BSD
# define BSD /* just in case... */
--- 61,67 ----
/* bsd stuff */
#if defined(__BSD_NET2__) || defined(__386BSD__) || \
! defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
# include <sys/param.h> /* defines BSD, BSD4_3 and BSD4_4 */
# ifndef BSD
# define BSD /* just in case... */

View File

@ -0,0 +1,19 @@
*** faxrec.c.orig Mon Apr 27 18:52:05 1998
--- faxrec.c Mon Apr 27 18:52:33 1998
***************
*** 35,41 ****
extern time_t call_start; /* in faxrecp.c, set in mgetty.c */
static time_t call_done;
! #ifndef __NetBSD__
time_t time _PROTO(( long * tloc ));
#endif
--- 35,41 ----
extern time_t call_start; /* in faxrecp.c, set in mgetty.c */
static time_t call_done;
! #if !defined(__NetBSD__) && !defined(__OpenBSD__)
time_t time _PROTO(( long * tloc ));
#endif

View File

@ -0,0 +1,19 @@
*** callback/callback.c.orig Mon Apr 27 18:57:40 1998
--- callback/callback.c Mon Apr 27 18:58:04 1998
***************
*** 68,74 ****
/* prototypes for system functions (that are missing in some
* system header files)
*/
! #ifndef __NetBSD__
time_t time _PROTO(( long * tloc ));
#endif
--- 68,74 ----
/* prototypes for system functions (that are missing in some
* system header files)
*/
! #if !defined(__NetBSD__) && !defined(__OpenBSD__)
time_t time _PROTO(( long * tloc ));
#endif

View File

@ -0,0 +1,19 @@
*** voice/include/voice.h.orig Mon Apr 27 18:58:55 1998
--- voice/include/voice.h Mon Apr 27 18:59:19 1998
***************
*** 19,25 ****
#include <errno.h>
#include <fcntl.h>
! #if !defined( __bsdi__ ) && !defined(__FreeBSD__) && !defined(NeXT)
# include <malloc.h>
#endif
--- 19,25 ----
#include <errno.h>
#include <fcntl.h>
! #if !defined( __bsdi__ ) && !defined(__FreeBSD__) && !defined(NeXT) && !defined(__OpenBSD__)
# include <malloc.h>
#endif

View File

@ -0,0 +1,19 @@
*** voice/libvoice/voice_fax.c.orig Mon Apr 27 19:02:22 1998
--- voice/libvoice/voice_fax.c Mon Apr 27 19:02:50 1998
***************
*** 29,35 ****
#define REVERSE 1
/* seems to missing nearly everywhere */
! #ifndef __NetBSD__
time_t time _PROTO(( long * tloc ));
#endif
--- 29,35 ----
#define REVERSE 1
/* seems to missing nearly everywhere */
! #if !defined(__NetBSD__) && !defined(__OpenBSD__)
time_t time _PROTO(( long * tloc ));
#endif

View File

@ -0,0 +1 @@
Handle external logins, send and receive faxes.

View File

@ -0,0 +1,10 @@
Mgetty is a ``smart'' getty replacement, designed to be used with hayes
compatible data and data/fax modems.
Mgetty knows about modem initialization, manual modem answering (so your
modem doesn't answer if the machine isn't ready), UUCP locking (so you can
use the same device for dial-in and dial-out).
Mgetty provides very extensive logging facilities.
Sendfax send the named g3 fax files to the fax machine at "phone number".
The g3 files can be created with pbmtog3(1) or GNU's GhostScript with the
"digifax" driver.

616
comms/mgetty+sendfax/pkg/INSTALL Executable file
View File

@ -0,0 +1,616 @@
#!/usr/bin/perl
exit 0 if $ARGV[1] ne "POST-INSTALL";
print STDERR "\n\n\n =========== mgetty+sendfax configuration ================\n\n";
$prefix = $ENV{'PKG_PREFIX'} ? $ENV{'PKG_PREFIX'} : "/usr/local";
$etcdir = $ENV{'MGETTY_ETC'} ? $ENV{'MGETTY_ETC'} : "/etc";
$sep = "~";
&read_config ("$etcdir/mgetty+sendfax/mgetty.config");
foreach (keys(%var)) {
$var_m{$_} = $var{$_};
delete $var{$_};
}
&read_config ("$etcdir/mgetty+sendfax/sendfax.config");
foreach (keys(%var)) {
$var_f{$_} = $var{$_};
}
$a = 1;
$devices = $var{'ports'} ? $var{'ports'} : "cuaa1";
while ($a) {
$devices = &ask ("list of devices", $devices);
$_ = $devices;
$w = 0;
foreach (split) {
if (! -c "/dev/$_" ) {
print STDERR "warning: device file /dev/$_ does not exist!\n";
$w++;
}
}
if ($w) {
$a = 0 if (&yesno ("are you sure?" , "n") eq "y");
} else {
$a = 0;
}
}
open (TMP1, ">/tmp/mgetty.config.$$") || die "$!\n";
open (TMP2, ">/tmp/sendfax.config.$$") || die "$!\n";
$_ = join (":", $devices);
print TMP2 "fax-devices $_\n\n";
$_ = $devices;
foreach $port (split) {
print STDERR "\n\n *** Configuring for port $port ***\n\n";
print TMP1 "\nport $port\n";
print TMP2 "\nport $port\n";
&setdef ($port);
again:
&inq_m;
$settings_m = $settings;
&inq_f;
$settings_f = "fax-id modem-type switchbd $settings";
goto again if (&confirm ($port) ne "y");
&write_tmp;
}
close (TMP1);
close (TMP2);
if ( -e "$etcdir/mgetty+sendfax/mgetty.config") {
system ("mv -f $etcdir/mgetty+sendfax/mgetty.config $etcdir/mgetty+sendfax/mgetty.config.old");
system ("rm -f $etcdir/mgetty+sendfax/mgetty.config");
}
if ( -e "$etcdir/mgetty+sendfax/sendfax.config") {
system ("mv -f $etcdir/mgetty+sendfax/sendfax.config $etcdir/mgetty+sendfax/sendfax.config.old");
system ("rm -f $etcdir/mgetty+sendfax/sendfax.config");
}
system ("mv -f /tmp/mgetty.config.$$ $etcdir/mgetty+sendfax/mgetty.config");
system ("mv -f /tmp/sendfax.config.$$ $etcdir/mgetty+sendfax/sendfax.config");
open (F, ">$etcdir/mgetty+sendfax/faxheader");
print F "\n FAX FROM: **not configured** $def{fax-id} TO: \@T@ PAGE: \@P@ OF \@M@ \n";
close (F);
print STDERR "\n\nediting /etc/ttys...\n";
open (F, "/etc/ttys");
@ttys = <F>;
close (F);
foreach $tty (@ttys) {
$_ = $devices;
foreach $port (split) {
if ($tty =~ /^\s*$port/) {
print STDERR "replacing line $tty";
$tty = "$port\t\"$prefix/sbin/mgetty\"\tunknown on insecure\n";
$replaced{$port} = 1;
}
}
}
$_ = $devices;
foreach $port (split) {
if (!$replaced{$port}) {
print STDERR "adding port $port\n";
push (@ttys, "$port\t\"$prefix/sbin/mgetty\"\tunknown on insecure\n");
}
}
system ("mv -f /etc/ttys /etc/ttys.old");
open (F, ">/etc/ttys");
print F @ttys;
close (F);
exit 0;
sub confirm {
$_ = shift;
print STDERR "\n\n\tSettings for port $_\n\t------------------------\n";
$_ = $settings_m;
foreach (split) {
print STDERR "\t$_ $def{$_}\n" if ($def{$_});
}
$_ = $settings_f;
foreach (split) {
print STDERR "\t$_ $def_f{$_}\n" if ($def_f{$_});
}
return &yesno ("OK?", "y");
}
sub write_tmp {
$_ = $settings_m;
foreach (split) {
print TMP1 "$_ $def{$_}\n" if ($def{$_});
}
$_ = $settings_f;
foreach (split) {
print TMP2 "$_ $def_f{$_}\n" if ($def_f{$_});
}
}
sub inq_m {
$settings = "debug";
$def{'debug'} = 4 if !$def{'debug'};
$def{'debug'} = &ask (" - `debug (mgetty)'
This sets the amount of logging `mgetty' will do. A good value is
4, more details are seen with `5', and `9' is really noisy. Try
it! The log data is written to the file `/tmp/log_mg.cuaxx'.",
$def{'debug'});
$settings .= " fax-id";
$def{'fax-id'} = "00 00 000000" if ! $def{'fax-id'};
$def{'fax-id'} = &ask (" - `fax-id'
This sets the fax station ID used in fax mode to identify your
site to the caller (usually this is simply your fax phone number).
", $def{'fax-id'}) ;
$def_f{'fax-id'} = $def{'fax-id'} ;
$settings .= " speed";
$def{'speed'} = 38400 if !$def{'speed'};
$def{'speed'} = &ask (" - `speed'
Specify, as integer value, the port speed to use. Default is
38400. If the given speed is not valid, `mgetty' complains loudly
and exits.", $def{'speed'});
$settings .= " switchbd";
$def{'switchbd'} = 0 if !$def{'switchbd'};
$def{'switchbd'} = &ask (" - `switchbd'
Some modems, mainly Rockwell chipsets, switch to 19200 bps when
entering fax mode. Others may need other speed switches (but I
know none). If your modem is Rockwell based, try `switchbd 19200'
if fax reception doesn't work. (*Warning:* if this is set wrongly,
fax reception will definitely fail. For most sane modems, you do
*not need* this.). Set speed or `0'", $def{'switchbd'});
$def_f{'switchbd'} = $def{'switchbd'};
$settings .= " direct";
$def{'direct'} = "NO" if !$def{'direct'};
$def{'direct'} = &ask (" - `direct'
Tells mgetty that it is running on a direct line. Mgetty won't try
to initialize any modem, nor will it wait for `RING'. It will just
wait for any character, and then output the issue file and login
prompt. This option is used if you want to connect to machines via
nullmodem cable.", $def{'direct'});
$settings .= " blocking";
$def{'blocking'} = "NO" if !$def{'blocking'};
$def{'blocking'} = &ask (" - `blocking'
Tells mgetty to open the device in `blocking' mode, that is, the
`open()' system call won't succeed until carrier detect is set.
This is set if `mgetty' is called as `getty'. I'm not sure whether
it's very useful, but I include it for completeness", $def{'blocking'});
$settings .= " port-owner";
$def{'port-owner'} = "uucp" if !$def{'port-owner'};
$def{'port-owner'} = &ask (" - `port-owner'
If set, mgetty will `chown' the tty line to the given username (you
can specify a string or an integer uid, but the integer must be
valid). This is highly recommended for security purposes: only
give port access to those users you trust not to misuse your modem
lines!", $def{'port-owner'});
$settings .= " port-group";
$def{'port-group'} = "dialer" if !$def{'port-group'};
$def{'port-group'} = &ask (" - `port-group'
If set, mgetty will `chgrp' the tty line to this group id (which
can be given as group name, or as integer gid). If it's not given,
or not valid, the primary group id of `port-owner'
will be used.", $def{'port-group'});
$settings .= " port-mode";
$def{'port-mode'} = "0660" if !$def{'port-mode'};
$def{'port-mode'} = &ask (" - `port-mode'
Specifies the permissions to `chmod' the device to.
*Never* make a modem device world-accessible, better use `0660'
or even `0600'.", $def{'port-mode'} );
$settings .= " toggle-dtr";
$def{'toggle-dtr'} = "YES" if !$def{'toggle-dtr'};
$def{'toggle-dtr'} = &ask (" - `toggle-dtr'
Tells mgetty whether it should lower the DTR line upon startup to
reset modem. Default is `yes', but some (few) modems react
allergic to that and crash.", $def{'toggle-dtr'});
$settings .= " toggle-dtr-waittime";
$def{'toggle-dtr-waittime'} = 500 if !$def{'toggle-dtr-waittime'};
$def{'toggle-dtr-waittime'} = &ask (" - `toggle-dtr-waittime'
Specifies the time (in ms) to hold the DTR line low.", $def{'toggle-dtr-waittime'} );
$settings .= " data-only";
$def{'data-only'} = "NO" if !$def{'data-only'};
$def{'data-only'} =&ask (" - `data-only'
Tells `mgetty' to forget about faxing and only use the data part of
the modem. Default is `false'. You need this if your modem can't
distinguish incoming fax and data calls.", $def{'data-only'} );
$settings .= " fax-only";
$def{'fax-only'} = "NO" if !$def{'fax-only'};
$def{'fax-only'} = &ask (" - `fax-only'
Tells `mgetty' to put the modem in fax-only mode. You need this if
your modem can't distinguish incoming fax and data calls, but you
need fax more important than data; and you need it if you want to
disable data calls for security reasons (this could be achieved
via `login.config' as well)", $def{'fax-only'});
$settings .= " modem-type";
$def{'modem-type'} = "auto" if ! $def{'modem-type'};
$def{'modem-type'} = &ask (" - `modem-type'
Specifies the kind of modem connected to the port. Valid options are:
* auto
Mgetty will detect the modem type itself (which may occasionally
be not desirable, or it may fail on old modem equipment).
* c2.0
Modem is a CLASS 2.0 fax mode. Works better than class 2, if
both are available, because its better standardized. Known to
work with USR and ZyXEL.
* cls2
Modem is a CLASS 2 fax modem, mgetty will not try class 2.0.
* data
Do not try fax initialization
There is no way (yet) to tell mgetty to use *only* fax mode and
refuse data calls with this option, use the `fax-only true'
statement for that.", $def{'modem-type'});
$def_f{'modem-type'} = $def{'modem-type'};
$settings .= " init-chat";
$def{'init-chat'} = '"" ATS0=0Q0&D3&C1 OK' if ! $def{'init-chat'};
$def{'init-chat'} = &ask (" - `init-chat'
Tells mgetty the chat sequence to use for initializing the modem.
*Warning*: the sequence starts with *expect*, which will in most
cases be `\"\"' (nothing). This ordering was chosen because UUCP
does it this way, and I wanted to avoid confusion here.
Example:
\"\" \\d\\d\\d+++\\d\\d\\dATQ0E1V1H0 OK ATL0M0S0=0 OK AT&K3 OK
init sequence", $def{'init-chat'});
$settings .= " force-init-chat";
$def{'force-init-chat'} = "" if !$def{'force-init-chat'};
$def{'force-init-chat'} = &ask (" - `force-init-chat'
In some cases, the modem can get stuck in a mode where it won't
react to a simple `AT' command. Usually this happens because the
modem is set to ignore a DTR drop and still has a data connection
to the other side. If you use a voice modem, it could be stuck in
voice mode.
In these situations, the normal `init-chat' will time out, because
the modem won't send the proper responses back.
To get the modem back into a sane state, you can use the
`force-init-chat' chat sequence. The default setup will send the
DLE ETX characters, to get voice modems back to life, and then the
`(pause)+++(pause)ATH0' sequence to get the modem back from data
mode to command mode.
You could prepend this sequence to `init-chat' (it wouldn't harm),
but especially the pauses around the +++ sequence makes this
undesirable slow.", $def{'force-init-chat'});
$settings .= " modem-check-time";
$def{'modem-check-time'} = 3600 if ! $def{'modem-check-time'};
$def{'modem-check-time'} = &ask (" - `modem-check-time'
Some modems have the nasty tendency to crash silently. With this
option, you tell `mgetty' to check every SECONDS seconds with a
simple `AT...OK' sequence whether the modem still reacts. If not,
`mgetty' will restart itself and do a full modem reset.", $def{'modem-check-time'});
$settings .= " rings";
$def{'rings'} = 1 if !$def{'rings'};
$def{'rings'} = &ask (" - `rings'
Sets the number of `RING' messages to wait for, before mgetty
picks up the phone. *Warning:* if your modem auto-answers, for
whatever reason, set this to something *different* than the
value set with `ATS0=mmm', otherwise the modems autoanswer and
mgettys manual answer will collide (most modems hang up if a
command is received during auto-answer)", $def{'rings'});
$settings .= " answer-chat";
$def{'answer-chat'} = '"" ATA CONNECT \c \r' if !$def{'answer-chat'};
$def{'answer-chat'} =&ask (" - `answer-chat'
This is the command sequence that is used to answer a phone call.
Usually you can leave it at the default ` \"\" ATA CONNECT \\c \\r ',
but for some modems you need `ATS0=1' in place of `ATA' (ATA not
allowed). The extra `\\r' expect string is needed that the code can
grab the full CONNECT XYZ\\R string. It will work without the \\r,
but then the logging information will be less detailed. *Right now,
\\r won't work at all, it's not implemented yet. Don't use it.*
", $def{'answer-chat'} );
$settings .= " answer-chat-timeout";
$def{'answer-chat-timeout'} = 80 if !$def{'answer-chat-timeout'};
$def{'answer-chat-timeout'} = &ask (" - `answer-chat-timeout'
During the ANSWER-CHAT, each \"expect\" string must be seen in the
time specified here. Default is 80 seconds. This time should be at
least some 5 seconds longer than the time set with the `ATS7=...'
modem setup command.", $def{'answer-chat-timeout'});
$settings .= " autobauding";
$def{'autobauding'} = "YES" if !$def{'autobauding'};
$def{'autobauding'} = &ask (" - `autobauding'
Some modems switch their DTE line speed to the communication line
speed after connecting, e.g., after sending `CONNECT 2400', the
modem switches to 2400 bps. Newer modems usually have a switch to
\"lock\" a DTE baud rate, which is strongly recommended. If your
modem insists on doing this speed switch, setting `autobauding' to
YES will make mgetty behave accordingly.", $def{'autobauding'});
$settings .= " ringback";
$def{'ringback'} = "NO" if !$def{'ringback'} ;
$def{'ringback'} = &ask (" - `ringback'
If you have to put your modem and your telephone on the same phone
line, you can switch on \"ringback\" or \"ring-twice\". This means,
mgetty won't answer the phone on the first call, but remember the
call, and pick up on the second call (if it comes in the time
specified by `ringback-time').", $def{'ringback'} );
$settings .= " ringback-time";
$def{'ringback-time'} = "30" if !$def{'ringback-time'} ;
$def{'ringback-time'} = &ask (" - `ringback-time'
This setting specifies how much time may pass between the first
and the second call if \"ringback\" is active.", $def{'ringback-time'});
$settings .= " ignore-carrier";
$def{'ignore-carrier'} = "false" if !$def{'ignore-carrier'} ;
$def{'ignore-carrier'} = &ask (" - `ignore-carrier'
If your Modem does not assert the DCD (carrier detect) line, or the
serial port or cable or serial driver is broken, it is possible
that `mgetty' or `login' will block after a successful CONNECT
(that means: everything seems to work, but suddenly nothing is sent
to the port anymore. Depending on the operating system used, this
can be before printing the `/etc/issue' file or not before printing
the `password:' prompt.
To work around this, you can switch off the carrier detection in
software: set `ignore-carrier true'. Default is `false'.
*WARNING:* If you use this, your system won't be able to detect
when a caller just hangs up instead of cleanly logging out. This
may result in hanging modems, etc.", $def{'ignore-carrier'});
$settings .= " issue-file";
$def{'issue-file'} = "/etc/issue" if !$def{'issue-file'} ;
$def{'issue-file'} = &ask (" - `issue-file'
This is the file printed before the login prompt.", $def{'issue-file'});
$settings .= " prompt-waittime";
$def{'prompt-waittime'} = "500" if !$def{'prompt-waittime'} ;
$def{'prompt-waittime'} = &ask (" - `prompt-waittime'
This specifies how long `mgetty' will wait for modem and line to
settle down (in ms) before printing issue file and login prompt",
$def{'prompt-waittime'});
$settings .= " login-prompt";
$def{'login-prompt'} = "@!login: " if !$def{'login-prompt'} ;
$def{'login-prompt'} = &ask(" - `login-prompt'
This specifies the login prompt that mgetty will output. Some
special characters in this string (and in the issue file, btw) are
recognized and replaced by something else:
* @ system name
* \\n newline
* \\r carriage return
* \\g bell
* \\b backspace (ascii 010)
* \\f form feed (ascii 013)
* \\t TAB
* \\P (and \\L) port name (e.g. ttyS0)
* \\C date and time, in \"ctime()\" format
* \\I Connection string (e.g. 2400/REL)
* \\N (and \\U) number of users currently logged in
* \\S Port speed (e.g. 38400)
* \\D current date in dd/mm/yy format
* \\T current time in hh:mm:ss format
* \\DIGIT character with the specified octal code
The maximum lenght of the login prompt is limited to 140
characters (after expansion).", $def{'login-prompt'});
$settings .= " login-time";
$def{'login-time'} = 240 if !$def{'login-time'};
$def{'login-time'} = &ask (" - `login-time'
This specifies the maximum time the user can take to log in. If no
login has occured after that time, `mgetty' will hang up.",
$def{'login-time'});
$settings .= " fax-server-file";
$def{'fax-server-file'} = &ask (" - `fax-server-file'
Specifies the fax file(s) that is to be sent if someone else calls
your modem in *fax polling mode*, that is, the caller *receives* a
document.
Normally, the file given is a text file, containing the list of G3
files to send to the calling machine, one file per line. Comment
lines (starting with \"#\") are ignored. For backward compatibility,
`mgetty' does check whether the named file is a G3 file itself, in
which case this file is sent directly (but then, you can only send
one page).
Not all modems support fax poll *server* mode, I know that the
ZyXEL and MultiTech do.", $def{'fax-server-file'});
$settings .= " diskspace";
$def{'diskspace'} = 1024 if !$def{'diskspace'};
$def{'diskspace'} = &ask (" - `diskspace'
This setting tells mgetty the minimum amount of disk space (in KB) that
has to be available in the fax spool directory for fax reception
to be allowed.", $def{'diskspace'});
$settings .= " notify";
$def{'notify'} = "root" if !$def{'notify'};
$def{'notify'} = &ask (" - `notify'
This is the address that will get mails if a fax is received. Not
fully tested.", $def{'notify'});
$settings .= " fax-owner";
$def{'fax-owner'} = "uucp" if !$def{'fax-owner'};
$def{'fax-owner'} = &ask (" - `fax-owner'
If set, mgetty will `chown' the received files to the given username
(you can specify a string or an integer uid, but the integer must be
valid).", $def{'fax-owner'});
$settings .= " fax-group";
$def{'fax-group'} = "dialer" if !$def{'fax-group'};
$def{'fax-group'} = &ask (" - `fax-group'
If set, mgetty will `chgrp' the received files to this group id
(which can be given as group name, or as integer gid).", $def{'fax-group'});
$settings .= " fax-mode";
$def{'fax-mode'} = "0660" if !$def{'fax-mode'};
$def{'fax-mode'} = &ask (" - `fax-mode'
Specifies the permissions to `chmod' the received files.", $def{'fax-mode'});
}
sub inq_f {
$settings = "debug";
$def_f{'debug'} = 4 if !$def_f{'debug'};
$def_f{'debug'} = &ask (" - `debug (sendfax)'
controls the amount of information written into the fax log file.
`0' means \"totally silent\" (not even errors are written), `9'
is really noisy. I usually use `3' or `4' in normal use, and `6'
for debugging.", $def_f{'debug'});
$settings .= " modem-init";
$def{'modem-init'} = &ask (" - `modem-init'
Specifies an `AT...' command that is to be sent to the modem right
at the *beginning* of all modem talk (even before setting the modem
into fax mode, so this could be an `ATZ' if you want to reset the
modem).", "");
$settings .= " modem-handshake";
$def_f{'modem-handshake'} = "AT&H3" if !$def_f{'modem-handshake'};
$def_f{'modem-handshake'} = &ask (" - `modem-handshake'
Specifies an `AT...' command that will be sent to the modem at the
*end* of the modem initialization, right before dialing. *Do not
use ATZ or such here*, since resetting the modem will switch off
fax mode.", $def_f{'modem-handshake'});
$settings .= " max-tries";
$def_f{'max-tries'} = 3 if !$def_f{'max-tries'};
$def_f{'max-tries'} = &ask (" - `max-tries'
Specify the maximum number of tries per page if the receiving end
reports reception errors. If NNN tries do not suffice to
successfully transmit a page, `sendfax' will give up or simply go
on, depending on the setting of `max-tries-continue' (see below).
If this is set to `0', `sendfax' will ignore retransmission
requests and simply go on.", $def_f{'max-tries'});
$settings .= " max-tries-continue";
$def_f{'max-tries-continue'} = "YES" if !$def_f{'max-tries-continue'};
$def_f{'max-tries-continue'} = &ask (" - `max-tries-continue'
After the maximum number of tries for one page are reached,
`sendfax' can report an error and abort (`max-tries-continue NO'),
or go on with the next page (YES).
For \"mission critical\" faxes, I'd set it to NO, but since the page
quality is most often quite good even if reported as \"page bad\",
the default is YES.", $def_f{'max-tries-continue'});
$settings .= " speed (fax)";
$def_f{'speed'} = 38400 if ! $def_f{'speed'};
$def_f{'speed'} = &ask (" - `speed'
Set the port speed to use for fax send operations. Usually,
`38400' is a good choice, but a few dumb modems (for example, some
based on rockwell chipsets) need `19200' or even `9600'. A few
modems can go higher, but `sendfax' may not support it, and it may
not always work.", $def_f{'speed'});
$settings .= " dial-prefix";
$def_f{'dial-prefix'} = "ATD" if !$def_f{'dial-prefix'};
$def_f{'dial-prefix'} = &ask (" - `dial-prefix'
This is the command used for dialing out. Usually this will be
something simple, as `ATD' or `ATDP', but if you have an unusual
setup, it could also be something like `ATX0DP0;X4DT' (meaning:
switch off dial-tone detection, pulse-dial `0', back to command
mode, switch on dial-tone detection, and go ahead dialing with
touch tones). The phone number will be sent right after the
`dial-prefix'.", $def_f{'dial-prefix'});
$settings .= " poll-dir";
$def_f{'poll-dir'} = "./" if !$def_f{'poll-dir'};
$def_f{'poll-dir'} = &ask (" - `poll-dir'
This is used to specify a directory where polled faxes (wheather
maps and such) are to be saved into. Default is the current
directory.", $def_f{'poll-dir'});
$settings .= " normal-res";
$def_f{'normal-res'} = "NO" if !$def_f{'normal-res'};
$def_f{'normal-res'} = &ask (" - `normal-res'
If set to `yes' or `true' (boolean), `sendfax' won't attempt to
make a fax connection in \"fine resolution\" mode. Normally you
won't need to use that option, since `faxrunq' will set the `-n'
switch if needed.", $def_f{'normal-res'});
$settings .= " verbose";
$def_f{'verbose'} = "NO" if !$def_f{'verbose'};
$def_f{'verbose'} = &ask (" - `verbose'
If set to `yes' or `true', `sendfax' will output progress reports
on stdout, if set to `no', `sendfax' will only print error and
warning messages.", $def_f{'verbose'});
}
sub setdef {
local ($p, $l);
$p = shift;
$l = length ($p) + 1;
foreach (keys(%var_m)) {
$def{$_} = substr ($var_m{$_}, $l) if ($var_m{$_} =~ /^$p/);
}
foreach (keys(%var_m)) {
$def{$_} = substr ($var_m{$_}, 1) if (!$def{$_} && $var_m{$_} =~ /^$sep/);
}
foreach (keys(%var_f)) {
$def_f{$_} = substr ($var_f{$_}, $l) if ($var_f{$_} =~ /^$p/);
}
foreach (keys(%var_m)) {
$def_f{$_} = substr ($var_f{$_}, 1) if (!$def_f{$_} && $var_f{$_} =~ /^$sep/);
}
}
sub ask {
($info, $default, $x) = @_;
print STDERR "\n$info: ";
print STDERR "[$default] " if ($default);
$_ = <STDIN>;
s/^\s*//;
chop;
if ($_ eq "") {
return $default;
}
return $_;
}
sub read_config {
local ($conf, $port, $a, $b);
$conf = shift;
$port = $sep;
if ( -f $conf) {
open (F, $conf) || die "$!\n";
while (<F>) {
chop;
s/^\s*//;
next if /^#/;
next if /^$/;
($a, $b) = split (/[ \t\n]+/, $_, 2);
if ($a eq "port") {
$port = $b;
$var{'ports'} .= "$port ";
} else {
$var{$a} = "$port $b";
}
}
close F;
}
}
sub yesno {
print STDERR "$_[0]: ";
print STDERR "[$_[1]] " if ($_[1]);
$_ = <STDIN>;
chop;
$_ = $_[1] if ! $_;
return "y" if /^[Yy].*/;
return "n";
}

View File

@ -0,0 +1,71 @@
bin/autopvf
bin/basictopvf
bin/faxspool
bin/faxq
bin/faxrm
bin/faxrunq
bin/g3cat
bin/g32pbm
bin/g3topbm
bin/newslock
bin/lintopvf
bin/mg.echo
bin/pbm2g3
bin/pvfamp
bin/pvfcut
bin/pvfecho
bin/pvffft
bin/pvffile
bin/pvfmix
bin/pvfreverse
bin/pvfsine
bin/pvfspeed
bin/pvftoau
bin/pvftobasic
bin/pvftolin
bin/pvftormd
bin/pvftovoc
bin/pvftowav
bin/rmdfile
bin/rmdtopvf
bin/vm
bin/voctopvf
bin/wavtopvf
@unexec install-info --delete %D/info/mgetty.info %D/info/dir
info/mgetty.info
info/mgetty.info-1
info/mgetty.info-2
info/mgetty.info-3
info/mgetty.info-4
@exec [ -f %D/info/dir ] || sed -ne '1,/Menu:/p' /usr/share/info/dir > %D/info/dir
@exec install-info %D/info/mgetty.info %D/info/dir
lib/mgetty+sendfax/cour25.pbm
lib/mgetty+sendfax/cour25n.pbm
man/man1/coverpg.1
man/man1/fax.1
man/man1/faxq.1
man/man1/faxrm.1
man/man1/faxrunq.1
man/man1/faxspool.1
man/man1/g3cat.1
man/man1/g32pbm.1
man/man1/pbm2g3.1
man/man1/pvf.1
man/man1/zplay.1
man/man4/mgettydefs.4
man/man5/faxqueue.5
man/man8/callback.8
man/man8/faxrunqd.8
man/man8/mgetty.8
man/man8/sendfax.8
sbin/faxrunqd
sbin/mgetty
sbin/sendfax
sbin/vgetty
@dirrm lib/mgetty+sendfax
@unexec echo "***"
@unexec echo "*** Mgetty binaries, libraries and documentation files"
@unexec echo "*** have been removed. You should remove /etc/mgetty"
@unexec echo "*** directory manually to complete uninstall mgetty."
@unexec echo "*** Don't forget to update /etc/ttys."
@unexec echo "***"

27
comms/mgetty+sendfax/scripts/configure vendored Normal file
View File

@ -0,0 +1,27 @@
#!/bin/sh
cd $WRKSRC || exit 1
cp policy.h-dist policy.h
cat >> policy.h <<END
#undef DEFAULT_LOGIN_PROGRAM
#define DEFAULT_LOGIN_PROGRAM "/usr/bin/login"
#define CNDFILE "dialin.config"
#undef MGETTY_PID_FILE
#define MGETTY_PID_FILE "/var/run/mg-pid.%s"
#undef LOCK
#define LOCK "/var/spool/lock/LCK..%s"
#undef FAX_LOG
#define FAX_LOG "/var/spool/fax/Faxlog"
#undef MAILER
#define MAILER "/usr/sbin/sendmail"
END
exit 0