質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
SASL

SASLは、コネクションベースのプロトコルにおける認証サポートの追加や、データセキュリティのためのフレームワーク。既存のライブラリ・仕組みを再利用することが可能で,ユーザーに対しチャレンジ・レスポンス認証といった安全な認証方式を提供できます。

Dovecot

Dovecotとは、POPやIMAPサーバーを提供するMDA(メール配送エージェント)の一つです。

CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

MySQL

MySQL(マイエスキューエル)は、TCX DataKonsultAB社などが開発するRDBMS(リレーショナルデータベースの管理システム)です。世界で最も人気の高いシステムで、オープンソースで開発されています。MySQLデータベースサーバは、高速性と信頼性があり、Linux、UNIX、Windowsなどの複数のプラットフォームで動作することができます。

Postfix

Postfixは、電子メールサーバソフトウェアで、 メールを配送するシステムMTAの一種です。

Q&A

解決済

1回答

6165閲覧

postfixadminでmysqlに接続ができません。

退会済みユーザー

退会済みユーザー

総合スコア0

SASL

SASLは、コネクションベースのプロトコルにおける認証サポートの追加や、データセキュリティのためのフレームワーク。既存のライブラリ・仕組みを再利用することが可能で,ユーザーに対しチャレンジ・レスポンス認証といった安全な認証方式を提供できます。

Dovecot

Dovecotとは、POPやIMAPサーバーを提供するMDA(メール配送エージェント)の一つです。

CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

MySQL

MySQL(マイエスキューエル)は、TCX DataKonsultAB社などが開発するRDBMS(リレーショナルデータベースの管理システム)です。世界で最も人気の高いシステムで、オープンソースで開発されています。MySQLデータベースサーバは、高速性と信頼性があり、Linux、UNIX、Windowsなどの複数のプラットフォームで動作することができます。

Postfix

Postfixは、電子メールサーバソフトウェアで、 メールを配送するシステムMTAの一種です。

0グッド

0クリップ

投稿2017/07/21 07:08

###前提・実現したいこと
用意した独自ドメインをoriginaldomain.co.jpとし、さくらのVPS上に立てたCentOS7にpostfix,dovecot,postfixadminを導入したいです。
hoge@originaldomain.co.jpでのメール送受信及び、postfixadminによるメールアカウントの管理が目的です。

###発生している問題・エラーメッセージ
postfixAdmin導入前まではtelnetからsmtpコマンドを発行し、メールが遅れておりましたが、postfixadmin導入後からうまくいかなくなりました。
mysqlへの接続周りで失敗しているようですが、どこの箇所でエラーが出ているのかが不明です。

2017-07-21T06:34:11.066081Z 33 [Note] Access denied for user 'postfix'@'localhost' (using password: YES)

上記はpostfixadmin/login.phpへアクセスし、ユーザー名とパスワードを送信した直後のmysql.logです。
また、画面上も上記同様のエラーログを吐いています(php.iniによる表示)

加えて、postfixadmin及び、smtpコマンドのどちらから送信した場合でも以下のようなログがmail.logに記載されます

ul 21 15:06:00 mail postfix/proxymap[2357]: warning: connect to mysql server localhost: Access denied for user 'postfix'@'localhost' (using password: YES) Jul 21 15:06:00 mail postfix/trivial-rewrite[2362]: warning: proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_maps.cf: table lookup problem Jul 21 15:06:00 mail postfix/trivial-rewrite[2362]: warning: virtual_alias_domains lookup failure Jul 21 15:06:15 mail postfix/trivial-rewrite[2362]: warning: proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_maps.cf: table lookup problem Jul 21 15:06:15 mail postfix/trivial-rewrite[2362]: warning: virtual_alias_domains lookup failure Jul 21 15:06:15 mail postfix/smtpd[2356]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 451 4.3.0 <atesaki@domain.jp>: Temporary lookup failure; from=<admin@original.domain> to=<atesaki@domain.jp> proto=SMTP Jul 21 15:11:15 mail postfix/smtpd[2356]: timeout after RCPT from localhost[127.0.0.1]

###該当のソースコード
以下はmain.cfです 不必要に見える部分は削除いたしました。

