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

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

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

IMAP (Internet Message Access Protocol) とは、メールサーバー上の電子メールデータを操作するためのプロトコルです。

Dovecot

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

Postfix

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

Q&A

1回答

4770閲覧

WEBメールでIAMP接続が出来ない

tk_flavor

総合スコア104

IMAP

IMAP (Internet Message Access Protocol) とは、メールサーバー上の電子メールデータを操作するためのプロトコルです。

Dovecot

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

Postfix

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

0グッド

0クリップ

投稿2019/03/08 17:07

編集2019/03/08 22:25

現在、Postfix + Dovecot によるメールサーバを作り直しています。
既存メールサーバから移行したOSシステムアカウントを新規メールサーバへ置き換えて
移行してきたアカウントでpop3、pop3sでメール受信出来るまでの動きを確認しています。

そして、既存メールサーバにはSquirrelMailのWEBメールも使われています。
新メールサーバにSquirrelMailを入れてブラウザからアクセスし、メールアカウント情報を入力すると接続タイムアウトとなります。
また、rainloopを導入しまして、ブラウザからメールアカウント情報を入力してみましたがAuthenticatin failedとなります。

イメージ説明
イメージ説明

■移行先メールサーバのWEBメールのIMAP接続ログ

Mar 08 18:17:02 auth: Debug: client passdb out: FAIL 1 user=testuser01@example.co.jp Mar 08 18:17:02 imap-login: Info: Disconnected (auth failed, 1 attempts in 4 secs): user=<testuser01@example.co.jp>, method=PLAIN, rip=**.**.**.**, lip=**.**.**.**, secured, session=<GY>

■移行元の既存メールサーバのWEBメールのIMAP接続ログ

Mar 8 16:48:15 oldtest dovecot: imap-login: Login: user=<mail_test>, method=PLAIN, rip=::1, lip=::1, mpid=5431, secured Mar 8 16:48:15 oldtest dovecot: imap(mail_test): Disconnected: Logged out bytes=44/697 Mar 8 16:48:15 oldtest dovecot: imap-login: Login: user=<mail_test>, method=PLAIN, rip=::1, lip=::1, mpid=5433, secured Mar 8 16:48:15 oldtest dovecot: imap(mail_test): Disconnected: Logged out bytes=357/1588

IMAPのポートは稼動しており、
143ポートはiptablesで許可設定を入れています。
telnet localhost 143でアカウント/パスワードを入力すると下記のようなエラーとなりました

[root@newtest ~]# lsof -i:143 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME dovecot 122000 root 37u IPv4 8383772 0t0 TCP *:imap (LISTEN)

新メールサーバのdovecotでtelnet localhost 143するとBYE Internal error occurredで弾かれてしまいます

[root@newtest conf.d]# telnet localhost 143 Trying ::1... telnet: connect to address ::1: Connection refused Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN AUTH=LOGIN] Dovecot ready. 1 login testuser01 password * BYE Internal error occurred. Refer to server log for more information. Connection closed by foreign host.

既存の移行元メールサーバでtelnet localhost 143 すると接続出来ます

[root@oldtest ~]# telnet localhost 143 Trying ::1... Connected to localhost. Escape character is '^]'. * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN AUTH=LOGIN] Dovecot ready. 1 login testuser01 password 1 OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS] Logged in

■dovecot.confにはimap接続許可設定は入れています

protocols = imap pop3 lmtp

既存メールサーバと新メールサーバのdovecot -n実行結果です

■移行先新メールサーバ

[root@newtest ~]# dovecot -n # 2.2.36 (1f10bfa63): /etc/dovecot/dovecot.conf # OS: Linux 3.10.0-862.14.4.el7.x86_64 x86_64 CentOS Linux release 7.5.1804 (Core) # Hostname: newtest.exmple.co.jp auth_debug = yes auth_mechanisms = plain login auth_verbose = yes disable_plaintext_auth = no first_valid_uid = 3000 listen = * log_path = /var/log/dovecot/dovecot.log mail_location = maildir:~/Maildir mbox_write_locks = fcntl namespace inbox { inbox = yes location = mailbox Drafts { special_use = \Drafts } mailbox Junk { special_use = \Junk } mailbox Sent { special_use = \Sent } mailbox "Sent Messages" { special_use = \Sent } mailbox Trash { special_use = \Trash } prefix = } passdb { driver = pam } ssl_cert = </etc/pki/tls/certs/wildcard.example.co.jp.pem ssl_key = # hidden, use -P to show it userdb { driver = passwd }

■移行元メールサーバ

[root@oldtest ~]# dovecot –n # 2.0.9: /etc/dovecot/dovecot.conf # OS: Linux 2.6.32-696.18.7.el6.x86_64 x86_64 CentOS release 6.9 (Final) auth_mechanisms = plain login disable_plaintext_auth = no mail_location = maildir:~/Maildir managesieve_notify_capability = mailto managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date mbox_write_locks = fcntl passdb { driver = pam } plugin { sieve = ~/.dovecot.sieve sieve_dir = ~/sieve } service auth { unix_listener /var/spool/postfix/private/auth { group = postfix mode = 0666 user = postfix } } ssl_cert = </etc/pki/tls/certs/mail.pem ssl_key = </etc/pki/tls/certs/mail.pem userdb { driver = passwd }

既存と新メールサーバのpostfix設定値です

■移行先新メールサーバ

