Linux off-line mailing method(offline mailaddr with 1account) <!-- Linux off-line mailing method (offline mailaddr with 1account) Linux オフラインメーリングの方法(1アカウントで複数アドレス) --> <author>Gunther Voet, <htmlurl url="mailto:freaker@xsrv.org" name="freaker@xsrv.org"> - Belgium (CompuMed/TuCSRV) <date>v1.3.2, Sat 7 february 1997 (CET) <trans>伊佐治 哲, <htmlurl url="mailto:isaji@mxu.meshnet.or.jp" name="isaji@mxu.meshnet.or.jp"> <!-- <tdate>25 jan 1998 --> <abstract> <!-- Use your linux mailing system offline, receive mail for multiple users with only one email address, and without being 24-24 online on the net. --> Linuxのメーリングシステムをオフラインで使い、ひとつのメールアドレス だけで複数のユーザーメールを受信します。ネットに24時間接続させっぱなし にする必要はありません。 <!-- If you are unable to pay a direct line to stay online for 24-24 and still want your users to receive mail on your linux box; as well not pay for a multi-drop box at your isp, you can use this system using only one email address to divide to your users email addresses. It is as well 24-24 reachable since the server where your account resists will receive the mail. --> 24時間オンライン接続する料金が払えないけれど(プロバイダ(ISP)に人数分の料金 を払えないけれど)、メールをLinuxマシンに取り込みたいのであれば ひとつのメールアドレスを使ってこのアドレスを分割してしまうことができます。 あなたのアカウントがあるサーバがメールを受け取るのですから24時間使える ことになります。 <ref id="copyright" name="This howto is Copyright (c)1997-98 by Gunther Voet."> </abstract> <toc> <sect>著者からの注意 <!-- Notes by the author (preface). --> <p> <!-- In this chapter i'm just going to put myself safe for any damages and flames - since even *I* could be wrong ... If you got any questions or suggestions to add to this faq, even if you find any faults - there is a feedback section in it ... --> 損害およびお怒りに関しては著者は保証していません。<bf/私/には責任は ないのです...もし質問や提案をこのFAQに付け加えたいなら、また間違った箇所 を見つけたという場合でもフィードバックをご覧下さい。 <p> <!-- Some "need to know" point is, all filenames & files/types are indicated with the line: --> この文書を読む前に知っておくべきことは、ファイル名とファイルタイプを以下の ように表示しているということです。 <p> <quote><tt>(*** < file > *** text ***) .procmailrc</tt></quote> <p> <!-- This means, this is a file, called ".procmailrc" containing text. The text variable can also be code. It shows you what name of file to use. Without a path means it can be variable/choosen by you (in the most cases this files resists in the homedirectory of the mail"user" like /home/mailer). --> これは&dquot;.procmailrc&dquot;というテキストファイルを意味しています。 上で&dquot;text&dquot;と表示している箇所は&dquot;code&dquot;となっている 場合もあります。また使用するファイル名を示していることもあります。パスが 書かれていない場合は適当に補って下さい(多くの場合このファイルはホームディレク トリに指定されます。例えば/home/mailerディレクトリのメール&dquot;user&dquot; といった具合です)。 <sect1>Legal stuff <p> <!-- Neither the author nor the distributors of this HOWTO are in any way responsible for physical, financial, moral damage incurred by following the suggestions and examples of this text. The information in this document contains the best of my knowledge and experience, but i could still make any mistakes as well in the information as in the examples. Any trademarks are property of their respective holders (i ain't using any commercial thingy's here - but well - IF i'm going to add some text, i don't need to change this disclaimer). If your cat dies 'coz this document was too heavy - i am not responsible as well ... --> この文書における提案や例によって生じた物理的、商業的、道徳的損害について、 作者およびこのHOWTOへ寄与してくれた人達には責任はありません。このドキュメント の情報は著者の知っていることや経験から構成されていますが、どちらも何かミスが あるかもしれません。商標はそれぞれの保有者に所有権があります(著者は商用的使用 には関与しません。このドキュメントに文章を追加をしてもこの免責事項は変更され ません)。もしcatが死んでもこのドキュメントは重要です。責任は持ちません。 <sect1>著作権<label id="copyright"> <!-- Copyrights<label id="copyright"> --> <p> This document and contents are Copyright (c)1997-98 by Gunther Voet. Unauthorized (re)production in any form is explicitly allowed and even strongly encouraged as long you don't change the contents of it without contacting the author (Gunther Voet). If you quote the document as whole or a part of it, there needs to be a Copyright "hint" or link to the derived work. "The HOWTO documents are copyrighted by their respective authors". The "HOWTO copyright" will discuss what can be done and what cannot be done with this document. If it is used in a commercial way, the author should been noticed for such distributions. Exceptions on this copyright may be granted under certain conditions with a written letter or e-mail to the author. For more info about the standard HOWTO disclaimer, please contact gregh@sunsite.unc.edu. <p> *PLEASE* *IF* you are going to make a system based on this HOWTO, then PLEASE give me the copyright :) heh ... - i am not that cruel :)). I mean by a system "a package" - NOT the mailsystem itself - altough it is some appreciative thingy i would be included :)) i can always use one email address more for more flaming :)) (just kiddin'). <p> 日本語訳:(内容は原文が優先されます) <p> このドキュメント/文章はGunther Voetに著作権があります。 許可していない任意の形式での改変は明白に認めます。また著作権を変更しない 限り著者(Gunther Voet)に連絡せずに改変してもかまいません。この文書の全文、 一部を引用する場合はCopyright 付けるかオリジナル文書へのリンクを 付けて下さい。"HOWTOドキュメントは各作者に著作権があります"。"HOWTO copyright" はこのドキュメントでできることとできないことについて書かれています。もし 商用的な目的で使われる場合は、そのような配布について著者に知らせて下さい。 この著作権の例外は手紙や電子メールで連絡した特定の条件のみ許可されます。 HOWTO免責事項についての詳細は<tt/gregh@sunsite.unc.edu/に連絡して下さい。 <p> <tt/***お願い***/このHOWTOに基づいたシステムを立ち上げたならコピーライト を私に下さい。私は厳しい人間ではありません :))。システムパッケージを意味 していてメールシステムそのものについてではありません(これらのシステムには感謝 していますが:))。私は文句のメール用アドレスも用意しています :)) 。 <sect1>フィードバック <!-- Feedback --> <p> <!-- Well, i expect from you and the users who read this HOWTO, they will make this HOWTO useful. If you got any suggestions, corrections, comments (except flame-mail :)) - please send them to me at <htmlurl url="freaker@tuc.ml.org" name="freaker@tuc.ml.org"> and i will make the corrections, comments or suggestions happen in the next revision. If you publish this document on a commercial way, a complimentary copy would be appreciated - you can mail me for my postal address. For flames - you could send them to me, but they will end at /dev/null ... so - don't even mind to waste bandwidth for it !. Since i can exclude some users to receive mail from (explained in this document) (evil grin). My alias (name) is freaker btw :)). You can always try "freaker@ibm.net". --> このドキュメントを読んでいる方およびユーザーの方にこのHOWTOが役立つ ことを期待します。提案、訂正。コメント(お怒りのメールは除きます :))があれば <htmlurl url="mailto:freaker@xsrv.org" name="freaker@xsrv.org"> まで連絡下さい。次回のバージョンで反映させたい と思います。このドキュメントを商業的な目的で出版する場合は献本をお願いします。 まず手紙を送って下さい。お怒りについも著者まで送っていただけますが/dev/nullへ 行くことになるでしょう... メールサーバ上のバンド幅の浪費は気にしないでいい ですよ :)。私は受信メールからあるユーザーを締め出すようにしています(この ドキュメントで説明しています)。著者のエイリアス名は<tt/freaker btw/です:))。 サーバがダウンしていたら&dquot;freaker@ibm.net&dquot;の方で試して下さい。 <sect1>ディストリビューション <!-- Distribution --> <p> <!-- The latest revision of this document can been get from: -->このドキュメントの最新版は <htmlurl url="http://sunsite.unc.edu/pub/Linux/docs/HOWTO/mini/Offline-Mailing" name="http://sunsite.unc.edu/pub/Linux/docs/HOWTO/mini/Offline-Mailing"> -および- <htmlurl url="http://tuc.ml.org/om/" name= "http://tuc.ml.org/om/"> (<htmlurl url="http://tuc.ml.org/" name="http://tuc.ml.org">もチェックして下さい) <sect1>更新履歴 <!-- Changes --> <p> <!-- v1.0.0 - Preliminary release, internal testing, we tried it before we gave it out to you :) .. since - it GOT to be usefull and needs to work? rite ? :) v1.1.0 - Fixed a lot of errors in the texts, put chapters in it, - fixed some small errors and typo's ... v1.2.0 - fixed grammatical errors. - added a "what-are-we-using" chapter. - added Sunsite address. v1.3.0 - Added "virtual mail support" for admins - New site and email addresses - Thanks go to ... v1.3.1 - Converted to SGML and fixed some minor details. v1.3.2 - Major errors corrected (filenames .fetchmailrc to .procmailrc) etc... (thx to Tetsu Isaji) - Added support for the "new" sendmail, v8.8.0+ - Fixed some minor errors - Upgraded my system YAY! - Japanese version will come out soon, location will be mentioned when known ... (thx to Tetsu Isaji) --> <descrip><verb> v1.0.0 - 初期リリース。テスト。出す前に試してみました。 便利で使う必要があったからです。:) v1.1.0 - 文書の多くの間違いを修正。章の追加。タイプミスや小さなミス などの修正。 v1.2.0 - 文法的なエラーを修正。 - "what-are-we-using"章の追加。 - Sunsiteのアドレスを追加。 v1.3.0 - 管理用の"仮想メールサポート"を追加。 - 新しいサイト、メールアドレス - Thanks go to ... v1.3.1 - SGMLに変換、細部をいくつか修正。 v1.3.2 - 主なエラーの訂正(.fetchmailrcを.procmailrcに) など(thx to Tetsu Isaji) - 新しいsendmail v8.8.0+ のサポートを追加 - 小さなエラーの訂正 - システムをアップグレードしました。YAY! - 日本語版が間もなく出ます。サイトなどはわかり次第お知らせ します...(thx to Tetsu Isaji)。 </verb></descrip> <sect1>何を使っているか? <!-- What am i using ? --> <p> <!-- I'm using Linux 2.0.30, Pentium-166, ATI pci-mach64 card, Accelerated-X (Metro) and a connection to my isp (currently ibmnet) via ppp using a ZyXEL 28k8 modem, and occasionally a Bausch 28k8. --> Linux 2.0.30, Pentium-166, ATI PCI-Mach64カード、Accelerated-X(Metro) そしてプロバイダ(現在はibmnet)にZyXEL 28k8 モデムを使ってPPP接続しています。 たまにBausch 28k8モデムを使うこともあります。 <!-- Now i upgraded to Linux 2.0.33, installed a USRobotics modem, it still works as it should work :) (everybody should upgrade their linux versions as soon there comes out a patch :) believe me :) you could spare a lot of time & seeking for errors when doing this one :) --> 現在Linux 2.0.33にアップグレードしてUSRoboticsモデムを使っています。 これでちゃんと動作しています。 <sect1>謝辞 <!-- Thanks go out to ... --> <p> <itemize> <item>Fred, <tt/durban.hebel.net/ (for allowing the pages & bot) <item>Lifesaver, <tt/parkside.net/ <!-- (for allowing the new pages, helping with this faq for mailing, since, it is all working overthere and here ... make some visit to his cyber-cafe ... heard they got great coffee :)) --> (新しいページを作っていただいた。メールでこのFAQを手伝ってくれました。 そこかしこで働いているので...彼のサイバーカフェに訪れる... おいしいコーヒーを煎れているように聞こえる :)) <item><!--The server admins at lodus.net to continue this project. -->lodus.netのサーバ管理者の方。このプロジェクトを継続してくれています。 </itemize> <sect>前置き <!-- Preliminaries --> <p> <!-- Well, how does this system works ? what can you do with it ? what is it anyway ? and ... am i used to read it ? ... to all those questions - there is an answer ... --> このシステムはどのように動作するのか、これで何ができるか、何なのか? など...これらの全ての質問にお答えします。 <sect1>序文と叙述 <!-- Preface & Description --> <p> <!-- This HOWTO is dedicated to all the off-line linux users/servers ... You got a group, or organization, and you want all your members to have a contact (email) address, without paying for the 24/24 direct line or for the email accounts ... Or you got a internal network - with a masq'd server and you want to give all the users using it a email address, you could use this way to do it. I personally am using it to give my users & members of a demogroup all a e-mail account without being 24/24 online; since it is a non-commercial demogroup - and we don't got THAT much money to pay a direct line with instant email access - and different ip's. Everybody got a email address, even when they don't got internet access. The ones with internet access can receive their mail on their personal email address - viavia the system described below. Your users can still send mail as they used to do, since - your system will hold the mail queue from the users. The only thing what should be changed for the users - is that they add their "email address" wether (described below) it is the method with the subject line, or with the header "to" ... --> このHOWTOをオフラインLinuxユーザー/サーバに捧げます。 グループや組織に入って全メンバーにメールアドレスを割り振りたい、しかも 24時間ずっと接続したままにしたりメールアカウントの料金を払わない(払えない) で...。あるいはマスカレードサーバの内部ネットワークで全員にメールアドレスを 割り振りたいという時にここで述べる方法が使えます。著者はこの方法を使って デモグループのユーザーやメンバーにメールアカウントを割り振っています(それも 24時間接続させずに)。このグループは業務用のものではなく、メールアクセス (また異なるIPアドレス)を入手するだけのお金はないからです。全員ともインター ネットにアクセスしないときでもメールアドレスを使っています。以下述べる方法 を<em/使って/各自のアドレスでメールを受信しています。またユーザーからの メールをメールキューに蓄えておいて、メールを送ることもできます。ユーザー について変更されることはメールアドレスの追加だけで、メールヘッダの &dquot;subject&dquot;の行や&dquot;to&dquot;の行を判別する方法でメール アドレスを判別します。 <sect1>興味深い点 <!-- Points of interest ... --> <p> <itemize> <item><!-- A organization with members, for all a email address, so they can be contacted when neccesary. --> 組織のメンバー全員のメールアドレス。必要に応じて接続できます。 <item><!-- A anonymous mailservice - they can't read your "mail setup file" - so they don't know where the mail is forwarded/rerouted to. --> anonymousメールサービス:ユーザはメール設定ファイルをよむことはできません。 そうやってメールがどこにフォワード/再ルート(rerouted)されたかわからないよう にします。 <item><!-- A group who doesn't got enuf money (don't laugh), or is free, and don't WANT to spend money for it (eheh) - and still wants to provide the members a email address. --> お金のない(笑わないで..)グループやお金を使いたくないといった人でメンバーに メールアドレスを割り振りたい場合。 <item><!-- A masq'd network - with a server connected to the internet, where the users using the masq'd network need to have a email account -->マスカレードネットワーク:インターネットに接続されたサーバ。 マスカレードネットワークを使うユーザーはメールアカウントが必要です。 <item><!-- You want to put some documents "autoreplied" - like i do with my HOWTO, statistics, or documents ... like "info@yourmail.dom" or "document1@yourmail.dom". --> 「自動返信」ドキュメントを作りたい - <tt>&dquot;info@yourmail.dom&dquot;</tt>や<tt>&dquot;document1@yourmail.dom &dquot;</tt>といったアドレスにメールを送ると著者のHOWTO、統計値、ドキュメント といったファイルを取り寄せられる。 <item><!-- You only need one account at the "main" server to fetch from, for the +200 email accounts you can create at your server ... --> 必要なのはメールを取り込むためのメインサーバ用のアカウント一つです。 サーバに200強のメールアカウントを作れます。 <item><!-- I used the "B" method with +- 300 email accounts - with a public server; 80486DX4-100 - and was processed in 1 minute. --> 著者は&dquot;B&dquot;方法を使って300前後のメールアカウントを使っています。 パブリックサーバ(CPU:80486DX4-100MHz)で1分程度の処理です。 </itemize> <sect1>知っておくべきこと <!-- Things you should know --> <p> <itemize> <item><!-- Not every (free) mailservice is happy when you are going to distribute mail to other users, or putting up an anonymous mail server, so, please try to contact your mailserver administrator before "just doing it". --> メールをユーザーに配布したり、anonymousメールサーバを作りたいといった 場合全ての(フリーの)メールサービスで幸せになれるとは限りません。 この文書に書かれていることを実行するまえに、メールサーバの管理者に連絡を とってみましょう。 <item><!-- It is slower than a direct 24/24 connection, since your server will need to get online before it will process the mail. --> 24時間接続されているシステムよりも遅いかもしれません。メールを配達する前に オンラインに接続する必要があるからです。 <item><!-- It needs a administrative force to administrate the "mailrouting" and to add the user ... you will need work with it ! - it is not that automatic. (well - i made it "semi-automatic" with my server :) you could try it as well). --> メール経路(mailrouting)の管理とユーザーの追加を管理する必要があります。 自動的に管理することはできません(著者は自分のサーバを「準自動化」して います :)。同じように試みて下さい)。 <item><!-- Bandwidth and space is needed when you got many users - on the mailserver you are working on ... and sure - when they send files - you need to have enough space on it !. --> 多くのユーザーが対象となる場合は作業するメールサーバ上のバンド幅(Bandwidth)と スペースが必要です。ファイルを送る時十分なスペースが必要です! <item><!-- All mail will be transferred into "one step" - so - the last mail received on your server will be last sent to the recipient. "first in - first out". --> 全てのメールは1ステップ転送されます。サーバで受け取った 最後のメールは一番最後に受信者に送られます。FIFO(first in - first out)です。 <item><!-- In the first method (to:) there is no prob with the usernames - but in the second "cheaper" method - users can't put in a subject line, since that one will be used to send the mail to the recipient. Many users forget to use the "subject" ... - or they will need to know it clearly. --> 第1の方法(to:を判別する方法)ではユーザー名を判定しません(メールサーバの 管理者によって管理されます)。第2の(簡単な)方法では受信者にメールを送るのに subject行が使われるのでユーザーはsubject行を使えません。多くのユーザーは &dquot;subject&dquot;を忘れます...知らせておく必要があります。 <item><!-- If you poll enough for your mail, (for example 4 times a day) - the mail will be sure be delivered to as from a recipient the least every 6hrs. So the processing will go a little smoother. --> メールを6時間ごと(日に4回)に受信者から配送するだけで十分な場合はプロセス はスムーズに行われます。 <item><!-- you CAN use it as a "online" mail server as well :) since it will poll for it's mail for every XX minutes. but - when you are online - why using another server ? and not asking your own domain for your own server ? (dough). --> 数分ごとにメールを送ることもできるのでオンラインのメールサーバを使うことも できます。しかしオンラインならこの方法を使う必要はありません。 </itemize> <sect1>2つの異なる方法 <!-- there are 2 different ways ... --> <p> <descrip> <tag>方法A(以下&dquot;(m(A))&dquot;とします)</tag> <!-- method 'A' - now called "(m(A))". --> <!-- The "mailsystem" will look to the header, and will see to the "to:" line. This is the best way, since it are "real email addresses". You will need another account on some server *AND* you need a DNS (MX) entry (your own domain for instance). If the system administrator wants to help you with that, then there will be no problem !. The system administrator will need to reroute ALL mail sent to your (MX) maildomain -> to your account !. This will take some time for him to do it :) so be really nice to him :)) Thanks to my system administrator (Fred) i got my maildomain and the user- services of my "free" demogroup. It can be a DNS entry costs something, what you will need to consider to take it or not. --> &dquot;mailsystem&dquot;はヘッダ特に&dquot;to:&dquot;行を調べます(通常の方法 です)。これは実際のメールアドレスです。 複数のサーバアカウントやDNS(MX)エントリ(例えばあなたのマシンのドメイン名など) が必要です。システム管理者が協力してくれるなら何の問題もありません! 管理者が全てのメールを(あなたのアカウントがある)(MX)のメールドメインに 再送(reroute)する必要があります。これは管理者の手間をかけます :)。管理者が 親切な人なら大丈夫です :))。著者の&dquot;フリー&dquot;デモグループのユーザー サービスシステムを作ってくれた管理者の方(Fred)に感謝します。 DNSへのエントリをする面倒さがあります。 <tag>方法B(以下&dquot;(m(B))&dquot;とします)</tag> <!-- method 'B' - now called "(m(B))". --> <!-- The "mailsystem" looks to the subject line, and will forward to the user indicated into the subject line. If the user is not found, it will bounce a mail back. This will need a pop server with only one useraccount, and don't need your own DNS or you don't need to be nice to your system- administrator who arranges you the mail address :). You can use a public mailserver, as well your own mailserver or a private one. You can even sacrifice your own email address for it :). I used this approach as first what worked for me for over a year now ... I know this is sloppy, but, i ain't telling you need to use this way, so don't shoot ME - since i'm only offering you some solutions to your mail problems :) - you could use method A what isn't that sloppy ! --> &dquot;mailsystem&dquot;は&dquot;subject&dquot;行を調べ、subjectで指示されて いるユーザーにフォワードします。ユーザーが見つからない場合はメールを送信者に 返します。1つのユーザーアカウントがあるPOPサーバが必要です。 DNSはいりません。またメールアドレスを整理するシステム管理者もいりま せん :)。メールサーバやプライベートサーバと同じようにパブリックメールサーバが 使えます。あなたのメールアドレスをサーバに捧げることもできます :)。 著者は一年以上このアプローチを続けてきました ... いい加減だと思いますが この方法を使う必要についてはお話しません。だから著者を攻撃しないように。 「メール問題」のある解決方法を提供しているだけなのですから :) 面倒でないなら方法A&dquot;(m(A))&dquot;を使いましょう。 </descrip> <sect>必要なもの <!-- Requirements --> <p> <!-- Well, you need (of'course) a Linux machine, what can be connected to the internet - So! (i am smart - i am smart :)) - you probably got a modem, right? a phoneline - or any way to connect yourself with the server you are running. You will also need some software like Fetchmail, Procmail, an extra account, and your email account or DNS with email account. --> 当然Linuxマシンが必要です。またインターネットに接続するものも必要です (i am smart - i am smart :))。モデムもありますね?電話回線や使っている サーバで接続する方法もわかっていますね?Fetchmail, Procmailといったソフト や外部アカウント、メールアドレス、メールアカウントに対応したDNSも必要です。 <sect1>Linuxマシン <!-- A linux machine --> <p> <!-- This can be ANYthing ... even a 8086 ... - but preferable - since there will be some load on it - minimally a 80386 :). as faster the machine - as faster the software will run (rite eh)? :). --> 8086マシンでも動かないことはありませんが、マシン上にいくつか読み込まないと いけないものがあるのでできれば少なくとも80386は欲しいです :)。マシンや ソフトを速く走らせたいでしょ? :) <sect1>Linuxマシン用の特別なアカウント <!-- A extra account at your linux machine --> <p> <!-- You need to create a extra account on your Linux machine. I am using as example (in this HOWTO) "mailservice". This can be as well "mailserver" or "mailtousers" - as long it is some name what can be recognized by you!. --> Linuxマシン用のアカウントを作る必要があります。このHOWTOではそのアカウントを &dquot;mailservice&dquot;としておきます。&dquot;mailserver&dquot;や&dquot; mailtousers&dquot;などわかるものならなんでもよいです。 <!-- ! It doesn't need to have ANY root privileges ! --> <verb> !root権限は必要ありません! </verb> <!-- This mailaccount will forward all mail to the users on your system, or to external users (not on your system :)). Just create it as an ordinary user. You will need to test things under this account, and, the mail "administrator" can use this account to administrate the mail account without being root even .. so - pretty safe !. --> このメールアカウントで全てのメールをシステム上のユーザーに転送します。 またシステム外のユーザーにも転送します。通常のユーザーアカウントも作って おいて下さい。これはテスト用で&dquot;管理者&dquot;はこのアカウントを使って メールアカウントの管理をします。rootになる必要はありません(これで安全!)。 <sect1>Fetchmail <p> <!-- I am using v1.9 patch level 9 ... i found it at sunsite.unc.edu, and, i am using only this mail-fetcher in my example - if you want to use another one, you are on your own ! since i am happy with it :). For extended features you should read the man of Fetchmail :). This can be installed as root - as well for the user itself ... - best is to install it as root :) since i know it will work for sure then :))) --> <tt/v1.9 patch level 9/ を使っています。<tt/sunsite.unc.edu/から入手でき、 メール取り込み専用に使っています。もし他のものが使いたければ読者自身でやって 下さい!著者はこれで十分幸せです :)。詳しい使い方についてはFetchmailのman ページを読みましょう。これはルートでインストールします。ユーザーでもできます がrootで行うのが一番よいでしょう。そのほうが確実です :)))。 <sect1>Procmail <p> <!-- I am using v3.10 - found it again at sunsite.unc.edu, and - i like this as the best mda (mail delivery agent) around ... It delivers nicely - and it is better than using it by the "original" system mda - since it will deliver user-per-user ! ... The same as above - it can be installed as root, or as user - and :) best is to install it as root - since i know it will work for sure then (again!) :)... how repetetive ... --> v3.10を使っています。<tt/sunsite.unc.edu/から入手できるでしょう。MDA(mail delivery agent)として重宝しています。配送の具合もよくオリジナルのMDAを使う よりもよいです。「ユーザー毎のユーザー(user-per-user)」で配送できます。root としてもユーザーとしてもインストールできます(一番いいのはrootでインストール することです)。そのほうが確実です :)。どれだけ繰り返したことか.... (<bf/訳注:/procmailを使ったバーチャルメールについて <htmlurl url="http://www.first.tsukuba.ac.jp/docs/install/procmail.html" name="http://www.first.tsukuba.ac.jp/docs/install/procmail.html"> も参照) <sect1>メールアカウント <!-- A mail account --> <p> <!-- You always need to have a mail account - where you can "poll" your mail from. The server needs to be a POP server - where you can poll from when you want, and where users can send their mail 24/24 to. It can be a free-mail service, as well commercial - even your mailaccount is sufficient enough. In the "subject" method (m(B)) - you don't need something more - in method A - with the "to" fields - you NEED more - as written below ! --> メールを出すためのメールアカウントはかならず必要です。 またサーバはPOPサーバであることも必要です(メールを取り込むことができ、ユー ザーが24時間メールを送ることができるようなサーバです)。 商用のものと同様にフリーのメールサービスが提供できます。 &dquot;subject&dquot;行を使う方法B(m(B))では、これ以上は必要ありませんが、 &dquot;to:&dquot;行を使う方法Bではもう少し必要なものがあります。以下それに ついて書きます。 <sect2>DNS レコード (MX) <!-- A DNS record (MX) --> <p> <!-- Needed to run your own "domain" - email domain ... it is needed since the administrator of the server can't use it's own domain for your users - since there are users who need to be contacted on his server as well - what could interfere with your users. And your mailheader must be filtered on that domain. So - an apart domain - pointing to HIS server. This can be an additional cost - or you can ask your system administrator to add a "non- authorative address" - pointing to his server ... - however - it needs to be another domain than he is using ! --> あなた用のドメイン(メールドメイン)を立ち上げる必要があります。 サーバの管理者はユーザー用にドメインを使うことはできないのでこれは必要です。 サーバに接続する必要があるユーザーもいます。メールヘッダはドメインでフィルタ に通されなければいけません。そこで(ドメインを除いて)サーバへのポイントを します。これはさらにコストがかかります。 あるいはシステム管理者に「認証化されていないアドレス」(サーバへのポイント) を追加してもらうように言うこともできます。しかし他のドメインも必要になって しまいます。 <sect2>あなたのアカウントへのフォワード :) <!-- A "forward" to your account-account :) --> <p> <!-- Well, the system administrator needs to forward *ALL* mail to your domain to YOUR account ... - it is easy for him when he knows how to do it :) .. else he will need to read the sendmail manual :)) (or qmail - whatever). You will poll for your mail at your account and voila ! filtering on YOUR own email domain. --> システム管理者はアカウントがあるドメインに全てのメールをフォワードしなければ なりません。その方法を知っていればこれは簡単です :) .. あるいはsendmailマニュアルを読まなければならないでしょう(qmailでもなんでも)。 あなたのアカウントのメールを送ります。あなたのメールドメインのフィルター を送ります。 <sect>メールを全て受け取った、次は? <!-- I got it all, what now ? --> <p> <!-- Now you created the extra account, you got the mail address - and/or the DNS entry & forwarding to your account ... As well installed Procmail & Fetchmail so we can rock the place ! :) .. here we go ! --> 外部アカウントを作り、メールアドレスも入手しました。さらにDNSエントリーと あなたのアカウントへのフォワードも済みました。ProcmailとFetchmailもインスト ールしました。さあいきましょう。 <enum> <item><!-- You need to create a .procmailrc file, what will contain the "delivery" info to your users. --> ここで<tt/.procmailrc/ファイルを作る必要があります。これにはユーザーへの &dquot;配送&dquot;情報が含まれています。 <item><!-- You need to create a "nosuchuserfile" - so the writer knows his mail isn't delivered well. --> &dquot;nosuchuserfile&dquot;を作る必要があります。メールがちゃんと配達され ない時に送信者に知らせるためのものです。 <item><!-- For best work :) you could use crontab to check for mail. This is a easy way to check your mail every XX minutes when on the internet. --> うまく動作させるため :) にメールチェック用にcrontabを使います。インターネット 上に接続されている時、数分ごとにメールをチェックするための簡単な方法です。 </enum> <sect1>&dquot;.fetchmailrc&dquot;ファイルを作る <!-- Creating a .fetchmailrc file --> <p> <!-- You will need to create a .fetchmailrc file, what will contain the information (username & password, as well the Mail Delivery Agent (mda) to proces the mail to). Here is some example file ... --> ここで<tt/.fetchmailrc/を作ります。これにはユーザー名、パスワード、MDA (Mail Delivery Agent)の情報が含まれています。以下はサンプルファイルです。 <p> <quote><tt>(*** < file > *** text ***) .fetchmailrc</tt></quote> <tscreen><code> server my.mail.server.com proto pop3 user myaccountthere pass deepestsecrets flush mda /usr/bin/procmail </code></tscreen> <p> <!-- This file will be used to fetch your mail. Please test it by using the fetchmail program "fetchmail -vv" - and see your mail is being transferred right ... There will be some errors - since the procmail control file hasn't been created yet. You can wait by testing AFTER making the procmailrc file, but - i'll warn ya - IF there is something fault :) it CAN be this file :) It needs to be owned by the user account itself - in my case "mailservice" and needs to be "user readable" but NOT group/world readable - since it contains the "main password" :)). (chmod 600 .fetchmailrc will do). --> このファイルはメールを集めるために使われます。fetchmailプログラム &dquot;fetchmail -vv&dquot;(訳注:fetchmailのコントロールメッセージと メールサーバのエコーを表示します)を使ってテストしてみて下さい。 メールが正しく配送されるかどうかも見てみて下さい。 いくつかエラーがあるかもしれません。というのもprocmailコントロールファイル がまだ作られていないからです。procmailrcファイル を作るまでテストをしなくてもよいのですが、逆にここでテストしておけば原因 がprocmailrcファイルではないことはわかります。またprocmailrcファイルはユーザー がオーナーとなるようにしておきましょう。著者の&dquot;mailservice&dquot;の場合 は、ユーザー読み込み可にしてグループ/外部に読み込みは許可しないようにして います。(訳注:メールをプロバイダから受信するための)メインパスワードが書かれ ているからです(だから<tt/chmod 600 .fetchmailrc/としています)。 <sect1>&dquot;.procmailrc&dquot;ファイルを作る <!-- Creating a .procmailrc file --> <p> <!-- This control file will forward all mail to the users in it. There are 2 ways as described before - the "to:" (header) way - and the "subject" (sloppy) way. The file will contain the usernames to transport to. All the "#" are comments and are absolutely not needed when not wanted - it's only so you know what i am doing ... - you can as well best chmod it 600 - so the rest of the world or group doesn't need those private addresses eh :) ... It needs also to be owned by the user (like "mailservice") :)). The "nosuchuserfile" is a "bounce" to the writer - if the user isn't found (so mail not delivered) in the procmailrc file ... - so the writer knows the mail isn't delivered well. --> これはシステム上のユーザーにメールを転送するためのコントロールファイルです。 上記したように2つの方法があります。メールヘッダの&dquot;to:&dquot;を 使う方法と、&dquot;subject&dquot;を使う方法です。 ファイルには配送するユーザーが含まれています。&dquot;#&dquot;はコメント 文で必要ないならいりません。同様にchmodコマンドでパーミッションを600にします (<em/訳注:/<tt/chmod 600 .procmailrc/)。その他のグループついてはこれらの プライベートアドレスは必要ありません :) ...。"nosuchuserfile"は、procmailrc ファイルにないユーザー宛ての場合、送信者に戻すメールに添付されます。これにより 送信者にメールが配送できない旨を知らせます。 <sect2>&dquot;ヘッダ(to:)&dquot;による配送 <!-- For "header (to:)" transportation --> <p> <quote><tt>(*** < file > *** text ***) .procmailrc</tt></quote> <tscreen><code> # (この行はデバッグのためのものです!メールサーバを通った全てのメール # を読めるようにするために削除しておいて下さい。 # 全てのメールはユーザーに送る前に"passtrough"ファイルにコピーされます。 # このファイルを読んで何が悪いのかわかります) :0 c passtrough # (ヘッダが"to: freaker@mydom.com"のメールは直接私のところまでフォワード # されます。他のメールはこのオプションにはかかりません) :0 * ^To:.*freaker@mydom.com ! freaker # root@mydom.com宛てのメールはrootにフォワードされます。postmasterも同様。 :0 * ^To:.*root@mydom.com ! root :0 * ^To:.*postmaster@mydom.com ! postmaster # barbara@mydom.com宛てのメールはbarbaraにフォワードされ、プライベート # メールアドレスにフォワードされます。 :0 c * ^To:.*barbara@mydom.com ! barbara@her.private.one :0 * ^To:.*barbara@mydom.com ! barbara # # この行では上記のユーザー宛てのメールがない場合、センダーにメールを戻します。 # またリプライ用に"nosuchuser"ファイルをメールの本文に追加します。 # 注意!"nosuchuser"ファイルを作る必要があります。- 以下のようなテキスト # を作っておいて下さい。 # 「あなたがメールを届けたいユーザーはこのサーバ上にはいません。もう一度 # やり直して下さい。どこにもいないユーザーかもしれません」 :0 |(/usr/bin/formail -r -k \ -A"X-loop: mailservice@mydomain.dom "| \ /usr/bin/gawk '{print }\ /^/ && !HEADER \ { system("/bin/cat nosuchuser"); \ print"--" ;\ HEADER=1 }' ) |\ /usr/bin/sendmail -t exit </code></tscreen> <p> <bf/訳注1:/formail:メールをmailboxフォーマットに変換するフィルタコマンド。 <tt/X-loop:/の箇所は適当に変更します。またnosuchuserファイルは<tt/.procmailrc/ ファイルと同じディレクトリにおきます。また<tt/* ^To:./ 行にコメントを付けると ちゃんと振り分けられないことがあります)。 <p> <bf/訳注2:/このフッタ処理の簡単な解説。 <itemize> <item><tt> |(/usr/bin/formail -r -k -A"X-loop: mailservice@mydomain.dom"</tt> <p> formailコマンドで <verb> -r:自動返信用のヘッダを作る。Errors-To: あるいは From: のアドレス を To: に指定します。 -k:自動返信用のヘッダを作る時、引用符を付けて本文をキープします。 -A:指定したヘッダフィールドをヘッダに追加します。 この場合"X-loop: mailservice@mydomain.dom "を追加します。 </verb> としています。これを以下のawk処理にパイプします。 <item><tt>|/usr/bin/gawk '{print }/^/ && !HEADER { system("/bin/cat nosuchuser");print"--" ;HEADER=1 }')</tt> <p> awkコマンドによるメール処理。nosuchuserファイルの挿入。 <verb> {print }/^/ && !HEADER { system("/bin/cat nosuchuser"); print"--" ; HEADER=1 } </verb> まず頭の一行を表示。<tt/HEADER=0/(デフォルト値)の時はnosuchuserファイルを 挿入して<tt/HEADER=1/とします(以下この{..}内の処理は実行されず、メール ファイルを<tt/print/していくだけです)。 以上の処理をまとめるとリプライメールは以下のようになります: <code> To: MAIL_ERR@hoge.ac.jp <== このアドレスは Errors-To: のもの メールエラー <== ここからnosuchuserファイル (連絡を取りたいユーザーはこのシステムにはいません。 受け取り人をsubjectに書いてください。 例えば"subject: freaker"とすればfreakerにメールが届きます) <== ここまでがnosuchuser -- <== awk処理の print"--" ; の箇所。 Subject: Re: hello References: <199710141701.CAA06199@dokoka.co.jp> In-Reply-To: <199710142352.IAA27235@dokoka.co.jp> X-loop: mailservice@mydomain.dom >こんにちは。このアドレスでいいのかな? > </code> となります。 <item><tt> | /usr/bin/sendmail -t</tt> <p> 以上の処理をしたメールを送ります。 <tt/-t/オプションは、<tt/To:, Cc:, Bcc:/行を受取人アドレスにスキャンします。 つまりメッセージヘッダにリストされていてもコピーは受信しません。 </itemize> <hrule> <sect2>&dquot;subject: touser&dquot;による配送 <!-- For "subject: touser" transportation --> <p> <quote><tt>(*** < file > *** text ***) .procmailrc</tt></quote> <tscreen><code> # (この行はデバッグのためのものです!メールサーバを通った全てのメール # を読めるようにするために削除しておいて下さい。 # 全てのメールはユーザーに送る前に"passtrough"ファイルにコピーされます。 # このファイルを読んで何が悪いのかわかります) :0 c passtrough # ヘッダが"to: freaker@ibm.net"のメールは直接私に転送されます。 # その他のメールはこのオプションをパスします。 # "dedicated"メールアドレスを"mailservice thingy's"で受信する # 時はこの行を使う必要はありません :) :0 * ^To:.*freaker@ibm.net ! freaker # subject "root"のメールは全てrootに転送。 :0 * ^Subject:.root ! root # "subject: barbara"のメールは全てbarbaraに転送。 :0 * ^Subject:.barbara ! barbara # "subject: paul"のメールは全てpaulの外部メールアドレスへ転送。 :0 * ^Subject:.paul ! paul@his.personal.emailaddress # "subject: john"のメールは全てサーバ上の彼のアカウントに転送され # コピーがプライベートメールアドレスに行く。 :0 c * ^Subject:.john ! john@his.personal.emailaddress :0 * ^Subject:.john ! john # IBMからのメール(updateや情報など)は全てfreakerに。メールサービスを管理する # 人です。IBMはメールが戻ってくることを望んでいません!! もしあなたの # メールプロバイダが"newsletters"等を送ってくる場合に必要です。 :0 * ^From:.*newsletter@ibm.net ! freaker # デーモンからの全メッセージは捨てられました。わたしの場合はファイルに保存され # ます。(奈落の底に捨てるには/dev/nullを使う) :0 * ^FROM_DAEMON throwaway # この行では上記のユーザー宛てのメールがない場合、センダーにメールを戻します。 # またリプライ用に"nosuchuser"ファイルをメールの本文に追加します。 # 注意!そのようなファイルを作る必要があります。- mine に以下のようなテキスト # 「subject行にユーザー名が書かれていません。ユーザー宛てにメールを送る時は # "Subject: user" とヘッダに書いて送って下さい。例えば"subject: freaker"では # freakerにメールが送られます」。ファイルは長くも短くもできます :) ... # "mailservice@mydomain.dom"はあなたのサーバと他のサーバのあいだをループして # います。正しいメールアドレスを使って下さい! # "don't spend 500$ at your ..."といったようなsubjectではエンドレスループ # を作ってしまいます。 :0 |(/usr/bin/formail -r -k \ -A"X-loop: mailservice@mydomain.dom "| \ /usr/bin/gawk '{print }\ /^/ && !HEADER \ { system("/bin/cat nosuchuser"); \ print"--" ;\ HEADER=1 }' ) |\ /usr/bin/sendmail -t exit </code></tscreen> <p> <sect1>"nosuchuserfile" <!-- "nosuchuserfile" --> <p> <quote><tt>(*** < file > *** text ***) nosuchuser</tt></quote> <tscreen><code> The user you wanted to contact is not present at this system. Please use the subject line as recipient - example "subject: freaker" would send mail to freaker on this system. ------------------------------------------------------------------ (日本語例) 連絡を取りたいユーザーはこのシステムにはいません。 受け取り人をsubjectに書いてください。 例えば"subject: freaker"とすればfreakerにメールが届きます。 </code></tscreen> <p> <sect1>crontabファイル <!-- "crontab files". --> <p> <!-- If you don't know how crontab works :) better read the manual :) ... You need to create a "checkmail" file - what will see if the link is up, as well the cronfile itself ... - i am using a ppp link :) so - this is an example how to look when the ppp link is up - and to poll every 10 minutes using cron. Looks sloppy - but isn't !. --> もしcrontabの動かし方を知らないなら :)適当なマニュアルを読んで下さい :) ...。 ここで&dquot;checkmail&dquot;ファイルを作る必要があります。接続されたときに 設定ファイルと同じように調べるものです。著者はPPP接続をしていますので PPP接続がつながったときの見方について例を挙げています。そして10分毎にcronを 使って送りだしています。これはなんだかいい加減なものに思われるかもしれません が決してそんなことはありません! <sect2>checkformail <!-- checkformail --> <p> <!-- the .checkformail file will be called (needs to be executable as well) - and will look if the ppp link is up. If it is up - then it will fetch for mail. Crontab will use this file when you are using the below cronentry ... --> ここで<tt/.checkformail/ファイル(実行属性にしておきます)が呼ばれ、PPP接続 されている時は探します。接続されればメールを受信することができます。crontabは 以下のcronエントリーを使った時にこのファイルを使います。 <p> <quote><tt>(*** < file > *** code ***) .checkformail</tt></quote> <tscreen><code> #!/bin/sh # cd /home/mailservice if [ -f /var/run/ppp0.pid ]; then /usr/local/bin/fetchmail -s > /dev/null 2>&1 fi </code></tscreen> [訳注:<tt>/home/mailservice</tt>に移動して、 <tt>/var/run/ppp0.pid</tt>がある場合(PPP接続されている場合)fetchmailを 実行します。ロックファイルは<tt>/var/lock</tt>ディレクトリにあり、例えば PPP接続が確立されていると: <verb> /var/lock/LCK..ttyS0: 中身 0000019881 /var/run/ppp0.pid: 中身 19881 </verb> となります。&dquot;2>&1&dquot; はエラー(出力ストリーム番号2)を 通常の出力(出力ストリーム番号1)に送ることを意味しています。fetchmail の<tt/ -s /オプションはサイレントモードです] <sect2>crontab <p> <!-- This cronentry file needs to been loaded into crontab, and will call the .checkformail - every 10 minutes. It won't write any mail or give any info to the console - since i'm redirecting everything to null. --> cronエントリーファイルはcrontabにロードされる必要があり、ここでは 10分ごとに<tt/.checkformail/を呼び出すようにします。コンソール上には何の 情報も表示しません(<tt>/dev/null</tt>にリダイレクトしているからです)。 <p> <quote><tt>(*** < file > *** text ***) cronentry</tt></quote> <tscreen><code> 0,10,20,30,40,50 * * * * /home/mailservice/.checkformail 1> /dev/null 2> /dev/null </code></tscreen> <p> <sect1>管理者側での設定 <!-- "At the admins site". --> <p> <!-- Well, this should be done when using the "A method" ... at the admin's site, so the email goes all from a complete domain, to one username. It is pretty simple, and once you've done it - it works like hell. this is NOT neccesary if your system administrator (the uplink) got another method, and is NOT neccesary at YOUR side !!!! --> &dquot;方法A&dquot;を使う時は管理者側のサイトで設定しなければいけません。 電子メールはちゃんとしたドメインから出ていきます。とてもシンプルです。 いったんこうしてしまえばこの方法で猛烈に動いてくれるでしょう。またシステム 管理者がもっと他の方法をつかっているなら&dquot;方法A&dquot;などいらないし、 あなた側で設定する必要もありません!!!! <p> <!-- When using a newer version of sendmail, the "old sendmail" trick probably won't work, so please refer to the "new sendmail" topics to let your mailrouting work. --> sendmailの新しいバージョンを使う時は&dquot;古いsendmail&dquot;トリックは 多分動作しないでしょう。メールルーティングを動作させるために &dquot;新しいsendmail&dquot;を参照して下さい。 <p> <sect2>(古いsendmail)sendmail.cfへの行追加 <!-- (old sendmail) add some lines to sendmail.cf--> <p> <!-- add the following lines to your /etc/sendmail.cf file, so the domains file will be read. please be noted that the "ruleset 98" is added as underhere, since - once you got errors :) it's a hell to find 'm out ! (and i can know it :) DuH). --> 以下の行を<tt>/etc/sendmail.cf</tt>に追加して下さい。ドメインファイルが読まれ ます。下では&dquot;ruleset 98&dquot;とコメントが書かれています。というのも いったんエラーが出たら何が悪いのか見つけるのに一苦労するからです(そしてそれを 著者は知っています :) DuH)。 <p> <quote><tt>(*** < file > *** add ***) /etc/sendmail.cf</tt></quote> <tscreen><code> # 操作ドメインのデータベース Kmaildomains btree /etc/maildomains.db # これらの行を追加 *IN* Ruleset 98 ! (under Ruleset 98). R$+ < @ $+ . > $: $1 < @ $2 > . R$+ < @ $+ > $* $: $(maildomains $1@$2 $: $1 < @ $2 > $3 $) R$+ < @ $+ > $* $: $(maildomains $2 $: $1 < # $2 > $3 $) R$+ < @ $* > . $: $1 < @ $2 . > </code></tscreen> <p> <sect2>(新しいsendmail)sendmail.cfへの行追加<label id="newsendmail"> <!-- (new sendmail) Adding some lines to sendmail.cf--> <p> <!-- With the newer sendmail releases (tested with sendmail v8.8.7, 8.8.8). Ignore method A, and add the next lines ... --> 新しいsendmailリリース(sendmail v8.8.7, 8.8.8でテストしました)では、 方法Aは無視して以下の行を追加します... <p> <quote><tt>(*** < file > *** add ***) /etc/sendmail.cf</tt></quote> <tscreen><code> # Database of handled domains Fw/etc/sendmail.cw Kvirtuser btree /etc/maildomains.db あるいは(上のディレクトリ以外の場所に置いている時は): Fw/yourhomedir/sendmail.cw Kvirtuser btree /yourhomedir/maildomains.db </code></tscreen> <p> <sect2>(新しいsendmail)/etc/sendmail.cwあるいは/yourdir/sendmail.cwファイルの編集 <!-- (new sendmail)editing the /etc/sendmail.cw (or /yourdir/sendmail.cw) file --> <p> <!-- If you are using another "location" for the sendmail.cw file, then please replace the "/etc/sendmail.cw" to "/yourhomedirectory/sendmail.cw". The pro points of putting this sendmail.cw file into your homedirectory is that you don't need root to change the domains to receive on. tough - this can give security risks if not used properly ! --> sendmail.cwファイルを他の場所に置いてつかっている時は"/etc/sendmail.cw" を"/yourhomedirectory/sendmail.cw"に置き換えて読んでいって下さい。 <!-- This file can already exist, or needs to be created, if it already exists be sure you don't overwrite the older data - or i need to refer you to my fine disclaimer :) --> このファイルは常に存在していて作る必要はありません。もしすでにあれば 古いデータを上書きしないようにして下さい。 <!-- First create a /etc/sendmail.cw file, what will be used to "send" a domain to a specific user ... here is an example ... (as you already knew, the name "mailservice" can be anything you want - it can even be your loginname (like mine is freaker). --> はじめに/etc/sendmail.cwファイルを作ります。 <quote><tt>(*** < file > *** text ***) /etc/sendmail.cw</tt></quote> <tscreen><code> mydomain.dom mailservice </code></tscreen> <p> <sect2>/etc/maildomainsファイルを作る <!-- creating a /etc/maildomains file--> <p> <!-- First create a /etc/maildomains file, what will be used to "send" a domain to a specific user ... here is an example ... (as you already knew, the name "mailservice" can be anything you want - it can even be your loginname (like mine is freaker). (you could have this /etc/maildomains in /yourhomedir/maildomains as mentioned before, just change the paths :) --> はじめに/etc/maildomainsファイルを作ります。特定のユーザーに送る。例として、 [もうご存知のように&dquot;mailservice&dquot;の箇所は好きなものにして下 さい。ここにあなたのログイン名を書いてもかまいません(著者の場合はfreaker (フリーク)]としています。 <p> <!-- With the OLDER sendmail versions:--> 古いsendmailバージョン: <quote><tt>(*** < file > *** text ***) /etc/maildomains</tt></quote> <tscreen><code> mydomain.dom mailservice </code></tscreen> <p> <!-- With the NEWER sendmail versions: --> 新しいsendmailバージョン: <p> <quote><tt>(*** < file > *** text ***) /etc/maildomains</tt></quote> <tscreen><code> @mydomain.dom mailservice </code></tscreen> <p> <sect2>動作させてみましょう! <!-- let it work ! --> <p> <!-- With the old & new sendmail versions you need to generate the btree (database) files, you'll need to do the following: --> sendmailの古い/新しいバージョンいずれにおいてもbtree(データベース)ファイル を作る必要があります。以下のようにして下さい。 <p> <verb> cd /etc (or /yourhomedir) makemap btree maildomains < maildomains </verb> (<bf/訳注:/makemapはsendmail用のデータベースマップを作るコマンドです。その他 オプションについてはmakemap(8)を参照) <p> <!-- after that, kill the sendmail daemon, and restart it. it should now WORK! good luck :) --> この後、sendmailデーモンをkillして再度開始します。これで動作しました。 good luck :) <sect>自動化 <!-- Automation --> <p> <!-- Well, now, everything above works ... (if it doesn't work - don't even think about automation before it WILL work ... - now - we need some script so it isn't a pain in the ass for the "mailadministrator" or the root user to add users to the procmailrc file ... The below example will be for "more experienced users" - since some things NEED to be changed as well ... - it is an example with the "B method - Subject lines". It can be easily adapted to the "A method". Since the "B method" will be more used (cheaper) than the "A" method - i decided to use the "B method" ... Am i sounding repetitive or not ? .. well - i meant to write it in this way :)) to bug you :))).. --> さて全て動作しました。もし動作しなかったらちゃんと動作するまで自動化は しなようにして下さい。ここでスクリプトが必要です。 procmailrcファイルにユーザーを追加するために"メール管理者"やrootユーザー に我慢する必要はありません。以下の例は経験のあるユーザー用のものです。 いくつか変更する必要があります。方法BのSubject行を使った例ですが、簡単に 方法Aのものに変更することができます。方法Bは方法Aよりも(安く)実現できるの で著者は方法Bを使いました。何回となく聞いてきましたが...。あなたをいらつか せる(bug) :))) 方法について :)) 書いています...。 <sect1>骨組み("skeleton") <p> <!-- Since the footer needs to be as footer (everything below won't be processed since we are bouncing there); there needs to be a header and a footer file. --> フッタはフッタであることが必要なので(返信するので以下は全て処理されません)、 ヘッダファイルとフッタファイルが必要です。 <sect2>&dquot;.procmailrc-header&dquot;について <!-- the ".procmailrc-header" file --> <p> <!-- This file will now be the "header & user" file .. since here will users been added and removed - it will be a important file ... - best take a backup from it each time you add a user ... - there COULD be something wrong sometime .. A system can fail ... --> このファイルは「&dquot;ヘッダ&dquot;と&dquot;ユーザー&dquot;」ファイルです。 ここでユーザーが追加されたり削除されたりします。とても重要なファイルです。 ユーザーを追加するときはバックアップをとるようにしましょう。システムエラーを 引き起こす何か悪いところがあるかもしれません.....。 <p> <quote><tt>(*** < file > *** text ***) .procmailrc-header</tt></quote> <tscreen><code> :0 c passtrough :0 * ^To:.*freaker@ibm.net ! freaker :0 * ^Subject:.root ! root :0 * ^Subject:.barbara ! barbara :0 * ^Subject:.paul ! paul@his.personal.emailaddress :0 c * ^Subject:.john ! john@his.personal.emailaddress :0 * ^Subject:.john ! john :0 * ^From:.*newsletter@ibm.net ! freaker :0 * ^FROM_DAEMON throwaway </code></tscreen> <p> <sect2>&dquot;.procmailrc-footer&dquot;ファイル <!-- the .procmailrc-footer file .. --> <p> <!-- As mentioned above, this file needs to be as footer - since all data BELOW it won't be used to deliver - this footer contains the "bounce" code to bounce the users not found *ABOVE* this footer !. it is the ABSOLUTE end of the file ! --> 上述したように<tt/.procmailrc/ファイルにはフッタが必要です。 以下のコードはユーザーに配送するメール以外のヘッダの処理をします。 このフッタは上記した<tt/.procmailrc-header/に載っていないユーザー宛ての メールを返信するコードが含まれています。ただのファイルの終りというわけで はありません! <p> <quote><tt>(*** < file > *** text ***) .procmailrc-footer</tt></quote> <tscreen><code> :0 |(/usr/bin/formail -r -k \ -A"X-loop: mailservice@mydomain.dom "| \ /usr/bin/gawk '{print }\ /^/ && !HEADER \ { system("/bin/cat nosuchuser"); \ print"--" ;\ HEADER=1 }' ) |\ /usr/bin/sendmail -t exit </code></tscreen> <p> <sect1>addmail スクリプト <!-- addmail script --> <p> <!-- This script will add a user to the header file, attach the header & footer to eachother - so it will be a complete .procmailrc file. the "#" (comments) are not really needed - and are for your info :). --> このスクリプトはヘッダファイルにユーザーを追加するものです。ヘッダとフッタが 結ばれています。これで完全な<tt/.procmailrc/ファイルになります。 &dquot;#&dquot;(コメント)は特に必要ではありません。あなた自身が情報を 書き込んで下さい。 <p> <quote><tt>(*** < file > *** code ***) addmail (* chmod 500 *)</tt></quote> <tscreen><code> #/bin/sh # # Copyright (c)1997 by Gunther Voet. rev 1.0.1 # please leave the Copyright in it when it is distributed with any # system using this thingy .. echo "" echo "Addmail v1.0.1 by Gunther Voet, Freaker / TuC'97-98 (21/04/97)" echo "" if [ $1 ]; then if [ $2 ]; then # バックアップファイルの作成! cp /home/mailserv/.procmailrc-header /home/mailserv/.procmailrc-backup # (>>) ヘッダファイルに情報を追加。 echo ":0" >> /home/mailserv/.procmailrc-header echo "* ^Subject:.$1" >> /home/mailserv/.procmailrc-header echo "! $2" >> /home/mailserv/.procmailrc-header echo "" >> /home/mailserv/.procmailrc-header # ヘッダファイルを.procmailrcにコピーしてフッタファイルを追加する。 cat /home/mailserv/.procmailrc-header > /home/mailserv/.procmailrc cat /home/mailserv/.procmailrc-footer >> /home/mailserv/.procmailrc # "mailserv"の所有権を確認する。読み書きの権限は"mailserv"ユーザー # のみにあるようにする。 chown mailserv /home/mailserv/.procmailrc chgrp users /home/mailserv/.procmailrc chmod 600 /home/mailserv/.procmailrc else echo "No DESTINATION mail address has been given ..." fi else echo "usage:" echo "" echo "syntax: addmail from_user to_user(domain)" echo "" echo "example: addmail freaker freaker@myemail.dom" echo "" fi </code></tscreen> <p> <!-- Now, this script will append the information of the user, as well the email address to the header file, it will copy it to the .procmailrc file, and will add the footer to it, so you got a complete .procmailrc to process the mail. If you want to delete a user- just edit the .procmailrc-header file, and at the next user added it will be deleted at the .procmailrc. To do a instant delete, just delete the user from both the files .procmailrc & .procmailrc- header. --> このスクリプトはヘッダファイルにメールアドレスとユーザー情報 を追加します。 <tt/.procmailrc/に情報をコピーしてフッタを追加します。これで メールを処理するための <tt/.procmailrc/ が完成します。ユーザーを削除したいとき は<tt/.procmailrc-header/ファイルを編集するだけです。次からはユーザーを追加 する時に<tt/.procmailrc/から削除されます(訳注:つまりこの方法ではユーザーを 削除する時は<tt/.procmailrc/ではなく<tt/.procmailrc-header/で削除して おきます)。すぐに削除する必要がある時は<tt/.procmailrc-header/ と<tt/.procmailrc/の両方のファイルからユーザーを消しておいて下さい。 <p> <!-- I guess you are smart enough to write a script that'll automatically add your users when using both methods - when doing a "adduser" at your box. --> <p> [訳注:まとめると、 <itemize> <item>&dquot;<tt/.procmailrc/&dquot; : procmail用ファイル <item>&dquot;<tt/.procmailrc-header/&dquot; : ユーザーの追加/削除 <item>&dquot;<tt/.procmailrc-footer/&dquot; : ユーザー以外の処理 </itemize> となります。] <sect>ヘルプ!(ため息) <!-- Help! (sigh) --> <p> <!-- Well, you need help - isn't :) ... hmm .. i could be sarcastic and just say "you could better do it again, 'coz it looks a messy enuf" - or .. i could help ... - I wrote down some common problems - IF you got any problem NOT listed in this HOWTO (section) - then mail me - and i'll put it in this howto even with your name/email addr in it :). **BEFORE** mailing to me - please look if you didn't forgot anything - and IF you want some help from me - send me the MOST DETAILED information - included the scripts & things you needed. i DON'T need any binaries - since i won't run them. --> ええと、ヘルプが必要じゃないですか :)? やっかいなものに対しては いやみをいうこともできるし「出直しといで」とだけ言うこともできます。 でも手助けしましょう...。以下よくある問題を書きました。 このHOWTOでリストしていない問題が生じたらメールを送って下さい。 名前/メールアドレスを書いてこのHOWTOに載せましょう :)。 メールを送る前に何か忘れてないか確認しましょう。さらに何かアドバイスが欲しい なら詳細な情報(スクリプト、何をしたかなど)を送りましょう。バイナリファイルを 送らないように!送っても実行しません。 <p> <sect1>自動スクリプトが動作しません: <!-- The automation script just doesn't work: --> <p> <itemize> <item>属性を実行可能にしてますか? <item>シェルは/bin/shにありますか? </itemize> <sect1>&dquot;anonymous mailserver&dquot;は何を意味していますか? <!-- What do you mean by "anonymous mailserver"? --> <p> <itemize> <item><!-- Well, you could make accounts like "anon0001@yourdom.dom" - and forward it to another email address ... nobody needs to read the .procmailrc file, so YOU ONLY know the address !. -->"anon0001@yourdom.dom"といったアカウントを作ったり、他のメールアドレスに それを転送したりします。だれも<tt/.procmailrc/ファイルを見る必要は なく、アドレスだけ知っていればいいのです。 </itemize> <sect1>catが死にました <!-- My cat died --> <p> <itemize> <item><!-- Well, next time don't print this HOWTO out on 200 gram papers, since it are 10 pages it would be 2KG for the cat - it is JUST TOO HEAVY ! -->ええと、次回は200グラムもの印刷用紙にこのHOWTOを印刷しないように。 このHOWTOは10数ページはあります。重すぎます! </itemize> <sect1>dogが死にました <!-- My dog died --> <p> <itemize> <item><!-- hmm - can't do anything about that one - why askin' me ? ... Just bury it ....--> うーむ。処置なし。そんなこと私に聞いてどうするの? 却下します。 </itemize> <sect1>Linuxって? <!-- Linux? --> <p> <itemize> <item><!-- A free-unix - posix compatible - made by Linus Torvalds ... Why are you reading this if you even don't know what Linux is ? --> フリーUNIX、POSIX互換、<it/Linus Torvalds/氏によって開発された... Linuxが何か知らないならどうしてこのHOWTOを読んでいるのですか? </itemize> <sect1>メールアカウントの見つけ方について教えて下さい。 <!-- Can you help me with finding a mail account? --> <p> <itemize> <item><!-- No! - this is a howto for YOUR side, i don't care about the side of your isp, nor how to get your email address. --> だめです!これはあなたを対象としたHOWTOで、あなたのプロバイダについては 面倒をみきれません。あなたのメールアドレスの入手方法もしかり。 </itemize> <sect1>なぜ「あとで情報を追加します」が削除されたのですか? <!-- Why is the "maybe later i'll make some addition ..." removed ? --> <p> <itemize> <item><!-- Read point 5.5 very carefully :) and you'll see why .. it's 'coz i needed to add it on general request :) -->5.5 を注意して読んで下さい :) そこに理由が書かれています。 「あとで情報を追加します」を追加する必要があると思います :)。 </itemize> <sect1>「ドメイン名」はどうやってわかるのですか? <!-- How do i get a "domain" ? --> <p> <itemize> <item><!-- Ask your local ISP/provider - he will help you with it. It could take days/ even weeks when asking to the Internic - your provider can help. --> ローカルISP/プロバイダに聞いて下さい。きっと助けてくれます。 Internicに聞けば数日/数週間かかるでしょう。 </itemize> <sect1>なぜこんなもん(f*cking lame)をつかうんだ? <!-- Why are you so f*cking lame using this? --> <p> <itemize> <item><!-- coz i don't want to spend money - and - 'coz i feel like being f*cking lame USING it - i *AM* using it - so why bother? --> お金を使いたくなく、「こんなもん」を使いたいからです。なぜそんなにかまう? </itemize> <sect1>Nosuchuserfileって? <p> <itemize> <item><!-- You can put in it what you want - as long you put some "needed" info so the original writer knows what happened with his "never delivered" mail. --> 必要な情報なら何でも書きたいことを書いて下さい。配達されなかったメールに 何が起こったのか送信者にわかるように。 </itemize> <sect1>ユーザーもメールの読み書きができますか? <!-- Can my users write/send mail too? --> <p> <itemize> <item><!-- This has nothing to do with the system i explained to you, read the sendmail manual ... - this is to RECEIVE mail - to be "always available at an email address". --> 私が説明しているシステムとは関係ありません。sendmailマニュアルを読んで下さい。 これはメールの受信と、ひとつのメールアドレスを使うことについてですが。 </itemize> <sect1>ユーザー全員用のシェルアカウントが必要ですか? <!-- Does every user need a shell account at my server? --> <p> <itemize> <item><!-- Nope .. - but - it will be really hard for users not having internet access :) ... You could have a masq'd network - and use a computer connected to it - so the users can get their mail that way, or you can generate a link between a bulletin board and his mail, you could even forward it to a fidonet gate :) ... reasons enough not to give a shell!. -->いいえ。でもインターネットアクセスができないというのはユーザーにとって 大変でしょう :) ...マスカレードネットワークを構築することもできるし、それに 接続されたコンピュータを使うこともできます。そしてユーザーはメールを取り込ん だり掲示板やメールのあいだのリンクを作ったりできます。 <htmlurl url="http://www.z2.fidonet.org/" name="fidnet">ゲート :)に フォワードすることだってできます。シェルアカウントを与えるのに十分な理由は ありません! </itemize> <sect1>skeletionって? <p> <itemize> <item><!-- i know it is a typo - but - i like this word better. --> 入力ミス(typo)です。でもこの文字の方が好きです。 </itemize> <sect1>Addmailって? <p> <itemize> <item><!-- No questions - for automation - you better be sure about what you are going to do ... since - it COULD be a trojan ya know :))) (it isn't but what means you need to know what scripting is before asking questions) It IS easy enough to interprete - that's even why i put the comments with it. *IF* you are going to distribute this script - leave my Copyright in it please ! thanks :). --> 自動化に関する質問は受け付けません。あなたがしていることを確認した方がよい でしょう... というのはそれは「トロイの木馬」になりうるからです :)))。 (知る必要があるのは質問するまえにスクリプトが何をしているか調べることで しょう)。解釈するのに十分易しいものです。これがこのコメントをした理由です。 このスクリプトを配布する場合は必ずCopyrightを残して下さい。thanks :) </itemize> <sect1>なぜ不親切なんですか? <!-- Why are you so cruel? --> <p> <itemize> <item><!-- I am not cruel :) i am nice :) i am the nicest guy of the world, of the universe ! NOW SCRAM! (i just want to be complete in my HOWTO, and not TOO much "drifting away" from my original point in the doc - so :) that's all). --> 私は不親切にはしてません:)親切ですよ:)。さあ出てった出てった! (このHOWTOを完全なものにしたく、ドキュメントの本来の目的からはずれて しまっています。それだけです:))。 </itemize> <sect1>あなたのおおげさな言葉に周りから不満がでません? <!-- Didn't you get a complaint of excessive language ? --> <p> <itemize> <item><!-- Not yet, but, could be i'm filtering everything containing 'excessive' and language :) i don't know :)) --> いいええ。でも過激なフィルタと言葉を使うかもしれません :))。 知りません :))。 </itemize> <sect1>このHOWTOが他よりも変わっているのはなぜ? <!-- Why is this howto different than most others? --> <p> <itemize> <item><!-- coz sometimes reading plain howto's CAN be boring ... i wanted to add something next to it ... --> プレーンテキストのHOWTOを読んでいると面倒になるからだと思います。 次は何か追加したいと思います...。 </itemize> <sect1>ローカルではドメインは動作するのですがリモートで受信できない <!-- locally my domain works, but remote it seems not to receive--> <p> <itemize> <item><!-- Check out your "sendmail.cw" file, since the domains NEED to be added in it ! --> "sendmail.cw"ファイルをチェックして下さい。ドメインを追加する必要があります! </itemize> <sect1>dogが死にました <!-- My dog died--> <p> <itemize> <item><!-- the rulesets don't work, i can't receive any mail, or sendmail dies Refer to the new section "new sendmail" - and disregard the old sendmail tricks. The newer sendmail should be easier to use with virtual domains. --> ルールセットが動作していません。メールが受信できずsendmailが死にました。 <ref id="newsendmail" name="(新しいsendmail)sendmail.cfへの行追加">章を 参照して下さい - 古いsendmailトリックは無視しましょう。新しいsendmailは 仮想ドメインで使いやすくなっています。 </itemize> <sect>最後に <!-- The End --> <p> <!-- This sounds like the end ... If you find any unwanted bugs (or features :)), then leave some feedback ... any comments & suggestions -> mail them :). if you are still bored after reading this, please go to: http://tuc.parkside.net/ hehehe --> これは最後のようだ。予期せぬバグがあったらフィードバックを残して下さい。 またコメント、提案はメールで送って下さい。これを読んでうんざりしたんだったら <htmlurl url="http://tuc.ml.org/" name="http://tuc.ml.org/"> に行きなさい、 hehehe。 <p> My thanks go out to: <!-- Hannes van de Vel: for supporting me (hum) Tetsu Isaji: the japanese offline-mailing & notifying me about errors :) Greg Hankins: for notifying me about some errors in the sgml version. Linus torvalds: of'course ... without his help this howto wouldn't be here! --> <p> <verb> Hannes van de Vel: サポートしてくれました。 Tetsu Isaji: 日本語版「offline-mailing」とエラーの指摘 :)。 Greg Hankins:sgmlバージョンのエラーについて指摘。 Linus torvalds: もちろん彼がいなければこのHOWTOもありません! </verb> <p> [ 日本語訳: 伊佐冶 哲, <tt/isaji@mxu.meshnet.or.jp/ <p> 訳文について間違い、不明な点があればご連絡下さい。] </article>