Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
2
Help us understand the problem. What is going on with this article?
@launcher_test

Amazon LinuxでPostfix/PostgreSQLを用いたPostfixAdmin構築

More than 5 years have passed since last update.

Amazon LinuxでPostfixを用いたPostfixAdmin構築ログ

インストール パッチ適用

Amazon LinuxのPostfix RPMはPostgreSQLを組み込まれてないので
src-rpmでビルドする。

  • 停止
    $ sudo /etc/init.d/postfix stop

  • 削除
    $ sudo rpm -e postfix

  • SRPM取得
    ※amazon linuxのrpm取得方法はその都度確認
    $ get_reference_source -d -p postfix

  • specファイル編集
    $ cd /usr/src/srpm/debug
    $ sudo rpm -ivh postfix-2.6.6-2.14.amzn1.src.rpm
    $ su -

    # cd /root/rpmbuild/SPECS
    # cp -p postfix.spec postfix.spec.date +%Y%m%d
    # vim postfix.spec
    # diff postfix.spec postfix.spec.date +%Y%m%d
    3,4c3,4
    < %{?!MYSQL: %define MYSQL 0}
    < %{?!PGSQL: %define PGSQL 1}
    ---
    > %{?!MYSQL: %define MYSQL 1}
    > %{?!PGSQL: %define PGSQL 0} `

# yum install rpm-build
# yum install dovecot dovecot-pgsql php httpd postgresql-server postgresql-libs postgresql-devel openldap-devel cyrus-sasl-devel pcre-devel db4-devel zlib-devel openssl-devel

  • パッチ適用

# cd ../SOURCES/
# wget http://patches.netspiders.net/postfix/postfix-2.6.6-linux3.patch
# cd ../SPECS/
# wget http://patches.netspiders.net/postfix/postfix-2.6.6-linux3.spec.patch
# patch -p0 < postfix-2.6.6-linux3.spec.patch

  • ビルド
    # rpmbuild -ba postfix.spec

  • インストール
    # cd /root/rpmbuild/RPMS/x86_64
    # rpm -ivh postfix-2.6.6-2.14.amzn1.x86_64.rpm

  • pgsqlモジュール確認
    # postconf -m

あとはmysqlの連携と変わらず。

備考

  • PostfixAdmin使用時のmain.cf例

# Postfix admin settings
local_transport = local
virtual_transport = virtual
virtual_mailbox_base = /home/mailuser
virtual_alias_maps = pgsql:/etc/postfix/pgsql_virtual_alias_maps.cf
virtual_alias_domains = $virtual_alias_maps
virtual_mailbox_domains = pgsql:/etc/postfix/pgsql_virtual_domains_maps.cf
virtual_mailbox_maps = pgsql:/etc/postfix/pgsql_virtual_mailbox_maps.cf
virtual_minimum_uid = 5000
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000

2
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
2
Help us understand the problem. What is going on with this article?