Raspberry Pi でFAX送信サーバーを構築
準備(必要な環境)
- Raspberry Pi
- モデム(ここではRS-USB56N)
- 電話線(ひかり電話でも可)
モデムの認識
dmesg | grep "USB ACM"
- 上記でモデムが認識されていることを確認
- そのとき表示されたデバイスファイル名「
tty*
」をメモする。
HylaFAXの設定
$ sudo apt install hylafax-server #HylaFAXをインストール $ sudo faxsetup #HylaFAXの初期設定を実行 Are these ok [yes]?:yes Can I terminate this faxq process [yes]? :Enter Should I restart the HylaFAX server processes [yes]? :Enter Do you want to run faxaddmodem to configure a modem [yes]? :Enter Serial port that modem is connected to [ttyS0]? :tty* #先ほど確認したデバイスファイル名 Country code [1]? :81 Area code [415]? :3 #東京の場合。市外局番の頭0を抜いた数字 Phone number of fax modem [+1.999.555.1212]? :+81.3.123.4567 #(電話番号) Local identification string (for TSI/CIG) [“NothingSetup”]? : "031234567" #送信者の名前。電話番号など Long distance dialing prefix [1]? :0 International dialing prefix [011]? :010 Dial string rules file (relative to /var/spool/hylafax) [etc/dialrules]? :Enter Tracing during normal server operation [1]? :Enter Tracing during send and receive sessions [11]? :Enter Protection mode for received facsimile [0600]? :Enter Protection mode for session logs [0600]? :Enter Protection mode for tty* [0600]? :Enter Rings to wait before answering [1]? :10 #電話を受けるまでのコール数を入力 Modem speaker volume [off]? :Enter Command line arguments to getty program [“-h %l dx_%s”]? :"From\ %%l|%F\ %T\ %Z|Page\ %%P\ of\ %%T" #文字化けするので指定する Pathname of TSI access control list file (relative to /var/spool/hylafax) [“”]? :Enter Pathname of Caller-ID access control list file (relative to /var/spool/hylafax) [“”]? :Enter Tag line font file (relative to /var/spool/hylafax) [etc/lutRS18.pcf]? :Enter Tag line format string [“From %%l|%c|Page %%P of %%T”]? :Enter Time before purging a stale UUCP lock file (secs) [30]? :Enter Hold UUCP lockfile during inbound data calls [Yes]? :Enter Hold UUCP lockfile during inbound voice calls [Yes]? :Enter Percent good lines to accept during copy quality checking [95]? :Enter Max consecutive bad lines to accept during copy quality checking [5]? :Enter Max number of pages to accept in a received facsimile [25]? :Enter Syslog facility name for ServerTracing messages [daemon]? :Enter Set UID to 0 to manipulate CLOCAL [“”]? :Enter Use available priority job scheduling mechanism [“”]? :Enter Are these ok [yes]? :yes #確認して問題があればno How should it be configured [1.0]? :Enter DTE-DCE flow control scheme [default]? :Enter Are these ok [yes]? :Enter Are these ok [yes]? :Enter Do you want to run faxaddmodem to configure another modem [yes]? :no #他にモデムがあり設定する場合はyes
間違えた場合は「
」で編集する。sudo vi /var/spool/hylafax/etc/config.tty*
FAX用ユーザーの設定
$ sudo useradd -m faxuser #FAX用のユーザー(ここではfaxuser)を設定 $ sudo passwd faxuser #FAX用ユーザーのパスワードを入力 $ sudo faxadduser faxuser #faxを利用できるようにする $ sudo /etc/init.d/hylafax restart #HylaFAXを再起動
FAXの送信
sendfax -n -d [送信先電話番号] [送信ファイル]
送信したいPDFなどを上記コマンドで指定し、でファイルをFAX送信する。