aboutsummaryrefslogtreecommitdiffstats
path: root/comms/mgetty+sendfax
diff options
context:
space:
mode:
authorjmz <jmz@FreeBSD.org>1997-04-05 11:56:17 +0800
committerjmz <jmz@FreeBSD.org>1997-04-05 11:56:17 +0800
commit5268ad01d09a4ca07d90207973d4be86c995c061 (patch)
tree1d8085010883db95f329f1f02cfec7a50949cdfe /comms/mgetty+sendfax
parente7faffd82768aa7bf43b09313c3cc4b949a60a36 (diff)
downloadfreebsd-ports-gnome-5268ad01d09a4ca07d90207973d4be86c995c061.tar.gz
freebsd-ports-gnome-5268ad01d09a4ca07d90207973d4be86c995c061.tar.zst
freebsd-ports-gnome-5268ad01d09a4ca07d90207973d4be86c995c061.zip
Upgrade to version 1.0.0
Diffstat (limited to 'comms/mgetty+sendfax')
-rw-r--r--comms/mgetty+sendfax/Makefile10
-rw-r--r--comms/mgetty+sendfax/distinfo2
-rw-r--r--comms/mgetty+sendfax/files/mgettycfg.in296
-rw-r--r--comms/mgetty+sendfax/files/patch-aa11
-rw-r--r--comms/mgetty+sendfax/files/patch-ab22
-rw-r--r--comms/mgetty+sendfax/files/patch-ad8
-rw-r--r--comms/mgetty+sendfax/pkg-install296
-rw-r--r--comms/mgetty+sendfax/pkg-plist11
8 files changed, 429 insertions, 227 deletions
diff --git a/comms/mgetty+sendfax/Makefile b/comms/mgetty+sendfax/Makefile
index 523007501bf9..945acf66f75d 100644
--- a/comms/mgetty+sendfax/Makefile
+++ b/comms/mgetty+sendfax/Makefile
@@ -1,21 +1,21 @@
# New ports collection makefile for: mgetty+sendfax
-# Version required: 0.99
+# Version required: 1.0.0
# Date created: 21 September 1994
# Whom: jmz
#
-# $Id: Makefile,v 1.15 1996/11/22 11:03:01 asami Exp $
+# $Id: Makefile,v 1.16 1996/11/27 11:53:23 asami Exp $
#
-DISTNAME= mgetty-0.99
+DISTNAME= mgetty-1.0.0
CATEGORIES= comms
MASTER_SITES= ftp://ftp.leo.org/pub/comp/networking/communication/modem/mgetty/
-DISTFILES= mgetty099-Aug07.tar.gz
+DISTFILES= mgetty+sendfax-1.0.0.tar.gz
MAINTAINER= jmz@FreeBSD.org
MAKE_FLAGS= prefix=${PREFIX} -f
MAN1= coverpg.1 fax.1 faxq.1 faxrm.1 faxrunq.1 faxspool.1 \
- g3cat.1 g3topbm.1 pbmtog3.1
+ g3cat.1 g32pbm.1 pbm2g3.1
MAN4= mgettydefs.4
MAN5= faxqueue.5
MAN8= sendfax.8 mgetty.8 callback.8
diff --git a/comms/mgetty+sendfax/distinfo b/comms/mgetty+sendfax/distinfo
index 27b214333e87..676d8f648cc3 100644
--- a/comms/mgetty+sendfax/distinfo
+++ b/comms/mgetty+sendfax/distinfo
@@ -1 +1 @@
-MD5 (mgetty099-Aug07.tar.gz) = f53e6cd16b8b9f6b6d58c512b95522e2
+MD5 (mgetty+sendfax-1.0.0.tar.gz) = bc1a52dbb9f9e412d927e82778c76c9e
diff --git a/comms/mgetty+sendfax/files/mgettycfg.in b/comms/mgetty+sendfax/files/mgettycfg.in
index f014f400acfb..c1dfb6106cdf 100644
--- a/comms/mgetty+sendfax/files/mgettycfg.in
+++ b/comms/mgetty+sendfax/files/mgettycfg.in
@@ -7,6 +7,14 @@ $prefix = $ENV{'PKG_PREFIX'};
$sep = "~";
&read_config ("$prefix/etc/mgetty+sendfax/mgetty.config");
+foreach (keys(%var)) {
+ $var_m{$_} = $var{$_};
+ delete $var{$_};
+}
+&read_config ("$prefix/etc/mgetty+sendfax/sendfax.config");
+foreach (keys(%var)) {
+ $var_f{$_} = $var{$_};
+}
$a = 1;
$devices = $var{'ports'} ? $var{'ports'} : "cuaa1";
@@ -28,28 +36,39 @@ while ($a) {
}
}
-open (TMP, ">/tmp/mgetty.config.$$") || die "$!\n";
+open (TMP1, ">/tmp/mgetty.config.$$") || die "$!\n";
+open (TMP2, ">/tmp/sendfax.config.$$") || die "$!\n";
$_ = join (":", $devices);
-print TMP "fax-devices $_\n\n";
+print TMP2 "fax-devices $_\n\n";
$_ = $devices;
foreach $port (split) {
print STDERR "\n\n *** Configuring for port $port ***\n\n";
- print TMP "\nport $_\n";
+ print TMP1 "\nport $port\n";
+ print TMP2 "\nport $port\n";
&setdef ($port);
again:
- &inq;
+ &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 (TMP);
+close (TMP1);
+close (TMP2);
if ( -e "$prefix/etc/mgetty+sendfax/mgetty.config") {
system ("mv -f $prefix/etc/mgetty+sendfax/mgetty.config $prefix/etc/mgetty+sendfax/mgetty.config.old");
+ system ("rm -f $prefix/etc/mgetty+sendfax/mgetty.config");
+}
+if ( -e "$prefix/etc/mgetty+sendfax/sendfax.config") {
+ system ("mv -f $prefix/etc/mgetty+sendfax/sendfax.config $prefix/etc/mgetty+sendfax/sendfax.config.old");
+ system ("rm -f $prefix/etc/mgetty+sendfax/sendfax.config");
}
system ("mv -f /tmp/mgetty.config.$$ $prefix/etc/mgetty+sendfax/mgetty.config");
-system ("ln -sf $prefix/etc/mgetty+sendfax/mgetty.config $prefix/etc/mgetty+sendfax/sendfax.config");
+system ("mv -f /tmp/sendfax.config.$$ $prefix/etc/mgetty+sendfax/sendfax.config");
open (F, ">$prefix/etc/mgetty+sendfax/faxheader");
print F "\n FAX FROM: **not configured** $def{fax-id} TO: @T@ PAGE: @P@ OF @M@ \n";
@@ -90,34 +109,44 @@ exit 0;
sub confirm {
$_ = shift;
print STDERR "\n\n\tSettings for port $_\n\t------------------------\n";
- $_ = $settings;
+ $_ = $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;
+ $_ = $settings_m;
+ foreach (split) {
+ print TMP1 "$_ $def{$_}\n" if ($def{$_});
+ }
+ $_ = $settings_f;
foreach (split) {
- print TMP "$_ $def{$_}\n" if ($def{$_});
+ print TMP2 "$_ $def_f{$_}\n" if ($def_f{$_});
}
}
-sub inq {
+sub inq_m {
$settings = "debug";
$def{'debug'} = 4 if !$def{'debug'};
- $def{'debug'} = &ask (" - `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'});
+ 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{'fax-id'}) ;
+ $def_f{'fax-id'} = $def{'fax-id'} ;
$settings .= " speed";
$def{'speed'} = 38400 if !$def{'speed'};
@@ -126,85 +155,16 @@ sub inq {
38400. If the given speed is not valid, `mgetty' complains loudly
and exits.", $def{'speed'});
- $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{'modem-handshake'} = "AT&H3" if !$def{'modem-handshake'};
- $def{'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{'modem-handshake'});
-
- $settings .= " max-tries";
- $def{'max-tries'} = 3 if !$def{'max-tries'};
- $def{'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{'max-tries'});
-
- $settings .= " max-tries-continue";
- $def{'max-tries-continue'} = "YES" if !$def{'max-tries-continue'};
- $def{'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{'max-tries-continue'});
-
- $settings .= " dial-prefix";
- $def{'dial-prefix'} = "ATD" if !$def{'dial-prefix'};
- $def{'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{'dial-prefix'});
-
- $settings .= " poll-dir";
- $def{'poll-dir'} = "./" if !$def{'poll-dir'};
- $def{'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{'poll-dir'});
-
- $settings .= " normal-res";
- $def{'normal-res'} = "NO" if !$def{'normal-res'};
- $def{'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{'normal-res'});
-
- $settings .= " verbose";
- $def{'verbose'} = "NO" if !$def{'verbose'};
- $def{'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{'verbose'});
-
-
-
$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.). Reply YES or NO", $def{'switchbd'});
+ *not need* this.). Set speed or `0'", $def{'switchbd'});
+ $def_f{'switchbd'} = $def{'switchbd'};
$settings .= " direct";
$def{'direct'} = "NO" if !$def{'direct'};
@@ -293,6 +253,7 @@ sub inq {
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'};
@@ -306,7 +267,29 @@ sub inq {
\"\" \\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'
@@ -325,6 +308,7 @@ sub inq {
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'
@@ -370,6 +354,25 @@ sub inq {
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'
@@ -407,6 +410,12 @@ sub inq {
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'
@@ -454,37 +463,128 @@ sub inq {
$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'} = 38000 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 ($port, $l);
- $port = shift;
- $l = length ($port) + 1;
- foreach (keys(%var)) {
- $def{$_} = substr ($var{$_}, $l) if ($var{$_} =~ /^$port$sep/);
+ 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)) {
- $def{$_} = substr ($var{$_}, 1) if (!$def{$_} && $var{$_} =~ /^$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 "$info: ";
+ print STDERR "\n$info: ";
print STDERR "[$default] " if ($default);
$_ = <STDIN>;
s/^\s*//;
chop;
- return $_ ? $_ : $default;
+ if ($_ eq "") {
+ return $default;
+ }
+ return $_;
}
sub read_config {
local ($conf, $port, $a, $b);
$conf = shift;
$port = $sep;
- foreach (keys(%var)) {
- delete $var{$_};
- }
if ( -f $conf) {
open (F, $conf) || die "$!\n";
while (<F>) {
diff --git a/comms/mgetty+sendfax/files/patch-aa b/comms/mgetty+sendfax/files/patch-aa
index 6e9ac65b7c16..0de9d3f812c3 100644
--- a/comms/mgetty+sendfax/files/patch-aa
+++ b/comms/mgetty+sendfax/files/patch-aa
@@ -1,25 +1,26 @@
-*** fax/faxspool.in~ Wed Aug 30 12:41:17 1995
---- fax/faxspool.in Mon Mar 11 04:43:21 1996
+*** fax/faxspool.in.orig Sat Apr 5 02:58:15 1997
+--- fax/faxspool.in Sat Apr 5 02:59:21 1997
***************
-*** 287,297 ****
+*** 299,309 ****
# user name (for authentification)
##########
! if user=`logname 2>/dev/null`
! then :
else
-! id=`id`
+ id=`id`
! user=`expr "$id" : "[^( ]*(\([^)]*\)"`
fi
test -z "$user" && user=$LOGNAME
test -z "$user" && user=$USER
---- 287,296 ----
+--- 299,309 ----
# user name (for authentification)
##########
! if [ `id -u` = 0 ]; then
! user=root
else
+ id=`id`
! user=`logname`
fi
test -z "$user" && user=$LOGNAME
diff --git a/comms/mgetty+sendfax/files/patch-ab b/comms/mgetty+sendfax/files/patch-ab
index ea1af28a84dd..52cbc54ad815 100644
--- a/comms/mgetty+sendfax/files/patch-ab
+++ b/comms/mgetty+sendfax/files/patch-ab
@@ -1,5 +1,5 @@
-*** Makefile~ Sat Jul 13 12:46:57 1996
---- Makefile Fri Sep 13 03:15:16 1996
+*** Makefile.orig Sat Apr 5 02:51:49 1997
+--- Makefile Sat Apr 5 02:56:32 1997
***************
*** 4,11 ****
#
@@ -49,12 +49,12 @@
# For FreeBSD, add "-lutil" if the linker complains about
# "utmp.o: unresolved symbod _login"
#
-! LDFLAGS=-lutil
+! LDFLAGS= -lutil
#LDFLAGS=-lprot -lsocket
#LDFLAGS=-s -shlib
#LDFLAGS=-lsocket
***************
-*** 251,259 ****
+*** 252,260 ****
# please use the "mg.echo" program provided in the compat/ subdirectory.
# Set ECHO="mg.echo" and INSTALL_MECHO to mg.echo
#
@@ -64,7 +64,7 @@
#
# for mgetty, that's it. If you want to use the voice
---- 251,259 ----
+--- 252,260 ----
# please use the "mg.echo" program provided in the compat/ subdirectory.
# Set ECHO="mg.echo" and INSTALL_MECHO to mg.echo
#
@@ -75,7 +75,7 @@
#
# for mgetty, that's it. If you want to use the voice
***************
-*** 530,536 ****
+*** 536,542 ****
install: install.bin install.doc
install.bin: mgetty sendfax kvg newslock \
@@ -83,7 +83,7 @@
#
# binaries
#
---- 530,536 ----
+--- 536,542 ----
install: install.bin install.doc
install.bin: mgetty sendfax kvg newslock \
@@ -92,7 +92,7 @@
# binaries
#
***************
-*** 548,562 ****
+*** 554,568 ****
# data files + directories
#
test -d $(LIBDIR) || \
@@ -107,8 +107,8 @@
! $(INSTALL) -o root -m 600 sendfax.config $(CONFDIR)/
test -f $(CONFDIR)/dialin.config || \
$(INSTALL) -o root -m 600 dialin.config $(CONFDIR)/
- #
---- 548,562 ----
+ test -f $(CONFDIR)/faxrunq.config || \
+--- 554,568 ----
# data files + directories
#
test -d $(LIBDIR) || \
@@ -123,4 +123,4 @@
! # $(INSTALL) -o root -m 600 sendfax.config $(CONFDIR)/
test -f $(CONFDIR)/dialin.config || \
$(INSTALL) -o root -m 600 dialin.config $(CONFDIR)/
- #
+ test -f $(CONFDIR)/faxrunq.config || \
diff --git a/comms/mgetty+sendfax/files/patch-ad b/comms/mgetty+sendfax/files/patch-ad
index 47807f04e1f5..093ca6c8acbf 100644
--- a/comms/mgetty+sendfax/files/patch-ad
+++ b/comms/mgetty+sendfax/files/patch-ad
@@ -1,11 +1,11 @@
-*** doc/Makefile~ Mon Jul 29 18:44:40 1996
---- doc/Makefile Fri Sep 13 22:06:59 1996
+*** doc/Makefile.orig Sat Apr 5 03:00:23 1997
+--- doc/Makefile Sat Apr 5 03:00:48 1997
***************
*** 26,32 ****
all:
-! doc-all: mgetty.asc mgetty.info mgetty.dvi mgetty.ps fmt-manpages
+! doc-all: mgetty.asc mgetty.info mgetty.dvi mgetty.ps fmt-manpages $(MANSRC)
manpages: $(MANSRC)
@@ -13,7 +13,7 @@
all:
-! doc-all: mgetty.asc mgetty.info fmt-manpages
+! doc-all: mgetty.asc mgetty.info fmt-manpages $(MANSRC)
manpages: $(MANSRC)
diff --git a/comms/mgetty+sendfax/pkg-install b/comms/mgetty+sendfax/pkg-install
index f014f400acfb..c1dfb6106cdf 100644
--- a/comms/mgetty+sendfax/pkg-install
+++ b/comms/mgetty+sendfax/pkg-install
@@ -7,6 +7,14 @@ $prefix = $ENV{'PKG_PREFIX'};
$sep = "~";
&read_config ("$prefix/etc/mgetty+sendfax/mgetty.config");
+foreach (keys(%var)) {
+ $var_m{$_} = $var{$_};
+ delete $var{$_};
+}
+&read_config ("$prefix/etc/mgetty+sendfax/sendfax.config");
+foreach (keys(%var)) {
+ $var_f{$_} = $var{$_};
+}
$a = 1;
$devices = $var{'ports'} ? $var{'ports'} : "cuaa1";
@@ -28,28 +36,39 @@ while ($a) {
}
}
-open (TMP, ">/tmp/mgetty.config.$$") || die "$!\n";
+open (TMP1, ">/tmp/mgetty.config.$$") || die "$!\n";
+open (TMP2, ">/tmp/sendfax.config.$$") || die "$!\n";
$_ = join (":", $devices);
-print TMP "fax-devices $_\n\n";
+print TMP2 "fax-devices $_\n\n";
$_ = $devices;
foreach $port (split) {
print STDERR "\n\n *** Configuring for port $port ***\n\n";
- print TMP "\nport $_\n";
+ print TMP1 "\nport $port\n";
+ print TMP2 "\nport $port\n";
&setdef ($port);
again:
- &inq;
+ &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 (TMP);
+close (TMP1);
+close (TMP2);
if ( -e "$prefix/etc/mgetty+sendfax/mgetty.config") {
system ("mv -f $prefix/etc/mgetty+sendfax/mgetty.config $prefix/etc/mgetty+sendfax/mgetty.config.old");
+ system ("rm -f $prefix/etc/mgetty+sendfax/mgetty.config");
+}
+if ( -e "$prefix/etc/mgetty+sendfax/sendfax.config") {
+ system ("mv -f $prefix/etc/mgetty+sendfax/sendfax.config $prefix/etc/mgetty+sendfax/sendfax.config.old");
+ system ("rm -f $prefix/etc/mgetty+sendfax/sendfax.config");
}
system ("mv -f /tmp/mgetty.config.$$ $prefix/etc/mgetty+sendfax/mgetty.config");
-system ("ln -sf $prefix/etc/mgetty+sendfax/mgetty.config $prefix/etc/mgetty+sendfax/sendfax.config");
+system ("mv -f /tmp/sendfax.config.$$ $prefix/etc/mgetty+sendfax/sendfax.config");
open (F, ">$prefix/etc/mgetty+sendfax/faxheader");
print F "\n FAX FROM: **not configured** $def{fax-id} TO: @T@ PAGE: @P@ OF @M@ \n";
@@ -90,34 +109,44 @@ exit 0;
sub confirm {
$_ = shift;
print STDERR "\n\n\tSettings for port $_\n\t------------------------\n";
- $_ = $settings;
+ $_ = $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;
+ $_ = $settings_m;
+ foreach (split) {
+ print TMP1 "$_ $def{$_}\n" if ($def{$_});
+ }
+ $_ = $settings_f;
foreach (split) {
- print TMP "$_ $def{$_}\n" if ($def{$_});
+ print TMP2 "$_ $def_f{$_}\n" if ($def_f{$_});
}
}
-sub inq {
+sub inq_m {
$settings = "debug";
$def{'debug'} = 4 if !$def{'debug'};
- $def{'debug'} = &ask (" - `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'});
+ 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{'fax-id'}) ;
+ $def_f{'fax-id'} = $def{'fax-id'} ;
$settings .= " speed";
$def{'speed'} = 38400 if !$def{'speed'};
@@ -126,85 +155,16 @@ sub inq {
38400. If the given speed is not valid, `mgetty' complains loudly
and exits.", $def{'speed'});
- $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{'modem-handshake'} = "AT&H3" if !$def{'modem-handshake'};
- $def{'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{'modem-handshake'});
-
- $settings .= " max-tries";
- $def{'max-tries'} = 3 if !$def{'max-tries'};
- $def{'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{'max-tries'});
-
- $settings .= " max-tries-continue";
- $def{'max-tries-continue'} = "YES" if !$def{'max-tries-continue'};
- $def{'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{'max-tries-continue'});
-
- $settings .= " dial-prefix";
- $def{'dial-prefix'} = "ATD" if !$def{'dial-prefix'};
- $def{'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{'dial-prefix'});
-
- $settings .= " poll-dir";
- $def{'poll-dir'} = "./" if !$def{'poll-dir'};
- $def{'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{'poll-dir'});
-
- $settings .= " normal-res";
- $def{'normal-res'} = "NO" if !$def{'normal-res'};
- $def{'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{'normal-res'});
-
- $settings .= " verbose";
- $def{'verbose'} = "NO" if !$def{'verbose'};
- $def{'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{'verbose'});
-
-
-
$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.). Reply YES or NO", $def{'switchbd'});
+ *not need* this.). Set speed or `0'", $def{'switchbd'});
+ $def_f{'switchbd'} = $def{'switchbd'};
$settings .= " direct";
$def{'direct'} = "NO" if !$def{'direct'};
@@ -293,6 +253,7 @@ sub inq {
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'};
@@ -306,7 +267,29 @@ sub inq {
\"\" \\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'
@@ -325,6 +308,7 @@ sub inq {
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'
@@ -370,6 +354,25 @@ sub inq {
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'
@@ -407,6 +410,12 @@ sub inq {
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'
@@ -454,37 +463,128 @@ sub inq {
$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'} = 38000 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 ($port, $l);
- $port = shift;
- $l = length ($port) + 1;
- foreach (keys(%var)) {
- $def{$_} = substr ($var{$_}, $l) if ($var{$_} =~ /^$port$sep/);
+ 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)) {
- $def{$_} = substr ($var{$_}, 1) if (!$def{$_} && $var{$_} =~ /^$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 "$info: ";
+ print STDERR "\n$info: ";
print STDERR "[$default] " if ($default);
$_ = <STDIN>;
s/^\s*//;
chop;
- return $_ ? $_ : $default;
+ if ($_ eq "") {
+ return $default;
+ }
+ return $_;
}
sub read_config {
local ($conf, $port, $a, $b);
$conf = shift;
$port = $sep;
- foreach (keys(%var)) {
- delete $var{$_};
- }
if ( -f $conf) {
open (F, $conf) || die "$!\n";
while (<F>) {
diff --git a/comms/mgetty+sendfax/pkg-plist b/comms/mgetty+sendfax/pkg-plist
index 58580118a3f6..36b6bdf70c34 100644
--- a/comms/mgetty+sendfax/pkg-plist
+++ b/comms/mgetty+sendfax/pkg-plist
@@ -1,15 +1,16 @@
-@cd /usr/local
bin/faxspool
bin/faxq
bin/faxrm
bin/faxrunq
bin/g3cat
-bin/g3topbm
+bin/g32pbm
bin/kvg
bin/newslock
bin/mg.echo
-bin/pbmtog3
+bin/pbm2g3
etc/mgetty+sendfax/dialin.config
+etc/mgetty+sendfax/login.config
+etc/mgetty+sendfax/faxrunq.config
info/mgetty.info
info/mgetty.info-1
info/mgetty.info-2
@@ -24,8 +25,8 @@ man/man1/faxrm.1.gz
man/man1/faxrunq.1.gz
man/man1/faxspool.1.gz
man/man1/g3cat.1.gz
-man/man1/g3topbm.1.gz
-man/man1/pbmtog3.1.gz
+man/man1/g32pbm.1.gz
+man/man1/pbm2g3.1.gz
man/man4/mgettydefs.4.gz
man/man5/faxqueue.5.gz
man/man8/sendfax.8.gz