HylaFAX The world's
most advanced open source fax server
|
|
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
Re: [hylafax-users] $DEVICE in FaxDispatch
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Marty Westra wrote, on 26.07.2008 03:58:
|
| Here’s my FaxDispatch file (sanitized, of course):
Hello Marty,
the file is a bit too "sanitized". Since you made all e-mail addresses
the same, I cannot guess how exactly you want to distribute the
documents to your users.
I suggest to use something like user1@xxxxxxxxxxx, user2@xxxxxxxxxxx
etc. to make clear whether the addresses are the same or different.
| case "$DEVICE" in
|
| ttyS14) SENDTO=xxxxxx@xxxxxxxxxxxxxxxx;;
|
| ttyS0) SENDTO= xxxxxx@xxxxxxxxxxxxxxxx;;
|
| *) SENDTO= xxxxxx@xxxxxxxxxxxxxxxx;;
|
| esac
Here is a bug in your shell script. The following case statement will
overwrite any SENDTO value you have set above because it has a
default(*) case
| case "$SENDER" in
|
| *815*389*xxxx*) SENDTO=
| xxxxxx@xxxxxxxxxxxxxxxx; FILETYPE=tif;;
|
| *61294xxxx *) SENDTO= xxxxxx@xxxxxxxxxxxxxxxx;
| FILETYPE=tif;;
[...]
| *338*xxxx*) SENDTO=
| xxxxxx@xxxxxxxxxxxxxxxx; FILETYPE=tif;;
|
| 0) SENDTO=
| xxxxxx@xxxxxxxxxxxxxxxx; FILETYPE=tif;;
|
| *) SENDTO= xxxxxx@xxxxxxxxxxxxxxxx;
FILETYPE=tif;;
|
| esac
If you set FILETYPE=tif in (nearly) every case, I suggest to do this
once before the case statement and optionally change it in some cases if
necessary.
You might want something like this:
FILETYPE=tif
SENDTO=
# first I set SENDTO based on SENDER
case "$SENDER" in
# note: there must not be a space after SENDTO=
~ *815*389*xxxx*) SENDTO=user1@xxxxxxxxxxxxxxxx ;;
~ *61294xxxx *) SENDTO=user2@xxxxxxxxxxxxxxxx ;;
[...]
~ *1*605*338*xxxx*) SENDTO=user7@xxxxxxxxxxxxxxxx ;;
# example for a user that should get a different file format
~ *338*xxxx*) SENDTO=user8@xxxxxxxxxxxxxxxx ; FILETYPE=pdf ;;
~ 0) SENDTO=user9@xxxxxxxxxxxxxxxx;;
# note: I do not set SENDTO in the default (*) case.
esac
# now I set SENDTO based on DEVICE only if it is not yet set
if [ -z "$SENDTO" ]
then
~ case "$DEVICE" in
~ ttyS14) SENDTO=user10@xxxxxxxxxxxxxxxx;;
~ ttyS0) SENDTO=user11@xxxxxxxxxxxxxxxx;;
~ *) SENDTO=user12@xxxxxxxxxxxxxxxx;;
~ esac
fi
Or you could do it the other way round that you always set a specific
user for some devices and select a user based on the sender for others.
Bodo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkiK7NAACgkQnMz9fgzDSqfd3QCeOpHwDVJFyX00kwOcXUye9fHg
oG4An0h2vYNPON+tZM0aLdmRM0wgoLSL
=P2il
-----END PGP SIGNATURE-----
____________________ HylaFAX(tm) Users Mailing List _______________________
To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx < /dev/null
*To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxx*