フリーソフト/Postfix(Solaris10)
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
RIGHT:[[フリーソフトウェアのコンパイル]]
http://sy2920.s151.xrea.com/solaris/postfix-pkg.html
http://sy2920.s151.xrea.com/mail/smtpauth-dovecot_sasl.html
*sendmail のパッケージを消す [#ob175e77]
# cp /etc/aliases /var/tmp
# pkgrm SUNWsndmu
SUNWsndmu Sendmail (/usr)
(sparc) 11.10.0,REV=2005.01.21.15.53
このパッケージを削除しますか [y,n,?,q] y
## インストール済みパッケージインスタンス <SUNWsndmu> を...
## 大域ゾーン内でパッケージ <SUNWsndmu> の依存関係を検査...
## パッケージ情報を処理中です。
## クラス <none> 中のパス名を削除中です。
/usr/sbin/sendmail
/usr/sbin/newaliases
...
/usr <共有パス名は削除されません。>
## システム情報を更新中です。
<SUNWsndmu> の削除に成功しました。
# pkgrm SUNWsndmr
このパッケージを削除しますか [y,n,?,q] y
## インストール済みパッケージインスタンス <SUNWsndmr> を...
このパッケージには、パッケージの削除の処理中にスーパーユ...
ス権で実行されるスクリプトが含まれています。
このパッケージの削除処理を継続しますか [y,n,?,q] y
## 大域ゾーン内でパッケージ <SUNWsndmr> の依存関係を検査...
## パッケージ情報を処理中です。
## クラス <manifest> 中のパス名を削除中です。
...
/etc <共有パス名は削除されません。>
## システム情報を更新中です。
<SUNWsndmr> の削除に成功しました。
*Postfix [#c0207a15]
http://www.postfix-jp.info/trans-2.3/jhtml/INSTALL.html
% gtar xvzf ../src/postfix-2.6.2.tar.gz
% cd postfix-2.6.2/
Solaris のコンパイラを使う
% make makefiles CC=/opt/SUNWspro/bin/cc
BerkeleyDB を利用する
% make tidy
% make makefiles CCARGS="-DHAS_DB -I/usr/local/BerkeleyD...
AUXLIBS="-R/usr/local/BerkeleyDB/lib -L/usr/local/Be...
% make
Dovecot を利用する
% make makefiles CCARGS='-DUSE_SASL_AUTH -DDEF_SERVER_SA...
TLS を利用する
% make makefiles CCARGS="-DUSE_TLS -I/usr/local/include" \
AUXLIBS="-R/usr/local/lib -L/usr/local/lib -lssl -lcr...
すべて混ぜて
% unset LD_LIBRARY_PATH
% make makefiles CC=/opt/sunstudio12.1/bin/cc \
CCARGS='-DHAS_DB -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE...
AUXLIBS="-R/usr/local/BerkeleyDB.4.7/lib -R/usr/local/s...
% make
# groupadd -g 89 postfix
# groupadd -g 88 postdrop
# useradd -u 89 -g 89 -d /dev/null -s /bin/false postfix
# /usr/ccs/bin/make install
install_root: [/]
Please specify a directory for scratch files while insta...
You must have write permission in this directory.
tempdir: [/home/tanaka/build/postfix-2.6.2]
lease specify the final destination directory for instal...
configuration files.
config_directory: [/etc/postfix]
Please specify the final destination directory for insta...
administrative commands. This directory should be in the...
path of adminstrative users.
command_directory: [/usr/sbin]
Please specify the final destination directory for insta...
daemon programs. This directory should not be in the com...
path of any users.
daemon_directory: [/usr/libexec/postfix]
Please specify the final destination directory for Postf...
data files such as caches or random numbers. This direct...
be shared with non-Postfix software.
data_directory: [/var/lib/postfix
Please specify the destination directory for the Postfix...
Specify "no" if you do not want to install these files.
html_directory: [no]
Please specify the owner of the Postfix queue. Specify a...
numerical user ID and group ID values that are not used ...
accounts on the system.
mail_owner: [postfix]
Please specify the final destination pathname for the in...
mailq command. This is the Sendmail-compatible mail queu...
command.
mailq_path: [/usr/bin/mailq]
Please specify the destination directory for the Postfix...
pages. You can no longer specify "no" here.
manpage_directory: [/usr/local/man]
Please specify the final destination pathname for the in...
newaliases command. This is the Sendmail-compatible comm...
alias databases for the Postfix local delivery agent.
newaliases_path: [/usr/bin/newaliases]
Please specify the final destination directory for Postf...
queue_directory: [/var/spool/postfix]
Please specify the destination directory for the Postfix...
Specify "no" if you do not want to install these files.
readme_directory: [no]
Please specify the final destination pathname for the in...
sendmail command. This is the Sendmail-compatible mail p...
interface.
sendmail_path: [/usr/lib/sendmail]
Please specify the group for mail submission and for que...
commands. Specify a group name with a numerical group ID...
shared with other accounts, not even with the Postfix ma...
account. You can no longer specify "no" here.
setgid_group: [postdrop]
**/etc/services に以下の行を追加 [#j62db689]
ssmtp 465/tcp smtps # SMTP o...
**設定ファイルの編集 [#wb15bda9]
-/etc/postfix/main.cf
-/etc/postfix/master.cf
**起動スクリプト [#ce5f697a]
/lib/svc/method/postfix (実行権つける)
#!/sbin/sh
# rc script for postfix
PROG=/usr/sbin/postfix
SERVICE=`basename $PROG`
ECHO=/usr/ucb/echo
case "$1" in
start)
$ECHO -n "starting $SERVICE ... "
$PROG start && $ECHO "[ OK ]" || $ECHO "[ NG ]"
;;
stop)
$ECHO -n "stopping $SERVICE ... "
$PROG stop && $ECHO "[ OK ]" || $ECHO "[ NG ]"
;;
restart)
$0 stop
sleep 3
$0 start
;;
reload|refresh)
$ECHO -n "refreshing $SERVICE ... "
$PROG reload && $ECHO "[ OK ]" || $ECHO "[ NG ]"
;;
*)
echo "Usage: $0 { start | stop | restart | refresh }"
exit 1
;;
esac
exit 0
**マニフェスト [#b96bda09]
/var/svc/manifest/network/smtp-postfix.xml
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/...
<!--
Copyright 2004 Sun Microsystems, Inc. All rights reserv...
Use is subject to license terms.
-->
<service_bundle type='manifest' name='postfix'>
<service
name='network/smtp'
type='service'
version='1'>
<single_instance />
<dependency
name='fs-local'
grouping='require_all'
restart_on='none'
type='service'>
<service_fmri value='svc:/system/filesystem/local' />
</dependency>
<dependency
name='network-service'
grouping='require_all'
restart_on='none'
type='service'>
<service_fmri value='svc:/network/service' />
</dependency>
<dependency
name='name-services'
grouping='require_all'
restart_on='refresh'
type='service'>
<service_fmri value='svc:/milestone/name-services' />
</dependency>
<dependency
name='identity'
grouping='optional_all'
restart_on='refresh'
type='service'>
<service_fmri value='svc:/system/identity:domain' />
</dependency>
<dependency
name='system-log'
grouping='optional_all'
restart_on='none'
type='service'>
<service_fmri value='svc:/system/system-log' />
</dependency>
<instance name='postfix' enabled='false'>
<dependency
name='config-file'
grouping='require_all'
restart_on='refresh'
type='path'>
<service_fmri
value='file://localhost/etc/postfix/main.cf' />
</dependency>
<dependency
name='nsswitch'
grouping='require_all'
restart_on='refresh'
type='path'>
<service_fmri
value='file://localhost/etc/nsswitch.conf' />
</dependency>
<!--
If autofs is enabled, wait for it to get users' home
directories.
-->
<dependency
name='autofs'
grouping='optional_all'
restart_on='none'
type='service'>
<service_fmri value='svc:/system/filesystem/autofs' />
</dependency>
<dependent
name='smtp-sendmail_multi-user'
grouping='optional_all'
restart_on='none'>
<service_fmri
value='svc:/milestone/multi-user' />
</dependent>
<exec_method
type='method'
name='start'
exec='/lib/svc/method/postfix start'
timeout_seconds='120' />
<exec_method
type='method'
name='stop'
exec='/lib/svc/method/postfix stop'
timeout_seconds='60' />
<exec_method
type='method'
name='refresh'
exec='/lib/svc/method/postfix reload'
timeout_seconds='60' />
<property_group name='startd' type='framework'>
<propval name='ignore_error' type='astring'
value='core,signal' />
</property_group>
<property_group name='general' type='framework'>
<propval name='action_authorization' type='astring'
value='solaris.smf.manage.postfix' />
</property_group>
<template>
<common_name>
<loctext xml:lang='C'>
postfix SMTP mail transfer agent
</loctext>
</common_name>
<documentation>
<manpage title='postfix' section='1'
manpath='/usr/local/man' />
</documentation>
</template>
</instance>
<stability value='Unstable' />
</service>
</service_bundle>
# svccfg -v import smtp-postfix.xml
# svcadm enable postfix
終了行:
RIGHT:[[フリーソフトウェアのコンパイル]]
http://sy2920.s151.xrea.com/solaris/postfix-pkg.html
http://sy2920.s151.xrea.com/mail/smtpauth-dovecot_sasl.html
*sendmail のパッケージを消す [#ob175e77]
# cp /etc/aliases /var/tmp
# pkgrm SUNWsndmu
SUNWsndmu Sendmail (/usr)
(sparc) 11.10.0,REV=2005.01.21.15.53
このパッケージを削除しますか [y,n,?,q] y
## インストール済みパッケージインスタンス <SUNWsndmu> を...
## 大域ゾーン内でパッケージ <SUNWsndmu> の依存関係を検査...
## パッケージ情報を処理中です。
## クラス <none> 中のパス名を削除中です。
/usr/sbin/sendmail
/usr/sbin/newaliases
...
/usr <共有パス名は削除されません。>
## システム情報を更新中です。
<SUNWsndmu> の削除に成功しました。
# pkgrm SUNWsndmr
このパッケージを削除しますか [y,n,?,q] y
## インストール済みパッケージインスタンス <SUNWsndmr> を...
このパッケージには、パッケージの削除の処理中にスーパーユ...
ス権で実行されるスクリプトが含まれています。
このパッケージの削除処理を継続しますか [y,n,?,q] y
## 大域ゾーン内でパッケージ <SUNWsndmr> の依存関係を検査...
## パッケージ情報を処理中です。
## クラス <manifest> 中のパス名を削除中です。
...
/etc <共有パス名は削除されません。>
## システム情報を更新中です。
<SUNWsndmr> の削除に成功しました。
*Postfix [#c0207a15]
http://www.postfix-jp.info/trans-2.3/jhtml/INSTALL.html
% gtar xvzf ../src/postfix-2.6.2.tar.gz
% cd postfix-2.6.2/
Solaris のコンパイラを使う
% make makefiles CC=/opt/SUNWspro/bin/cc
BerkeleyDB を利用する
% make tidy
% make makefiles CCARGS="-DHAS_DB -I/usr/local/BerkeleyD...
AUXLIBS="-R/usr/local/BerkeleyDB/lib -L/usr/local/Be...
% make
Dovecot を利用する
% make makefiles CCARGS='-DUSE_SASL_AUTH -DDEF_SERVER_SA...
TLS を利用する
% make makefiles CCARGS="-DUSE_TLS -I/usr/local/include" \
AUXLIBS="-R/usr/local/lib -L/usr/local/lib -lssl -lcr...
すべて混ぜて
% unset LD_LIBRARY_PATH
% make makefiles CC=/opt/sunstudio12.1/bin/cc \
CCARGS='-DHAS_DB -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE...
AUXLIBS="-R/usr/local/BerkeleyDB.4.7/lib -R/usr/local/s...
% make
# groupadd -g 89 postfix
# groupadd -g 88 postdrop
# useradd -u 89 -g 89 -d /dev/null -s /bin/false postfix
# /usr/ccs/bin/make install
install_root: [/]
Please specify a directory for scratch files while insta...
You must have write permission in this directory.
tempdir: [/home/tanaka/build/postfix-2.6.2]
lease specify the final destination directory for instal...
configuration files.
config_directory: [/etc/postfix]
Please specify the final destination directory for insta...
administrative commands. This directory should be in the...
path of adminstrative users.
command_directory: [/usr/sbin]
Please specify the final destination directory for insta...
daemon programs. This directory should not be in the com...
path of any users.
daemon_directory: [/usr/libexec/postfix]
Please specify the final destination directory for Postf...
data files such as caches or random numbers. This direct...
be shared with non-Postfix software.
data_directory: [/var/lib/postfix
Please specify the destination directory for the Postfix...
Specify "no" if you do not want to install these files.
html_directory: [no]
Please specify the owner of the Postfix queue. Specify a...
numerical user ID and group ID values that are not used ...
accounts on the system.
mail_owner: [postfix]
Please specify the final destination pathname for the in...
mailq command. This is the Sendmail-compatible mail queu...
command.
mailq_path: [/usr/bin/mailq]
Please specify the destination directory for the Postfix...
pages. You can no longer specify "no" here.
manpage_directory: [/usr/local/man]
Please specify the final destination pathname for the in...
newaliases command. This is the Sendmail-compatible comm...
alias databases for the Postfix local delivery agent.
newaliases_path: [/usr/bin/newaliases]
Please specify the final destination directory for Postf...
queue_directory: [/var/spool/postfix]
Please specify the destination directory for the Postfix...
Specify "no" if you do not want to install these files.
readme_directory: [no]
Please specify the final destination pathname for the in...
sendmail command. This is the Sendmail-compatible mail p...
interface.
sendmail_path: [/usr/lib/sendmail]
Please specify the group for mail submission and for que...
commands. Specify a group name with a numerical group ID...
shared with other accounts, not even with the Postfix ma...
account. You can no longer specify "no" here.
setgid_group: [postdrop]
**/etc/services に以下の行を追加 [#j62db689]
ssmtp 465/tcp smtps # SMTP o...
**設定ファイルの編集 [#wb15bda9]
-/etc/postfix/main.cf
-/etc/postfix/master.cf
**起動スクリプト [#ce5f697a]
/lib/svc/method/postfix (実行権つける)
#!/sbin/sh
# rc script for postfix
PROG=/usr/sbin/postfix
SERVICE=`basename $PROG`
ECHO=/usr/ucb/echo
case "$1" in
start)
$ECHO -n "starting $SERVICE ... "
$PROG start && $ECHO "[ OK ]" || $ECHO "[ NG ]"
;;
stop)
$ECHO -n "stopping $SERVICE ... "
$PROG stop && $ECHO "[ OK ]" || $ECHO "[ NG ]"
;;
restart)
$0 stop
sleep 3
$0 start
;;
reload|refresh)
$ECHO -n "refreshing $SERVICE ... "
$PROG reload && $ECHO "[ OK ]" || $ECHO "[ NG ]"
;;
*)
echo "Usage: $0 { start | stop | restart | refresh }"
exit 1
;;
esac
exit 0
**マニフェスト [#b96bda09]
/var/svc/manifest/network/smtp-postfix.xml
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/...
<!--
Copyright 2004 Sun Microsystems, Inc. All rights reserv...
Use is subject to license terms.
-->
<service_bundle type='manifest' name='postfix'>
<service
name='network/smtp'
type='service'
version='1'>
<single_instance />
<dependency
name='fs-local'
grouping='require_all'
restart_on='none'
type='service'>
<service_fmri value='svc:/system/filesystem/local' />
</dependency>
<dependency
name='network-service'
grouping='require_all'
restart_on='none'
type='service'>
<service_fmri value='svc:/network/service' />
</dependency>
<dependency
name='name-services'
grouping='require_all'
restart_on='refresh'
type='service'>
<service_fmri value='svc:/milestone/name-services' />
</dependency>
<dependency
name='identity'
grouping='optional_all'
restart_on='refresh'
type='service'>
<service_fmri value='svc:/system/identity:domain' />
</dependency>
<dependency
name='system-log'
grouping='optional_all'
restart_on='none'
type='service'>
<service_fmri value='svc:/system/system-log' />
</dependency>
<instance name='postfix' enabled='false'>
<dependency
name='config-file'
grouping='require_all'
restart_on='refresh'
type='path'>
<service_fmri
value='file://localhost/etc/postfix/main.cf' />
</dependency>
<dependency
name='nsswitch'
grouping='require_all'
restart_on='refresh'
type='path'>
<service_fmri
value='file://localhost/etc/nsswitch.conf' />
</dependency>
<!--
If autofs is enabled, wait for it to get users' home
directories.
-->
<dependency
name='autofs'
grouping='optional_all'
restart_on='none'
type='service'>
<service_fmri value='svc:/system/filesystem/autofs' />
</dependency>
<dependent
name='smtp-sendmail_multi-user'
grouping='optional_all'
restart_on='none'>
<service_fmri
value='svc:/milestone/multi-user' />
</dependent>
<exec_method
type='method'
name='start'
exec='/lib/svc/method/postfix start'
timeout_seconds='120' />
<exec_method
type='method'
name='stop'
exec='/lib/svc/method/postfix stop'
timeout_seconds='60' />
<exec_method
type='method'
name='refresh'
exec='/lib/svc/method/postfix reload'
timeout_seconds='60' />
<property_group name='startd' type='framework'>
<propval name='ignore_error' type='astring'
value='core,signal' />
</property_group>
<property_group name='general' type='framework'>
<propval name='action_authorization' type='astring'
value='solaris.smf.manage.postfix' />
</property_group>
<template>
<common_name>
<loctext xml:lang='C'>
postfix SMTP mail transfer agent
</loctext>
</common_name>
<documentation>
<manpage title='postfix' section='1'
manpath='/usr/local/man' />
</documentation>
</template>
</instance>
<stability value='Unstable' />
</service>
</service_bundle>
# svccfg -v import smtp-postfix.xml
# svcadm enable postfix
ページ名: