|
Debian Lenny faxserver con supporto mail |
|
|
|
|
Scritto da Alessandro Pensato
|
|
Sabato 13 Agosto 2011 08:31 |
nano /etc/hostname
fax
nano /etc/hosts
127.0.0.1 localhost.localdomain localhost
192.168.170 fax.home.local fax
nano /etc/apt/sources.list
deb http://mi.mirror.garr.it/mirrors/debian/ lenny main contrib non-free
deb-src http://mi.mirror.garr.it/mirrors/debian/ lenny main contrib non-free
deb http://security.debian.org/ lenny/updates main contrib non-free
deb-src http://security.debian.org/ lenny/updates main contrib non-free
deb http://volatile.debian.org/debian-volatile lenny/volatile main contrib non-free
deb-src http://volatile.debian.org/debian-volatile lenny/volatile main contrib non-free
apt-get update
apt-get upgrade
apt-get dist-upgrade
apt-get install nmap ntpdate
ntpdate server it.pool.ntp.org
apt-get install postfix
* chose No configuration
cp /usr/share/postfix/main.cf.debian /etc/postfix/main.cf
nano /etc/aliases
root: sysadmin@home.local
apt-get install hylafax-server
faxsetup
Country code [1]? 39
Area code [415]? 091
Phone number of fax modem [+1.999.555.1212]? +39.091.1234567
Local identification string (for TSI/CIG) ["NothingSetup"]? HOME-LOCAL Palermo
Long distance dialing prefix [1]? 0
International dialing prefix [011]? 00
Dial string rules file (relative to /var/spool/hylafax) [etc/dialrules]?
Tracing during normal server operation [1]?
Tracing during send and receive sessions [11]?
Protection mode for received facsimile [0600]? 0644
Protection mode for session logs [0600]? 0644
Protection mode for ttyS0 [0600]? 0666
Rings to wait before answering [1]? 2
Modem speaker volume [off]? quiet
Command line arguments to getty program ["-h %l dx_%s"]?
Pathname of TSI access control list file (relative to /var/spool/hylafax) [""]?
Pathname of Caller-ID access control list file (relative to /var/spool/hylafax) [""]?
Tag line font file (relative to /var/spool/hylafax) [etc/lutRS18.pcf]?
Tag line format string ["From %%l|%c|Page %%P of %%T"]?
Time before purging a stale UUCP lock file (secs) [30]?
Hold UUCP lockfile during inbound data calls [Yes]?
Hold UUCP lockfile during inbound voice calls [Yes]?
Percent good lines to accept during copy quality checking [95]?
Max consecutive bad lines to accept during copy quality checking [5]?
Max number of pages to accept in a received facsimile [25]? 50
Syslog facility name for ServerTracing messages [daemon]?
Set UID to 0 to manipulate CLOCAL [""]?
Use available priority job scheduling mechanism [""]?
The non-default server configuration parameters are:
CountryCode: 39
AreaCode: 091
FAXNumber: +39.091.1234567
LongDistancePrefix: 0
InternationalPrefix: 00
DialStringRules: etc/dialrules
SessionTracing: 11
RecvFileMode: 0644
LogFileMode: 0644
DeviceMode: 0666
RingsBeforeAnswer: 2
GettyArgs: "-h %l dx_%s"
LocalIdentifier: HOME-LOCAL Palermo
TagLineFont: etc/lutRS18.pcf
TagLineFormat: "From %%l|%c|Page %%P of %%T"
MaxRecvPages: 50
Are these ok [yes]?
Now we are going to probe the tty port to figure out the type
of modem that is attached. This takes a few seconds, so be patient.
Note that if you do not have the modem cabled to the port, or the
modem is turned off, this may hang (just go and cable up the modem
or turn it on, or whatever).
Probing for best speed to talk to modem: 38400 OK.
About fax classes:
The difference between fax classes has to do with how HylaFAX interacts
with the modem and the fax protocol features that are used when sending
or receiving faxes. One class isn't inherently better than another;
however, one probably will suit a user's needs better than others.
Class 1 relies on HylaFAX to perform the bulk of the fax protocol.
Class 2 relies on the modem to perform the bulk of the fax protocol.
Class 2.0 is similar to Class 2 but may include more features.
Class 1.0 is similar to Class 1 but may add V.34-fax capability.
Class 2.1 is similar to Class 2.0 but adds V.34-fax capability.
HylaFAX generally will have more features when using Class 1/1.0 than
when using most modems' Class 2 or Class 2.0 implementations. Generally
any problems encountered in Class 1/1.0 can be resolved by modifications
to HylaFAX, but usually any problems encountered in Class 2/2.0/2.1 will
require the modem manufacturer to resolve it.
Use Class 1 unless you have a good reason not to.
This modem looks to have support for Class 1 and 2.
How should it be configured [1]?
Hmm, this looks like a Class 1 modem.
Product code (ATI0) is "336".
Other information (ATI3) is "Philips BU PC Add On Cards".
DTE-DCE flow control scheme [default]?
Modem manufacturer is "Unknown".
Modem model is "Unknown".
Using prototype configuration file class1...
There is no prototype configuration file for your modem, so we will
have to fill in the appropriate parameters by hand. You will need the
manual for how to program your modem to do this task. In case you are
uncertain of the meaning of a configuration parameter you should
consult the config(5) manual page for an explanation.
Note that modem commands must be specified exactly as they are to be
sent to the modem. Note also that quote marks (") will not be displayed
and will automatically be deleted. You can use this facility to supply
null parameters as "".
Finally, beware that the set of parameters is long. If you prefer to
use your favorite editor instead of this script you should fill things
in here as best you can and then edit the configuration file
"/var/spool/hylafax/etc/config.ttyS0"
after completing this procedure.
Command to enter Class 1 [AT+FCLASS=1]?
Command to stop and wait prior to sending PPM [AT+FTS=7]?
Command to stop and wait prior to sending TCF [AT+FTS=7]?
Command to stop and wait prior to sending EOP [AT+FTS=9]?
Extra bytes in a received HDLC frame [4]?
Maximum time to wait for OK after aborting a receive (ms) [200]?
Maximum wait for initial identification frame (ms) [40000]?
Command to ensure silence after receiving HDLC and before sending [AT+FRS=7]?
The modem configuration parameters are:
Class1Cmd: AT+FCLASS=1
Class1PPMWaitCmd: AT+FTS=7
Class1TCFWaitCmd: AT+FTS=7
Class1EOPWaitCmd: AT+FTS=9
Class1FrameOverhead: 4
Class1RecvAbortOK: 200
Class1RecvIdentTimer: 40000
Class1SwitchingCmd: AT+FRS=7
Class1TCFMaxNonZero: 10
Class1TCFMinRun: 1000
Are these ok [yes]?
Creating new configuration file /var/spool/hylafax/etc/config.ttyS0...
Creating fifo /var/spool/hylafax/FIFO.ttyS0 for faxgetty... done.
Done setting up the modem configuration.
Checking /var/spool/hylafax/etc/config for consistency...
...everything looks ok; leaving existing file unchanged.
Don't forget to restart hylafax in order to run faxgetty on this new modem
line.
Creating /etc/hylafax/config.ttyS0 from /var/spool/hylafax/etc/config.ttyS0.
Updating /etc/hylafax/setup.cache from /var/spool/hylafax/etc/setup.cache.
Updating /etc/hylafax/setup.modem from /var/spool/hylafax/etc/setup.modem.
/var/spool/hylafax/config
Do you want to run faxaddmodem to configure another modem [yes]? no
You do not appear to be using faxgetty to notify the HylaFAX scheduler
about new modems and/or their status. This means that you must use the
faxmodem program to inform the new faxq process about the modems you
want to have scheduled by HylaFAX. Beware that if you have modems that
require non-default capabilities specified to faxmodem then you should
read faxmodem(8) manual page and do this work yourself (since this
script is not intelligent enough to automatically figure out the modem
capabilities and supply the appropriate arguments).
Should I run faxmodem for each configured modem [yes]?
/usr/sbin/faxmodem ttyS0
Done verifying system setup.
/var/spool/hylafax
nano /etc/hylafax/hosts.hfaxd
localhost:21::
192\.168\.1\.:::
reboot
faxstat -a -s
Password:
HylaFAX scheduler on fax.home.local: Running
Modem ttyS0 (+39.091.1234567): Running and idle
faxadduser -u 100 user
faxadduser -a ++pwdads31 -p ++pwdads31 -u 100 admin
/usr/sbin/faxadduser -f newhosts -a pwd www-data
/usr/sbin/faxdeluser localhost
/usr/sbin/faxdeluser 127.0.0.1
echo 127.0.0.1 >> newhosts
cat /etc/hylafax/hosts.hfaxd >> newhosts
cat newhosts > /etc/hylafax/hosts.hfaxd
rm -f newhosts
reboot
apt-get install apache2-utils apache2 libapache2-mod-php5 php5 \
php-pear php5-mysql php5-pgsql php5-cli php5-cgi mysql-server netpbm php5-imagick dh-make-php \
libmagic-dev libungif4g libpng3 sudo libtiff4-dev gs-gpl gsfonts expect php5-dev make php-pear \
psutils libnetpbm10-dev libungif-bin libungif4-dev php-db php-file php-http php-mail \
php-mail-mime php-net-smtp php-net-socket php-xml-parser wdiff php5-gd php5-dev
Nuova password per l'utente «root» di MySQL:
Ripetere la password per l'utente «root» di MySQL:
cd /usr/src
wget http://downloads.sourceforge.net/project/avantfax/avantfax-3.2.2.tgz?use_mirror=switch
tar zvxf avantfax-3.2.2.tgz
cd avantfax-3.2.2
pear channel-update pear.php.net
pear upgrade-all
pear install Mail Net_SMTP Mail_mime MDB2_driver_mysql MDB2_driver_pgsql
pecl install fileinfo
chmod 0770 avantfax/includes/templates/admin_theme/templates_c/ avantfax/includes/templates/admin_theme/cache/ avantfax/includes/templates/main_theme/templates_c/ avantfax/includes/templates/main_theme/cache/
chown www-data:www-data avantfax/includes/templates/admin_theme/templates_c/ avantfax/includes/templates/admin_theme/cache/ avantfax/includes/templates/main_theme/templates_c/ avantfax/includes/templates/main_theme/cache/
chmod 0755 avantfax/includes/faxcover.php avantfax/includes/faxrcvd.php avantfax/includes/notify.php avantfax/tools/update_contacts.php avantfax/tools/faxcover.php avantfax/includes/avantfaxcron.php
cp avantfax/includes/local_config-example.php avantfax/includes/local_config.php
nano avantfax/includes/local_config.php
$FAXRMPWD = "pwd";
define ('ADMIN_EMAIL', 'sysadmin@home.local');
$AVANTFAX_SERVERNAME = 'fax.home.local'; //
/usr/sbin/faxadduser -f newhosts -a pwd www-data
/usr/sbin/faxdeluser localhost
/usr/sbin/faxdeluser 127.0.0.1
echo 127.0.0.1 >> newhosts
cat /var/spool/hylafax/etc/hosts.hfaxd >> newhosts
cat newhosts > /var/spool/hylafax/etc/hosts.hfaxd
rm -f newhosts
echo 'JobFmt: "%-3j %3i %1a %15o %40M %-12.12e %5P %5D %7z %.25s"' >> /etc/hylafax/hyla.conf
nano /etc/hylafax/hyla.conf
FontMap: /usr/share/gs-esp/8.15/lib:/usr/share/gs-esp/7.07/lib:/usr/share/gs/6.53:/var/lib/defoma/gs.d/dirs/fonts
FontPath: /usr/share/fonts/type1/gsfonts
mv avantfax /var/www/avantfax
chown -R www-data:www-data /var/www/avantfax
chmod -R 777 /var/www/avantfax/tmp /var/www/avantfax/faxes
nano /etc/apache2/sites-enabled/000-default
ServerAdmin webmaster@localhost
DocumentRoot /var/www/avantfax
Options FollowSymLinks
AllowOverride None
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
/etc/init.d/mysql restart
/etc/init.d/apache2 restart
mysql --user=root -p -e "GRANT ALL ON avantfax.* TO avantfax@localhost IDENTIFIED BY \"d58fe49\"" mysql
mysqladmin --default-character-set=utf8 --user=avantfax --password=d58fe49 create avantfax
mysql --user=avantfax --password=d58fe49 avantfax < create_tables.sql
mysqlshow --user=avantfax --password=d58fe49 avantfax
Database: avantfax
+------------------+
| Tables |
+------------------+
| AddressBook |
| AddressBookEmail |
| AddressBookFAX |
| BarcodeRoute |
| CoverPages |
| DIDRoute |
| DistroList |
| DynConf |
| FaxArchive |
| FaxCategory |
| Modems |
| SysLog |
| UserAccount |
| UserPasswords |
+------------------+
ln -s /var/www/avantfax/includes/faxrcvd.php /var/spool/hylafax/bin/faxrcvd.php
ln -s /var/www/avantfax/includes/notify.php /var/spool/hylafax/bin/notify.php
mv /usr/bin/faxcover /usr/bin/faxcover.old
ln -s /var/www/avantfax/includes/faxcover.php /usr/bin/faxcover
ln -s /usr/share/file/magic* /usr/share/misc/
cat /etc/sudoers | grep -v requiretty > /tmp/sudoers
echo "www-data ALL= NOPASSWD: /sbin/reboot, /sbin/halt, /usr/sbin/faxdeluser, /usr/sbin/faxadduser -u * -p * *" >> /tmp/sudoers
mv /etc/sudoers /etc/sudoers.orig
mv /tmp/sudoers /etc/sudoers
chmod 0440 /etc/sudoers
nano /var/spool/hylafax/etc/config
#
## AvantFAX configuration
#
NotifyCmd: bin/notify.php
nano /var/spool/hylafax/etc/config.ttyS0
#
## AvantFAX configuration
#
FaxrcvdCmd: bin/faxrcvd.php
crontab -l > /tmp/tab
echo -e "0 0 * * *\t/var/www/avantfax/includes/avantfaxcron.php -t 2" >> /tmp/tab
crontab /tmp/tab
rm -f /tmp/tab
mv /var/spool/hylafax/etc/config /etc/hylafax/config
mv /var/spool/hylafax/etc/hosts.hfaxd /etc/hylafax/hosts.hfaxd
mv /var/spool/hylafax/etc/config.ttyS0 /etc/hylafax/config.ttyS0
/etc/init.d/hylafax restart
nano /etc/postfix/master.cf
#smtp inet n - - - - smtpd
fax unix - n n - 1 pipe
flags= user=faxmail argv=/usr/bin/faxmail -d -n \${user}
nano /etc/postfix/transport
home.local fax:localhost
postmap /etc/postfix/transport
nano /etc/postfix/main.cf
fax_destination_recipient_limit = 1
nano /etc/hylafax/faxmail.conf
AutoCoverPage: false
TextPointSize: 12pt
Headers: Message-id Date Subject From
MailUser: faxmail
/etc/init.d/postfix reload
|