Postfix
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
* [[Postfix]]
メールサーバです。sendmailはめんどくさいので、これを使い...
#contents
** 環境設定
postfixはインストールされている可能性がありますので、
rpm -qa | grep postfix
で確認します。バージョンが怪しかったので、とりあえずけし...
rpm -qa | grep postfix | xargs rpm -e
ではここからhttp://www.postfix.org/download.htmlダウンロ...
tar xzvf postfix-2.1.5.tar.gz
make
そしてpostfixを管理するユーザとグループを作成します。
groupadd postdrop
useradd -g postdrop -d /dev/null -s /bin/false postfix
postfixユーザはホームもなければシェルも触れないようにして...
make install
あれ?エラーがでました。
postfix: fatal: file /etc/postfix/main.cf: parameters ma...
とりあえず、/etc/groupでpostdropのIDを変更して、再度make ...
その後/etc/postfix/main.cfを編集します。
myhostname = hidekazu.dhs1.sst.ne.jp ホスト名
mydomain = dhs1.sst.ne.jp ドメイン名
inet_interfaces = all すべて受信
local_recipient_maps = proxy:unix:passwd.byname $alias_m...
mydestination = $myhostname, localhost.$mydomain, $mydom...
mynetworks_style = subnet IP空間の設定
mynetworks = 192.168.1.0/24, 127.0.0.0/8 この範囲のクラ...
smtpd_banner = $myhostname ESMTP $mail_name メールヘッダ...
relay_domains = $mydestination 信頼されない(mynetworks)...
home_mailbox = Maildir/ 各ユーザのホームディレクトリ内...
smtpd_helo_required = yes HELOコマンドでホスト名を通知...
smtpd_client_restrictions = permit_mynetworks, reject_un...
設定後、起動、停止、再起動の確認をします。
/usr/sbin/postfix start
/usr/sbin/postfix stop
/usr/sbin/postfix reload
また25番ポートが開いているかも確認しておきます。
nmap localhost
ではtelnetから
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
220 hidekazu.dhs1.sst.ne.jp ESMTP Postfix
HELO localhost --->開始メッセージ
250 hidekazu.dhs1.sst.ne.jp
MAIL FROM: test@localhost --->送信者
250 Ok
RCPT TO: test2@localhost --->受信者
250 Ok
DATA --->ボディ入力
354 End data with <CR><LF>.<CR><LF>
ugoitekure.
. --->メッセージ終了
250 Ok: queued as 2852DFE005
QUIT --->終わり
するとtest2のホームディレクトリのMaildirにnewというディレ...
** qpopper
SMTPからメールを取り出すためのPOPサーバです。
http://www.eudora.com/products/unsupported/qpopper/index....
wget ftp://ftp.cc.umanitoba.ca/src/drac.tar.Z
mkdir drac
cd drac
tar xzvf ../drac.tar.Z
ではMakefileを修正します。http://pocketstudio.jp/drac-ja/...
INSTALL = install
EBIN = /usr/local/sbin
MAN = /usr/local/man/man
DEFS = -DSOCK_RPC -DFCNTL_LOCK -DGETHOST -DDASH_C
CC = gcc
RANLIB = :
CFLAGS = $(DEFS) -g
LDLIBS = -ldb
TSTLIBS = -L. -ldrac -lnsl
RPCGENFLAGS = -C -I
MANLIB = 3
MANADM = 8
修正できましたら、
make
make install
make install-man
cp libdrac.a /usr/local/lib
cp dracd-setup.linux /etc/init.d/dracd
ちょっとdracdを修正します。
daemon rpc.dracd&
を
daemon /usr/local/sbin/rpc.dracd -i -e 30&
にしました。-iは起動時にdatabaseを初期化します。 -eは承認...
#!/bin/bash
#
# dracd Startup script for the dracd
#
# chkconfig: - 87 15
# description: dracd
# processname: dracd
#
# Put this file into /etc/rc.d/init.d/dracd
# and link it intot he run levels you want to use it
# by doing "ln -s /etc/rc.d/init.d/dracd /etc/rc.d/rc.<...
#
# dracd-setup
にでもして、chkconfig --add dracdして、chkconfig --level ...
cp dracd.allow-sample /etc/mail/dracd.allow
emacs /etc/mail/dracd.allow
で編集し、
#255.255.255.255 192.168.16.8 #<--コメント
255.255.255.255 127.0.0.1
ではqpopperです。
tar xzvf qpopper4.0.5.tar.gz
で解凍して、解凍したディレクトリに移動後、
adduser pop
./configure --with-popuid=pop
ここで、dracを使用する場合は、--enable-drac、--enable-apo...
make
make insatll
を実行します。/usr/local/sbinにpopperがインストールされて...
popauthで、APOP用のパスワードを設定します。
popauth -init
で初期化し、
popauth -user hogeuser
でパスワード設定です。
次に/etc/xinetd.dにpopperという名前で作成します。
service pop3
{
socket_type = stream
wait = no
only_from = 127.0.0.1
user = root
server = /usr/local/sbin/popper
server_args = -S -s -R
disable = no
}
-Sはサーバモード,-sはロギングにsyslogを、-Rは接続元の名前...
その後は
/etc/inetd/xinetd restart
** Courier-IMAP
認証用のライブラリとしてCourier authentication libraryを...
http://www.courier-mta.org/からCourier authentication lib...
wget
http://superb-west.dl.sourceforge.net/sourceforge/courier...
tar xvjf courier-authlib-0.58.tar.bz2
cd courier-authlib-0.58
./configure --with-redhat
make
configure: error: Cannot find either the gdbm or the db ...
んー エラーがでました。とりあえず、[[OpenLDAP]]でgdbmを...
make install
make install-migrate
make install-configure
詳しくはINSTALLにかかれてます。
では、Courier-IMAPです。http://www.courier-mta.org/downlo...
wget http://surfnet.dl.sourceforge.net/sourceforge/couri...
tar xvjf courier-imap-4.1.0.tar.bz2
cd courier-imap-4.1.0
./configure --prefix=/usr/local --with-redhat --without-...
rootでは怒られます。また--with-redhatをつけないとrpmを作...
※Ver3の時
Courier authenticationに移動して、
./configure --with-redhat
make install
make install-migrate
make install-configure
courier-imap
./configure --prefix=/usr/local/courier-imap
make
make install
make install-configure
/usr/local/courier-imap/libexec/pop3d.rc start
/usr/local/courier-imap/libexec/imapd.rc start
http://www.aconus.com/~oyaji/mail2/courier-imap.htm~
http://www.gside.org/Gentoo/postfix/virtualdomain.html~
** cyrus-SASL
SMTPAuthに対応するということで、ftp://ftp.andrew.cmu.edu/...
wget ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-...
cd cyrus-sasl-2.1.21
./configure --enable-login=yes # --enable-login=yesはOut...
make
make install
ln -s /usr/local/lib/sasl /usr/lib/sasl
ではpostfixを。
groupadd postdrop #管理用
groupadd postfix #管理用
useradd -g postfix -d /dev/null -s /bin/false postfix #...
cd postfix-2.2.5
make tidy #以前コンパイルして残っている場合は、tidyをつ...
make makefiles CCARGS="-DUSE_SASL_AUTH -I/usr/local/incl...
make install
** セキュリティ
** ウィルスチェック
http://www.g-ninja.net/freebsd/clamav.html
** バーチャルドメイン
virtual mailbox
** チェック
http://www.abuse.net/relay.html
** メモ
smtp inet n - n - - smtpd
587 inet n - n - - smtpd
http://nekojita.org/hiki/Postfix.html
** リンク
http://solaris.bluecoara.net/servers/postfix/virtual2.pht...
[[メールサーバーのインストール・設定>http://www.psg.jp/ma...
[[Linuxで自宅サーバ>http://www.miloweb.net/]]~
[[日本Courierユーザ会>http://courier-users.jp/]]~
http://www.y-min.or.jp/~nob/FreeBSD/courier-imap.html~
http://www.aconus.com/~oyaji/~
http://www.gita.jp/index.php?board=20;action=display;thre...
http://www.miloweb.net/postfix2.html~
** 参考書籍
終了行:
* [[Postfix]]
メールサーバです。sendmailはめんどくさいので、これを使い...
#contents
** 環境設定
postfixはインストールされている可能性がありますので、
rpm -qa | grep postfix
で確認します。バージョンが怪しかったので、とりあえずけし...
rpm -qa | grep postfix | xargs rpm -e
ではここからhttp://www.postfix.org/download.htmlダウンロ...
tar xzvf postfix-2.1.5.tar.gz
make
そしてpostfixを管理するユーザとグループを作成します。
groupadd postdrop
useradd -g postdrop -d /dev/null -s /bin/false postfix
postfixユーザはホームもなければシェルも触れないようにして...
make install
あれ?エラーがでました。
postfix: fatal: file /etc/postfix/main.cf: parameters ma...
とりあえず、/etc/groupでpostdropのIDを変更して、再度make ...
その後/etc/postfix/main.cfを編集します。
myhostname = hidekazu.dhs1.sst.ne.jp ホスト名
mydomain = dhs1.sst.ne.jp ドメイン名
inet_interfaces = all すべて受信
local_recipient_maps = proxy:unix:passwd.byname $alias_m...
mydestination = $myhostname, localhost.$mydomain, $mydom...
mynetworks_style = subnet IP空間の設定
mynetworks = 192.168.1.0/24, 127.0.0.0/8 この範囲のクラ...
smtpd_banner = $myhostname ESMTP $mail_name メールヘッダ...
relay_domains = $mydestination 信頼されない(mynetworks)...
home_mailbox = Maildir/ 各ユーザのホームディレクトリ内...
smtpd_helo_required = yes HELOコマンドでホスト名を通知...
smtpd_client_restrictions = permit_mynetworks, reject_un...
設定後、起動、停止、再起動の確認をします。
/usr/sbin/postfix start
/usr/sbin/postfix stop
/usr/sbin/postfix reload
また25番ポートが開いているかも確認しておきます。
nmap localhost
ではtelnetから
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
220 hidekazu.dhs1.sst.ne.jp ESMTP Postfix
HELO localhost --->開始メッセージ
250 hidekazu.dhs1.sst.ne.jp
MAIL FROM: test@localhost --->送信者
250 Ok
RCPT TO: test2@localhost --->受信者
250 Ok
DATA --->ボディ入力
354 End data with <CR><LF>.<CR><LF>
ugoitekure.
. --->メッセージ終了
250 Ok: queued as 2852DFE005
QUIT --->終わり
するとtest2のホームディレクトリのMaildirにnewというディレ...
** qpopper
SMTPからメールを取り出すためのPOPサーバです。
http://www.eudora.com/products/unsupported/qpopper/index....
wget ftp://ftp.cc.umanitoba.ca/src/drac.tar.Z
mkdir drac
cd drac
tar xzvf ../drac.tar.Z
ではMakefileを修正します。http://pocketstudio.jp/drac-ja/...
INSTALL = install
EBIN = /usr/local/sbin
MAN = /usr/local/man/man
DEFS = -DSOCK_RPC -DFCNTL_LOCK -DGETHOST -DDASH_C
CC = gcc
RANLIB = :
CFLAGS = $(DEFS) -g
LDLIBS = -ldb
TSTLIBS = -L. -ldrac -lnsl
RPCGENFLAGS = -C -I
MANLIB = 3
MANADM = 8
修正できましたら、
make
make install
make install-man
cp libdrac.a /usr/local/lib
cp dracd-setup.linux /etc/init.d/dracd
ちょっとdracdを修正します。
daemon rpc.dracd&
を
daemon /usr/local/sbin/rpc.dracd -i -e 30&
にしました。-iは起動時にdatabaseを初期化します。 -eは承認...
#!/bin/bash
#
# dracd Startup script for the dracd
#
# chkconfig: - 87 15
# description: dracd
# processname: dracd
#
# Put this file into /etc/rc.d/init.d/dracd
# and link it intot he run levels you want to use it
# by doing "ln -s /etc/rc.d/init.d/dracd /etc/rc.d/rc.<...
#
# dracd-setup
にでもして、chkconfig --add dracdして、chkconfig --level ...
cp dracd.allow-sample /etc/mail/dracd.allow
emacs /etc/mail/dracd.allow
で編集し、
#255.255.255.255 192.168.16.8 #<--コメント
255.255.255.255 127.0.0.1
ではqpopperです。
tar xzvf qpopper4.0.5.tar.gz
で解凍して、解凍したディレクトリに移動後、
adduser pop
./configure --with-popuid=pop
ここで、dracを使用する場合は、--enable-drac、--enable-apo...
make
make insatll
を実行します。/usr/local/sbinにpopperがインストールされて...
popauthで、APOP用のパスワードを設定します。
popauth -init
で初期化し、
popauth -user hogeuser
でパスワード設定です。
次に/etc/xinetd.dにpopperという名前で作成します。
service pop3
{
socket_type = stream
wait = no
only_from = 127.0.0.1
user = root
server = /usr/local/sbin/popper
server_args = -S -s -R
disable = no
}
-Sはサーバモード,-sはロギングにsyslogを、-Rは接続元の名前...
その後は
/etc/inetd/xinetd restart
** Courier-IMAP
認証用のライブラリとしてCourier authentication libraryを...
http://www.courier-mta.org/からCourier authentication lib...
wget
http://superb-west.dl.sourceforge.net/sourceforge/courier...
tar xvjf courier-authlib-0.58.tar.bz2
cd courier-authlib-0.58
./configure --with-redhat
make
configure: error: Cannot find either the gdbm or the db ...
んー エラーがでました。とりあえず、[[OpenLDAP]]でgdbmを...
make install
make install-migrate
make install-configure
詳しくはINSTALLにかかれてます。
では、Courier-IMAPです。http://www.courier-mta.org/downlo...
wget http://surfnet.dl.sourceforge.net/sourceforge/couri...
tar xvjf courier-imap-4.1.0.tar.bz2
cd courier-imap-4.1.0
./configure --prefix=/usr/local --with-redhat --without-...
rootでは怒られます。また--with-redhatをつけないとrpmを作...
※Ver3の時
Courier authenticationに移動して、
./configure --with-redhat
make install
make install-migrate
make install-configure
courier-imap
./configure --prefix=/usr/local/courier-imap
make
make install
make install-configure
/usr/local/courier-imap/libexec/pop3d.rc start
/usr/local/courier-imap/libexec/imapd.rc start
http://www.aconus.com/~oyaji/mail2/courier-imap.htm~
http://www.gside.org/Gentoo/postfix/virtualdomain.html~
** cyrus-SASL
SMTPAuthに対応するということで、ftp://ftp.andrew.cmu.edu/...
wget ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-...
cd cyrus-sasl-2.1.21
./configure --enable-login=yes # --enable-login=yesはOut...
make
make install
ln -s /usr/local/lib/sasl /usr/lib/sasl
ではpostfixを。
groupadd postdrop #管理用
groupadd postfix #管理用
useradd -g postfix -d /dev/null -s /bin/false postfix #...
cd postfix-2.2.5
make tidy #以前コンパイルして残っている場合は、tidyをつ...
make makefiles CCARGS="-DUSE_SASL_AUTH -I/usr/local/incl...
make install
** セキュリティ
** ウィルスチェック
http://www.g-ninja.net/freebsd/clamav.html
** バーチャルドメイン
virtual mailbox
** チェック
http://www.abuse.net/relay.html
** メモ
smtp inet n - n - - smtpd
587 inet n - n - - smtpd
http://nekojita.org/hiki/Postfix.html
** リンク
http://solaris.bluecoara.net/servers/postfix/virtual2.pht...
[[メールサーバーのインストール・設定>http://www.psg.jp/ma...
[[Linuxで自宅サーバ>http://www.miloweb.net/]]~
[[日本Courierユーザ会>http://courier-users.jp/]]~
http://www.y-min.or.jp/~nob/FreeBSD/courier-imap.html~
http://www.aconus.com/~oyaji/~
http://www.gita.jp/index.php?board=20;action=display;thre...
http://www.miloweb.net/postfix2.html~
** 参考書籍
ページ名: