ksaitoの日記

日々試したことの覚え書き

ubuntuのメール環境

移転しました。

自動的にリダイレクトします。

メール環境を設定をセットアップする必要があり、Ubuntuのメール環境について調べました。
Debianのメールサーバはexim4が標準です。
Ubuntuは、SMTPサーバにPostfixPOP3, IMAPサーバにdovecotが使われています。
dovecot(ハト小屋)は、デフォルトでは、平文の認証を受け付けません。
テストのためにtelnetから手動でログインしたかったので、一時的に平文の認証を受け付けるように設定しました。

dovecotのセットアップ

プロトコルPOP3を使う場合は、dovecot-pop3dを、IMAPを使う場合は、dovecot-imapdをインストールします。

$ sudo apt-get install dovecot-pop3d dovecot-imapd

telnetで接続

デフォルト設定のまま、telnetで接続すると平文での接続はできな

$ telnet 10.10.10.10 pop3
Trying 10.10.10.10 ...
Connected to 10.10.10.10.
Escape character is '^]'.
+OK Dovecot ready.
USER test
-ERR Plaintext authentication disallowed on non-secure (SSL/TLS) connections.
quit
+OK Logging out
Connection closed by foreign host.
$

設定変更

/etc/dovecot/dovecot-postfix.confのdisable_plaintext_authとssl_disableの2つの設定を下記のように平文の認証を受け入れる設定にします。

$ sudo hg diff
diff -r 1760750fd95e dovecot/dovecot-postfix.conf
--- a/dovecot/dovecot-postfix.conf      Sat Mar 27 23:18:00 2010 +0900
+++ b/dovecot/dovecot-postfix.conf      Sat Mar 27 23:33:23 2010 +0900
@@ -60,7 +60,7 @@
 # SSL/TLS is used (LOGINDISABLED capability). Note that if the remote IP
 # matches the local IP (ie. you're connecting from the same computer), the
 # connection is considered secure and plaintext authentication is allowed.
-disable_plaintext_auth = yes
+disable_plaintext_auth = no
 
 # Should all IMAP and POP3 processes be killed when Dovecot master process
 # shuts down. Setting this to "no" means that Dovecot can be upgraded without
@@ -102,7 +102,7 @@
 #ssl_listen =
 
 # Disable SSL/TLS support. <doc/wiki/SSL>
-ssl_disable = no
+ssl_disable = yes
 
 # PEM encoded X.509 SSL/TLS certificate and private key. They're opened before
 # dropping root privileges, so keep the key file unreadable by anyone but
$ 

接続テスト

$ telnet 10.10.10.10 pop3
Trying 10.10.10.10...
Connected to 10.10.10.10.
Escape character is '^]'.
+OK Dovecot ready.
USER test
+OK
PASS password
+OK Logged in.
quit
+OK Logging out.
Connection closed by foreign host.
$