#soft_bounce = no queue_directory = /var/spool/postfix command_directory = /usr/sbi daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix mail_owner = postfix myhostname = host.originaldomain.co.jp mydomain = originaldomain.co.jp myorigin = $mydomain #recieve interface. all means contain inner mail. forexample cron to root inet_interfaces = all # Enable IPv4, and IPv6 if supported inet_protocols = ipv4 mydestination = $myhostname, localhost.$mydomain, localhost, #mydomain #mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain #mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, # mail.$mydomain, www.$mydomain, ftp.$mydomain # REJECTING MAIL FOR UNKNOWN LOCAL USERS # # The local_recipient_maps parameter specifies optional lookup tables # with all names or addresses of users that are local with respect # to $mydestination, $inet_interfaces or $proxy_interfaces. # # If this parameter is defined, then the SMTP server will reject # mail for unknown local users. This parameter is defined by default. # # To turn off local recipient checking in the SMTP server, specify # local_recipient_maps = (i.e. empty). # # The default setting assumes that you use the default Postfix local # delivery agent for local delivery. You need to update the # local_recipient_maps setting if: # # - You define $mydestination domain recipients in files other than # /etc/passwd, /etc/aliases, or the $virtual_alias_maps files. # For example, you define $mydestination domain recipients in # the $virtual_mailbox_maps files. # # - You redefine the local delivery agent in master.cf. # # - You redefine the "local_transport" setting in main.cf. # # - You use the "luser_relay", "mailbox_transport", or "fallback_transport" # feature of the Postfix local delivery agent (see local(8)). # # Details are described in the LOCAL_RECIPIENT_README file. # # Beware: if the Postfix SMTP server runs chrooted, you probably have # to access the passwd file via the proxymap service, in order to # overcome chroot restrictions. The alternative, having a copy of # the system passwd file in the chroot jail is just not practical. # # The right-hand side of the lookup tables is conveniently ignored. # In the left-hand side, specify a bare username, an @domain.tld # wild-card, or specify a user@domain.tld address. # #local_recipient_maps = unix:passwd.byname $alias_maps #local_recipient_maps = proxy:unix:passwd.byname $alias_maps #local_recipient_maps = # The unknown_local_recipient_reject_code specifies the SMTP server # response code when a recipient domain matches $mydestination or # ${proxy,inet}_interfaces, while $local_recipient_maps is non-empty # and the recipient address or address local-part is not found. # # The default setting is 550 (reject mail) but it is safer to start # with 450 (try again later) until you are certain that your # local_recipient_maps settings are OK. # unknown_local_recipient_reject_code = 550 # Alternatively, you can specify the mynetworks list by hand, in # which case Postfix ignores the mynetworks_style setting. # # Specify an explicit list of network/netmask patterns, where the # mask specifies the number of bits in the network part of a host # address. # # You can also specify the absolute pathname of a pattern file instead # of listing the patterns here. Specify type:table for table-based lookups # (the value on the table right-hand side is not used). # #mynetworks = 168.100.189.0/28, 127.0.0.0/8 #mynetworks = $config_directory/mynetworks #mynetworks = hash:/etc/postfix/network_table mynetworks = さくらのvpsIPv4 #relay_domains = $mydestination #relayhost = $mydomain #relayhost = [gateway.my.domain] #relayhost = [mailserver.isp.tld] #relayhost = uucphost #relayhost = [an.ip.add.ress] #relay_recipient_maps = hash:/etc/postfix/relay_recipients # INPUT RATE CONTROL # # The in_flow_delay configuration parameter implements mail input # flow control. This feature is turned on by default, although it # still needs further development (it's disabled on SCO UNIX due # to an SCO bug). # # A Postfix process will pause for $in_flow_delay seconds before # accepting a new message, when the message arrival rate exceeds the # message delivery rate. With the default 100 SMTP server process # limit, this limits the mail inflow to 100 messages a second more # than the number of messages delivered per second. # # Specify 0 to disable the feature. Valid delays are 0..10. # #in_flow_delay = 1s # ADDRESS REWRITING # # The ADDRESS_REWRITING_README document gives information about # address masquerading or other forms of address rewriting including # username->Firstname.Lastname mapping. # ADDRESS REDIRECTION (VIRTUAL DOMAIN) # # The VIRTUAL_README document gives information about the many forms # of domain hosting that Postfix supports. # "USER HAS MOVED" BOUNCE MESSAGES # # See the discussion in the ADDRESS_REWRITING_README document. #alias_maps = dbm:/etc/aliases alias_maps = hash:/etc/aliases #alias_maps = hash:/etc/aliases, nis:mail.aliases #alias_maps = netinfo:/aliases #alias_database = dbm:/etc/aliases #alias_database = dbm:/etc/mail/aliases alias_database = hash:/etc/aliases #alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases smtpd_banner = $myhostname ESMTP unknown debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5 sendmail_path = /usr/sbin/sendmail.postfix newaliases_path = /usr/bin/newaliases.postfix mailq_path = /usr/bin/mailq.postfix setgid_group = postdrop html_directory = no manpage_directory = /usr/share/man sample_directory = /usr/share/doc/postfix-2.10.1/samples # readme_directory: The location of the Postfix README files. readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES mynetworks_style = host #add sasl-AuthenticationSystem #this cofiglation is added for SMTP-AUTH smtpd_sasl_auth_enable = yes smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination #msg size config #def 20MB message_size_limit = 20971520 #delete unknown user mail local_recipient_maps = luser_relay = unknown_user@localhost #Virtual mailbox virtual_mailbox_base = /var/spool/virtual virtual_minimum_uid = 100 virtual_uid_maps = static:10000 virtual_gid_maps = static:10000 # mailaddress info virtual_mailbox_domains = proxy:mysql:/etc/postfix/sql/mysql_virtual_domains_maps.cf virtual_alias_maps = proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_maps.cf, proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_maps.cf, proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_catchall_maps.cf virtual_mailbox_maps = proxy:mysql:/etc/postfix/sql/mysql_virtual_mailbox_maps.cf, proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_mailbox_maps.cf #quota config virtual_create_maildirsize = yes virtual_mailbox_extended = yes virtual_mailbox_limit_maps = mysql:/etc/postfix/sql/mysql_virtual_mailbox_limit_maps.cf virtual_mailbox_limit_override = yes virtual_maildir_limit_message = Sorry, the user's maildir has overdrawn his diskspace quota, please try again later. virtual_overquota_bounce = yes

###試したこと
現在気になっているのはバーチャルドメイン周りのことで、
実際に使用したいドメインは他社で取得したドメインで、postfixadmin自体は
正規ドメインでのメールにそもそもどう対応しているのかを理解しておりません。

mysqlへの接続は手動ではうまくいっております。

###補足情報(言語/FW/ツール等のバージョンなど)
redhat-release 7.3.1611
postfix 2.10.1
dovecot 2.2.10
Apache 2.4.6
PostfixAdmin 3.0
saslauthd 2.1.26
php 5.4.16
mysqld 5.7.19 Community Server(GPL)

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

postfixadmin/config.inc.phpにconfig.locl.phpで設定したsqlのパスワードが反映されておらず、エラーになっていました。
手で直接書いて解決しました。

投稿2017/07/21 08:02

退会済みユーザー

退会済みユーザー

総合スコア0

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問