Shogo Mori
smori****@desig*****
2017年 2月 17日 (金) 15:06:06 JST
西島様 お世話になっております。 デージーネットの森です。 ご連絡ありがとうございました。 > zip ファイルの中のファイルが空になることはなくなりました。また、 > 環境依存の○囲み数字は大丈夫でしたが、半角カナ文字は全角に置き換え > られてしまいました。これは Appendix にある sammainit で動かしても > 同じでした。 ○囲みとファイルの内容については問題が解消ということで承知しました。 半角カナについてはさきほどのメールで言及し忘れていましたが、大文字に 置き換えが発生するのは、動作仕様となっています。 以上、よろしくお願いします。 On Fri, 17 Feb 2017 14:47:16 +0900 Nishijima Shuji <nishi****@fukum*****> wrote: > デージーネット 森 様 > > お世話になっております。 > 西島です。 > > > おそらくiconvの問題かと思います。 > > インストールマニュアルのAppendixに手順の記載がありますが、こちらは > > お試しになっていますでしょうか? もしまだ実施していないようでしたら、 > > お試しください。 > > 未実施でしたのでテストしましたが、inittab から起動できませんでした。 > そこで、見様見真似でスタートアップスクリプトを作りました(正確には > 作っていたんですが、LD_LIBRARY_PATH 等の export を加えていない > 形でした)。かなり乱暴で稚拙な書き方ですが、一応、動きます。 > > Description: 部分は『1. SaMMA とは』を Google の翻訳に突っ込んだだけ > です。自分専用に使おうとしていたので、中身は一切チェックしていません。 > > ---- ここから ---- > #!/bin/bash > # > # samma This starts and stops SaMMA. > # > # chkconfig: 2345 81 29 > # Description: SaMMA (SAfety Mail gateway with Milter Api) is software \ > # that automatically safeguard attachments of mail \ > # in cooperation with MTA. Attachment There are three modes: \ > # ZIP encryption mode, attached file deletion mode, and > detoxification mode. \ > # In encryption mode, attachments of mail are encrypted in > ZIP format. \ > # Therefore, it can easily be decompressed with a general > Windows client. \ > # In deletion mode, it deletes the attached file of the mail, \ > # attaches the list of the file names of the deleted > attachment, \ > # and notifies the recipient. \ > # The detoxification mode is a multifunctional mode that > converts each multipart \ > # of e-mail into various formats, encryption and deletion. \ > # In the future, we are considering incorporating > encryption mode \ > # and delete mode functions into detoxification mode. \ > # We use the milter application for linking with MTA. \ > # > # processname: /usr/local/bin/samma > # config: /usr/local/etc/samma/samma.conf > # pidfile: /usr/local/etc/samma_pid/samma.pid > > > ### BEGIN INIT INFO > # Provides: > # Required-Start: postfix > # Required-Stop: > # Should-Start: > # Should-Stop: > # Default-Start: 2 3 4 5 > # Default-Stop: 0 1 6 > # Short-Description: start and stop samma > # Description: SaMMA (SAfety Mail gateway with Milter Api) is software \ > # that automatically safeguard attachments of mail \ > # in cooperation with MTA. Attachment There are three modes: \ > # ZIP encryption mode, attached file deletion mode, and > detoxification mode. \ > # In encryption mode, attachments of mail are encrypted in > ZIP format. \ > # Therefore, it can easily be decompressed with a general > Windows client. \ > # In deletion mode, it deletes the attached file of the mail, \ > # attaches the list of the file names of the deleted > attachment, \ > # and notifies the recipient. \ > # The detoxification mode is a multifunctional mode that > converts each multipart \ > # of e-mail into various formats, encryption and deletion. \ > # In the future, we are considering incorporating > encryption mode \ > # and delete mode functions into detoxification mode. \ > # We use the milter application for linking with MTA. \ > ### END INIT INFO > > # Source function library. > . /etc/init.d/functions > > # Get config. > test -f /etc/sysconfig/network && . /etc/sysconfig/network > > # More config > > test -f /etc/sysconfig/samma && . /etc/sysconfig/samma > > > RETVAL=0 > prog="samma" > pidpath=/usr/local/etc/samma_pid > > mkdir -p ${pidpath} > > lockfile=/var/lock/subsys/$prog > pidfile=${pidpath}/${prog}.pid > fullprog=/usr/local/bin/samma > > > > start(){ > [ -f ${fullprog} ] || exit 5 > [ -f /usr/local/etc/samma/samma.conf ] || exit 6 > [ $EUID -eq 0 ] || exit 4 > > export LD_LIBRARY_PATH=/usr/local/samma/lib > export LD_PRELOAD=/usr/local/samma/lib/preloadable_libiconv.so > export > CHARSET_ALIAS="Shift_JIS=CP932:EUC-JP=EUC-JP-MS:ISO-2022-JP=ISO-2022-JP-MS" > > echo -n $"Starting $prog: " > > ${fullprog} & > RETVAL=$? > > [ $RETVAL -ne 0 ] && failuer > [ $RETVAL -eq 0 ] && touch ${lockfile} && success > echo > > if [ $RETVAL -eq 0 ]; then > pid=`ps aux | grep ${fullprog} | grep -v grep | awk '{print $2}'` > echo ${pid} > ${pidfile} > fi > > return $RETVAL > } > > stop(){ > [ -f ${fullprog} ] || exit 5 > [ -f /usr/local/etc/samma/samma.conf ] || exit 6 > [ $EUID -eq 0 ] || exit 4 > > echo -n $"Stopping $prog: " > killproc -p ${pidfile} $prog > RETVAL=$? > echo > [ $RETVAL -eq 0 ] && rm -f ${lockfile} ${pidfile} > # return $RETVAL > > } > > restart(){ > stop > start > } > > # See how we were called. > case "$1" in > start) > start > RETVAL=$? > ;; > stop) > stop > RETVAL=$? > ;; > status) > status $prog > RETVAL=$? > ;; > restart) > restart > RETVAL=$? > ;; > *) > echo $"Usage: $0 {start|stop|status|restart}" > RETVAL=2 > esac > > exit $RETVAL > ---- ここまで ---- > > 上記のものを、/etc/rc.d/init.d 配下に『samma』という名称で置き、 > パーミッションを 755 にします。あとは > > chkconfig --add samma > chkconfig samma on > > で、OK。CentOS ではお決まりの > > /etc/rc.d/init.d/samma start (stop, status, restart もいけます) > > という操作をします。 > > zip ファイルの中のファイルが空になることはなくなりました。また、 > 環境依存の○囲み数字は大丈夫でしたが、半角カナ文字は全角に置き換え > られてしまいました。これは Appendix にある sammainit で動かしても > 同じでした。 > > (inittab に書きこんで起動しないのは解せないのですが、これは > 別件になりますのでここでは質問を控えさせていただきます。) > > 現状は以上となります。 > よろしくお願いいたします。 > > 西島 秀児 > nishi****@fukum***** > > > > On 2017/02/17 13:56, Shogo Mori wrote: > > 西島様 > > > > お世話になります。 > > デージーネットの森です。 > > > > おそらくiconvの問題かと思います。 > > インストールマニュアルのAppendixに手順の記載がありますが、こちらはお試しに > > なっていますでしょうか? もしまだ実施していないようでしたら、お試しください。 > > # Appndixではなく必須事項のように思いますのでマニュアルの修正を検討します。 > > > > https://www.designet.co.jp/open_source/samma/node7.php#SECTION00721000000000000000 > > > > 以上、よろしくお願いします。 > > > > On Fri, 17 Feb 2017 11:39:25 +0900 > > Nishijima Shuji <nishi****@fukum*****> wrote: > > > >> お世話になります。 > >> 昨日より参加させていただいた西島です。 > >> > >> 現在、SaMMA 4.1.7 を暗号化モードにて、 > >> > >> CentOS 6.8 (32bit) > >> Postfix 2.6.6 > >> > >> で動作させています(現在はテストサーバで使用中です)。 > >> ファイル名前が全角文字、半角英数文字、およびこれらが > >> 混在した場合は問題なく、添付ファイルが暗号化されて、 > >> 受信側で解凍できるのですが、例えば、 > >> > >> テストファイル1.xlsx (「1」は○囲み数字の1) > >> > >> のような場合、受信した zip ファイルを開くと中身が見えません。 > >> また、半角カタカナを含むファイル > >> > >> コンクリート工事.xlsx (「コンクリート」の部分が半角カナ) > >> > >> の場合は、解凍すると「コンクリート」が全角に変換されています。 > >> > >> > >> これは libiconv の問題かと思い、ja.osdn.net で公開されている > >> libiconv-1.12-1.src.rpm をダウンロードし、rpmbuild して > >> みましたが、%install で止まるので、ソースとパッチを取り出して、 > >> 手動で make、install しました。 > >> > >> > >> 公開されている過去ログで、2016/12/20 の itoneko さんのメールに > >> zip error に関するログの情報がありますが、これを使ってテストを > >> しました。 > >> > >> (1) 半角カナ文字または環境依存文字を含むファイルをサーバ上の > >> フォルダ(/home/testuser/test)にアップロード > >> (2) シェルから > >> > >> zip -rP hogehoge -q /home/testuser/test/AttachFile.zip . -i ./ > >> > >> を実行すると、その zip ファイルの中は見えませんが、 > >> > >> zip -rP hogehoge -q /home/testuser/test/AttachFile.zip . -i ./* > >> > >> を実行すると、zip ファイルの中身は半角カナ文字の状態でファイル名が > >> 保持されていました。環境依存文字を含む場合もテストしましたが、zip > >> ファイルの中のファイル名は環境依存文字を保持していました。 > >> > >> > >> SaMMA のインストールの仕方が悪いのか、解決策が見つかりません。 > >> どなたか御助言をいただけないでしょうか。 > >> > >> よろしくお願いいたします。 > >> > >> > >> 西島 秀児 > >> nishi****@fukum***** > >> > >> _______________________________________________ > >> SaMMA-users mailing list > >> SaMMA****@lists***** > >> http://lists.osdn.me/mailman/listinfo/samma-users > > > > > > _______________________________________________ > SaMMA-users mailing list > SaMMA****@lists***** > http://lists.osdn.me/mailman/listinfo/samma-users -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 株式会社 デージーネット OSS研究室 森 彰吾 TEL: 052-709-7121 FAX: 052-709-7122 MAIL: smori****@desig***** HP: http://www.designet.co.jp/ =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=