|
|
|
|
Postfix |
|
|
|
|
● |
Postfixのインストールと設定 |
|
|
|
Postfixがインストールされているかどうか確認する
# rpm -qa | grep postfix
postfix-2.8.10-1vl6.x86_64 インストールされている
もし、インストールされていなければ以下を実行する
# apt-get install postfix
Postfixが起動しているか確認
# ps ax | grep postfix
2110 ? Ss 0:00 /usr/lib64/postfix/master 起動している
2915 pts/0 S+ 0:00 grep --color=auto postfix
もし、何も表示されなければPostfixを起動する
# /etc/rc.d/init.d/postfix start
Postfixが自動起動になっているか確認
# chkconfig --list postfix
postfix 0:off 1:off 2:on 3:on 4:on 5:on 6:off
3:onなのでOK、もし、3:offになっていたら
# chkconfig postfix on
|
|
|
|
|
|
● |
設定ファイルの編集 |
|
|
|
# vi /etc/postfix/main.cf
myhostname = xxmain1xx.net 自分のドメインに変更する
mydomain = xxmain1xx.net 自分のドメインに変更する
サーバーから送られるメールに付加するドメインを選択する
myorigin = $myhostname #削除
メール受信する範囲選択・・・インターネット使用する
inet_interfaces = all #削除
メールを最終的に受信するドメイン名設定
mydestination = $myhostname, localhost.$mydomain $mydomain
メール中継許可・・・同じサブネットのLAN内だけ許可
mynetworks_style = subnet #削除
POPサーバーとしてCourier-IMAPを使う
home_mailbox = Maildir/ #削除
編集終了 保存
Postfixを再起動するとメール送受信準備完了する
# /etc/rc.d/init.d/postfix restart
Postfixを停止中: [ OK ]
Postfixを起動中: [ OK ]
|
|
|
|
|
|
POPサーバーCourier-IMAP |
|
● |
Courier-IMAPのインストールと設定 |
|
|
|
Courier-IMAPはインストールされていないのでインストールする。 |
|
|
|
# apt-get install courier-imap
自動起動設定の確認
# chkconfig --list courier-imap
courier-imap 0:off 1:off 2:on 3:on 4:on 5:on 6:off
ランラベル2〜5がonならOK
# chkconfig --list courier-imap
courier-authlib 0:off 1:off 2:on 3:on 4:on 5:on 6:off
ランラベル2〜5がonならOK
|
|
|
|
|
● |
メールボックスの準備 |
|
|
|
受信メールの保存ディレクトリ作成
# cd /home/httpd/html 自分のホームディレクトリに移動
Maildirを作成する
下のコマンドを実行するとcur、new、tmpの各ディレクトリがMaildir以下に作成される
# /usr/sbin/maildirmake Maildir
------------ 参考 ------------------------------------------------------------------
ユーザー毎にMaildir作成は面倒なので/etc/skelディレクトリにMaildirを作成しておけば、次回ユーザーを作成すると同時にホームディレクトリにMaildirが作成される
# /usr/sbin/maildirmake /etc/skel/Maildir
-----------------------------------------------------------------------------------
|
|
|
|
|
|
● |
メールアカウントの作成 |
|
|
|
メールのみのユーザーの場合は以下を実行する
# useradd -s /sbin/nonlogin xxxx xxxxはユーザー名
|
|
|
/home以下にユーザー/xxxxが作成される。
------------ 参考 -----------------------------------------------------------------
標準設定ではLinuxユーザーがそのままPostfixユーザーになる。
ユーザー名@xxmain1xx.net
になる。
-----------------------------------------------------------------------------------
|
|
|
|
|
|
● |
Courier-IMAPの起動 |
|
|
|
|
|
|
|
courier-imapとcourier-authlibの二つを起動する
# service courier-imap start
Starting Courier-IMAP server: imap generating-SSL-certificate... imap-ssl pop3 generating-SSL-certificate... pop3-ssl
# service courier-authlib start
Starting Courier authentication services: authdaemond
動作確認
# ps ax | grep courier-imap
4918 ? S 0:00 /usr/sbin/courierlogger -pid=/var/run/imapd.pid -start -name=imapd /usr/libexec/courier-imap/couriertcpd -address=0 -maxprocs=40 -maxperip=4 -nodnslookup -noidentlookup 143 /usr/sbin/imaplogin /usr/sbin/imapd Maildir
・
・
・
5157 pts/0 S+ 0:00 grep --color=auto courier-imap
起動していない場合は
・・・・・・courier-imap起動していない
となる
# ps ax | grep courier-authlib
4971 ? S 0:00 /usr/sbin/courierlogger -pid=/var/spool/authdaemon/pid -start /usr/libexec/courier-authlib/authdaemond
4972 ? S 0:00 /usr/libexec/courier-authlib/authdaemond
4973 ? S 0:00 /usr/libexec/courier-authlib/authdaemond
4974 ? S 0:00 /usr/libexec/courier-authlib/authdaemond
4975 ? S 0:00 /usr/libexec/courier-authlib/authdaemond
4976 ? S 0:00 /usr/libexec/courier-authlib/authdaemond
4977 ? S 0:00 /usr/libexec/courier-authlib/authdaemond
5108 pts/0 S+ 0:00 grep --color=auto courier-authlib
起動していない場合は
・・・・・・courier-authlib起動していない
となる
|
|
|
|
|
|
● |
参考(メール受信が出来ない原因) |
|
|
これは、私の体験ですが、メールサーバーの設定が終わってメールの送受信テストを行ったのですが、送信は出来ても受信が出来ません。Linuxのメール設定に問題がないかどうか何度も確認しましたが、やっぱり受信が出来ない状態が続いていました。
最近になってDNS(Zone edit)の設定方法をネットで確認していたら、その原因がわかりました。何てことはないのですが、これは気付きませんでした。何と言ってもZone
editは英語のサイトですから、英語に弱い私は良く理解しないままDNSの設定をしていたのが原因でした。
Zone editには(他のDNSもそうかも知れません)Mail Fowardと言うメール転送機能があります。そこに転送先のメールアドレスを登録していました。これを外したらメール受信が出来るようになりました。
こちらを参照して下さい。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|