[root@newtest ~]# /usr/sbin/postconf -n alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases allow_min_user = yes bounce_queue_lifetime = 24h command_directory = /usr/sbin config_directory = /etc/postfix content_filter = smtp-amavis:[127.0.0.1]:10024 daemon_directory = /usr/libexec/postfix/ data_directory = /var/lib/postfix debug_peer_level = 2 debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5 disable_vrfy_command = yes home_mailbox = Maildir/ html_directory = no inet_interfaces = all inet_protocols = all mail_owner = postfix mailbox_size_limit = 512000000 mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man maximal_backoff_time = 600s maximal_queue_lifetime = 24h message_size_limit = 327680000 minimal_backoff_time = 100s mydestination = $myhostname, localhost.$mydomain, localhost mydomain = newmail.example.co.jp myhostname = newmail.example.co.jp mynetworks = 192.169.1.0/24 , 192.168.33.0/24 , 192.168.0.0/24 myorigin = $mydomain newaliases_path = /usr/bin/newaliases.postfix queue_directory = /var/spool/postfix queue_run_delay = 100s readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES sample_directory = /usr/share/doc/postfix-2.10.1/samples sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop smtpd_banner = $myhostname ESMTP unknown smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination smtpd_sasl_auth_enable = yes smtpd_sasl_local_domain = $myhostname smtpd_tls_cert_file = /etc/pki/tls/certs/wildcard.example.co.jp.crt smtpd_tls_key_file = /etc/pki/tls/certs/wildcard.example.co.jp.pem smtpd_tls_session_cache_database = btree:/etc/postfix/smtpd_scache smtpd_use_tls = yes transport_maps = hash:/etc/postfix/transport unknown_local_recipient_reject_code = 550

■移行元既存メールサーバ

[root@oldtest ~]# /usr/sbin/postconf -n alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases, hash:/etc/mailman/aliases command_directory = /usr/sbin config_directory = /etc/postfix content_filter = smtp-amavis:[127.0.0.1]:10024 daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix debug_peer_level = 2 home_mailbox = Maildir/ html_directory = no inet_interfaces = all inet_protocols = all mail_owner = postfix mailbox_size_limit = 512000000 mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man message_size_limit = 327680000 mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain mydomain = oldmail.example.co.jp myhostname = oldmail.example.co.jp myorigin = $mydomain newaliases_path = /usr/bin/newaliases.postfix queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES sample_directory = /usr/share/doc/postfix-2.6.6/samples sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop smtpd_banner = $myhostname ESMTP unknown smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination smtpd_sasl_auth_enable = yes smtpd_sasl_local_domain = $myhostname smtpd_tls_cert_file = /etc/pki/tls/certs/mail.pem smtpd_tls_key_file = /etc/pki/tls/certs/mail.pem smtpd_tls_session_cache_database = btree:/etc/postfix/smtpd_scache smtpd_use_tls = yes unknown_local_recipient_reject_code = 550 [root@oldtest ~]#

/etc/pam.d/dovecotファイルは新旧メールサーバとも同じ設定となっています

#%PAM-1.0 auth required pam_nologin.so auth include password-auth account include password-auth session include password-auth

localhostからもimap接続が出来ませんし、
WEBメールからも接続が出来ない状態ですが
IMAP接続を有効にさせるにはどのようにすればいいのでしょうか

ご教示頂けますと幸いです。

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

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

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

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

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

scsi

2019/03/08 19:12

Maillogに何か出力されてませんか?
tk_flavor

2019/03/08 22:28

お世話になっております。 ログについて、下記のように出ています。 client passdb out: FAIL auth failed, がキーワードかなと思って調査していましたが、なかなか解決方法がわかりませんでした。 ■移行先の既存メールサーバのWEBメールのIMAP接続ログ Mar 08 18:17:02 auth: Debug: client passdb out: FAIL 1 user=testuser01@example.co.jp Mar 08 18:17:02 imap-login: Info: Disconnected (auth failed, 1 attempts in 4 secs): user=<testuser01@example.co.jp>, method=PLAIN, rip=**.**.**.**, lip=**.**.**.**, secured, session=<GY> ■移行元の既存メールサーバのWEBメールのIMAP接続ログ Mar 8 16:48:15 oldtest dovecot: imap-login: Login: user=<mail_test>, method=PLAIN, rip=::1, lip=::1, mpid=5433, secured Mar 8 16:48:15 oldtest dovecot: imap(mail_test): Disconnected: Logged out bytes=357/1588
tk_flavor

2019/03/08 22:48

お世話になっております 新メールサーバのdovecotでtelnet localhost 143するとBYE Internal error occurredで 弾かれる状況となっています。
scsi

2019/03/08 23:22

謎ですね~
guest

回答1

0

IMAPで認証ができていないように見受けられます
vi /etc/dovecot/conf.d/10-logging.conf
の設定を詳しくしといてもう一度トライしてみたらわかるかもしれません。

auth_verbose = yes
auth_debug = yes
auth_debug_passwords = yes
mail_debug = yes

ちなみにこう書くとどうでしょうか?
10-master.conf

unix_listener auth-userdb { #mode = 0666 #user = #group = }

投稿2019/03/22 04:00

編集2019/03/22 04:21
Perfume-T-Anata

総合スコア25

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

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

tk_flavor

2019/03/22 04:18

ご回答ありがとうございます Webメールツールのrainloopの接続画面で 短いログイン名を使うにチェックを入れるとimap接続出来ました。 ツールの使い方のようでした。 お手数お掛けしました
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問