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

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

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

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

Dovecot

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

Ubuntu

Ubuntuは、Debian GNU/Linuxを基盤としたフリーのオペレーティングシステムです。

Postfix

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

Q&A

解決済

1回答

3272閲覧

ローカルネットワーク内のメールサーバー

Feynman

総合スコア19

IMAP

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

Dovecot

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

Ubuntu

Ubuntuは、Debian GNU/Linuxを基盤としたフリーのオペレーティングシステムです。

Postfix

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

0グッド

0クリップ

投稿2016/08/01 08:42

編集2016/08/02 00:49

Ubuntu14.04でローカルネットワーク内だけで動くメールサーバーを作りたいのですが、うまくいきません。

postfixとdovecotをインストールて、localhostでのメール送受信はうまくいくのですが、
ネットワークの他のPCからポート143などにアクセスできません。
postfix/main.cfの設定は以下のとおり

main.cf

1 smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) 2 biff = yes 3 4 # appending .domain is the MUA's job. 5 #append_dot_mydomain = no 6 mydomain = example.local 7 8 # Uncomment the next line to generate "delayed mail" warnings 9 #delay_warning_time = 4h 10 11 readme_directory = no 12 13 # TLS parameters 14 smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem 15 smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key 16 smtpd_use_tls=yes 17 smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache 18 smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache 19 20 # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for 21 # information on enabling SSL in the smtp client. 22 23 smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination 24 myhostname = Notice 25 alias_maps = hash:/etc/aliases 26 alias_database = hash:/etc/aliases 27 mydestination = Notice, localhost.localdomain, localhost, example.local 28 relayhost = 29 mynetworks = localhost, 192.168.11.0/24 30 mailbox_size_limit = 0 31 recipient_delimiter = + 32 inet_interfaces = all 33 default_transport = error 34 relay_transport = error 35 home_mailbox = Maildir/

/etc/dovecot/dovecot.conf

dovecot.conf

1 !include_try /usr/share/dovecot/protocols.d/*.protocol 2 listen = * 3 login_trusted_networks = 192.168.0.0/24 4 dict { 5 } 6 !include conf.d/*.conf 7 !include_try local.conf

このサイトを参考にしましたが、
telnet localhost 143はうまくいくのですが、
他のPCから telnet <IPADDRESS> 143は動きませんでした。

netstat では以下の様子が見られます。

netstat

1tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 2tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 3tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN

お助けください。

-----追記-----
皆様ありがとうございます。

IPアドレスは固定されています。
メールサーバにしたいマシンへの
sshやping, Webサーバ, ntpのアクセスはできています。

iptablesの結果は長すぎて追記できないので一部だけですが。

iptables

1Chain ufw-after-input (1 references) 2target prot opt source destination 3ufw-skip-to-policy-input udp -- anywhere anywhere udp dpt:netbios-ns 4ufw-skip-to-policy-input udp -- anywhere anywhere udp dpt:netbios-dgm 5ufw-skip-to-policy-input tcp -- anywhere anywhere tcp dpt:netbios-ssn 6ufw-skip-to-policy-input tcp -- anywhere anywhere tcp dpt:microsoft-ds 7ufw-skip-to-policy-input udp -- anywhere anywhere udp dpt:bootps 8ufw-skip-to-policy-input udp -- anywhere anywhere udp dpt:bootpc 9ufw-skip-to-policy-input all -- anywhere anywhere ADDRTYPE match dst-type BROADCAST 10 11Chain ufw-before-forward (1 references) 12target prot opt source destination 13ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED 14ACCEPT icmp -- anywhere anywhere icmp destination-unreachable 15ACCEPT icmp -- anywhere anywhere icmp source-quench 16ACCEPT icmp -- anywhere anywhere icmp time-exceeded 17ACCEPT icmp -- anywhere anywhere icmp parameter-problem 18ACCEPT icmp -- anywhere anywhere icmp echo-request 19ufw-user-forward all -- anywhere anywhere 20 21Chain ufw-before-input (1 references) 22target prot opt source destination 23ACCEPT all -- anywhere anywhere 24ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED 25ufw-logging-deny all -- anywhere anywhere ctstate INVALID 26DROP all -- anywhere anywhere ctstate INVALID 27ACCEPT icmp -- anywhere anywhere icmp destination-unreachable 28ACCEPT icmp -- anywhere anywhere icmp source-quench 29ACCEPT icmp -- anywhere anywhere icmp time-exceeded 30ACCEPT icmp -- anywhere anywhere icmp parameter-problem 31ACCEPT icmp -- anywhere anywhere icmp echo-request 32ACCEPT udp -- anywhere anywhere udp spt:bootps dpt:bootpc 33ufw-not-local all -- anywhere anywhere 34ACCEPT udp -- anywhere 224.0.0.251 udp dpt:mdns 35ACCEPT udp -- anywhere 239.255.255.250 udp dpt:1900 36ufw-user-input all -- anywhere anywhere 37 38Chain ufw-user-input (1 references) 39target prot opt source destination 40ACCEPT tcp -- anywhere anywhere tcp dpt:ntp 41ACCEPT udp -- anywhere anywhere udp dpt:ntp 42ACCEPT tcp -- anywhere anywhere tcp dpt:http 43ACCEPT udp -- anywhere anywhere udp dpt:http 44ACCEPT tcp -- anywhere anywhere tcp dpt:domain 45ACCEPT udp -- anywhere anywhere udp dpt:domain 46ACCEPT tcp -- anywhere anywhere tcp dpt:domain 47ACCEPT udp -- anywhere anywhere udp dpt:domain 48ACCEPT tcp -- anywhere anywhere tcp dpt:ssh 49ACCEPT udp -- anywhere anywhere udp dpt:ssh 50ACCEPT tcp -- anywhere anywhere tcp dpt:ssh 51ACCEPT udp -- anywhere anywhere udp dpt:ntp 52 53Chain ufw-user-output (1 references) 54target prot opt source destination 55ACCEPT tcp -- anywhere anywhere tcp dpt:domain 56ACCEPT udp -- anywhere anywhere udp dpt:domain 57ACCEPT tcp -- anywhere anywhere tcp dpt:ntp 58ACCEPT udp -- anywhere anywhere udp dpt:ntp

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

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

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

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

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

tanat

2016/08/01 09:28

ネットワーク上の他のPCからTCP143以外(例えばTCP22(ssh)やping)でのアクセスは出来ている状態でしょうか?
tanat

2016/08/01 09:29

sudo iptables -L とコマンドを打つとどう表示されますか?
coco_bauer

2016/08/01 14:08

メールサーバを稼働させているマシンのIPアドレスは、どのようにして決めていますか? DHCPだとIPアドレスが一定しませんよ。 また、ファイアウォールで他のマシンからのアクセスをブロックしたりしていませんか? 確認してください。
guest

回答1

0

自己解決

ポートが外部に開いていなかったみたいですね。
netstatを見ただけで満足していました。。。
Ubuntu14.04ですので

ufw allow 25/tcp ufw allow 110,143/tcp ufw allow 995,993/tcp ```を実行することで動作しました。 ありがとうございました。

投稿2016/08/02 01:36

Feynman

総合スコア19

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問