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

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

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

Linuxは、Unixをベースにして開発されたオペレーティングシステムです。日本では「リナックス」と呼ばれています。 主にWebサーバやDNSサーバ、イントラネットなどのサーバ用OSとして利用されています。 上位500のスーパーコンピュータの90%以上はLinuxを使用しています。 携帯端末用のプラットフォームAndroidは、Linuxカーネル上に構築されています。

Postfix

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

Q&A

解決済

1回答

2087閲覧

postfixでのメールサーバー立ち上げについて

switch0805

総合スコア25

Linux

Linuxは、Unixをベースにして開発されたオペレーティングシステムです。日本では「リナックス」と呼ばれています。 主にWebサーバやDNSサーバ、イントラネットなどのサーバ用OSとして利用されています。 上位500のスーパーコンピュータの90%以上はLinuxを使用しています。 携帯端末用のプラットフォームAndroidは、Linuxカーネル上に構築されています。

Postfix

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

0グッド

0クリップ

投稿2018/07/04 15:01

編集2018/07/05 07:07

こんばんは。

現在メールサーバーを建てようと試みているところですが、どうにもうまく動作しません。設定ファイルにはpostfix checkで検証してもエラーは出ず、postfix serviceも正常に稼働している模様です。以下確認した事象と設定ファイルです。

・確認した事象

telnet mydomain.com 25実行後
Trying xx.xx.xx.xx...
Connected to mydomain.com.
Escape character is '^]'.
220 mail.mydomain.com ESMTP
^]
502 5.5.2 Error: command not recognized

・設定ファイル

compatibility_level = 2 queue_directory = /var/spool/postfix command_directory = /usr/bin daemon_directory = /usr/lib/postfix/bin data_directory = /var/lib/postfix mail_owner = postfix #default_privs = nobody myhostname = mail.mydomain.com #myhostname = virtual.domain.tld mydomain = mydomain.com #myorigin = $myhostname myorigin = $mydomain inet_interfaces = all #inet_interfaces = $myhostname #inet_interfaces = $myhostname, localhost #proxy_interfaces = #proxy_interfaces = 1.2.3.4 #mydestination = $myhostname, localhost.$mydomain, localhost mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain #mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, # mail.$mydomain, www.$mydomain, ftp.$mydomain #local_recipient_maps = unix:passwd.byname $alias_maps #local_recipient_maps = proxy:unix:passwd.byname $alias_maps #local_recipient_maps = unknown_local_recipient_reject_code = 550 #mynetworks_style = class #mynetworks_style = 192.168.0.1/24 mynetworks_style = 127.0.0.0/24 mynetworks = 168.100.189.0/28, 127.0.0.0/8 #mynetworks = $config_directory/mynetworks #mynetworks = hash:/etc/postfix/network_table relay_domains = $mydestination # INTERNET OR INTRANET #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 #in_flow_delay = 1s #alias_maps = dbm:/etc/aliases #alias_maps = hash:/etc/aliases #alias_maps = hash:/etc/aliases, nis:mail.aliases #alias_maps = netinfo:/aliases alias_maps = hash:/etc/postfix/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 alias_database = $alias_maps #recipient_delimiter = + #home_mailbox = Mailbox #home_mailbox = Maildir/ mail_spool_directory = /srv/mail #mail_spool_directory = /var/spool/mail #mailbox_command = /some/where/procmail #mailbox_command = /some/where/procmail -a "$EXTENSION" #mailbox_transport = cyrus #fallback_transport = lmtp:unix:/file/name #fallback_transport = cyrus #fallback_transport = #luser_relay = $user@other.host #luser_relay = $local@other.host #luser_relay = admin+$local header_checks = regexp:/etc/postfix/header_checks #fast_flush_domains = $relay_domains smtpd_banner = $myhostname ESMTP #smtpd_banner = $myhostname ESMTP $mail_name ($mail_version) #local_destination_concurrency_limit = 2 #default_destination_concurrency_limit = 20 debug_peer_level = 2 #debug_peer_list = 127.0.0.1 #debug_peer_list = some.domain debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5 # debugger_command = # PATH=/bin:/usr/bin:/sbin:/usr/sbin; export PATH; screen # -dmS $process_name gdb $daemon_directory/$process_name # $process_id & sleep 1 # INSTALL-TIME CONFIGURATION INFORMATION # # The following parameters are used when installing a new Postfix version. # # sendmail_path: The full pathname of the Postfix sendmail command. # This is the Sendmail-compatible mail posting interface. # sendmail_path = /usr/bin/sendmail # newaliases_path: The full pathname of the Postfix newaliases command. # This is the Sendmail-compatible command to build alias databases. # newaliases_path = /usr/bin/newaliases # mailq_path: The full pathname of the Postfix mailq command. This # is the Sendmail-compatible mail queue listing command. # mailq_path = /usr/bin/mailq # setgid_group: The group for mail submission and queue management # commands. This must be a group name with a numerical group ID that # is not shared with other accounts, not even with the Postfix account. # setgid_group = postdrop # html_directory: The location of the Postfix HTML documentation. # html_directory = no # manpage_directory: The location of the Postfix on-line manual pages. # manpage_directory = /usr/share/man # sample_directory: The location of the Postfix sample configuration files. # This parameter is obsolete as of Postfix 2.1. # sample_directory = /etc/postfix # readme_directory: The location of the Postfix README files. # readme_directory = /usr/share/doc/postfix inet_protocols = ipv4 meta_directory = /etc/postfix shlib_directory = /usr/lib/postfix message_size_limit = 5242880 disable_vrfy_command = yes smtpd_helo_required = yes strict_rfc821_envelopes = yes allow_percent_hack = yes swap_bangpath = yes allow_untrusted_routing = no smtpd_client_restrictions = permit_mynetworks, reject_unknown_client, permit smtpd_data_restrictions = reject_unauth_pipelining, reject_multi_recipient_bounce smtpd_helo_restrictions = permit_mynetworks, reject_invalid_hostname, reject_non_fqdn_hostname, reject_unknown_hostname, permit smtpd_sender_restrictions = permit_mynetworks, reject_unknown_sender_domain, reject_non_fqdn_sender, permit smtpd_recipient_restrictions = permit_mynetworks, reject_non_fqdn_recipient, reject_unknown_recipient_domain, reject_unauth_destination, permit smtpd_etrn_restrictions = permit_mynetworks, reject_invalid_hostname, permit

不足の情報などあればお手数をおかけし大変恐縮ですが、ご教授のほどよろしくお願いいたします。
以上よろしくお願い申し上げます。

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

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

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

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

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

CHERRY

2018/07/04 15:16

うまく動いていないのは、どの様な症状でしょうか?  /var/log/maillog に何かメッセージは出ていないでしょうか?
switch0805

2018/07/05 07:11

ログはそこに出るのですね...ありがとうございます。ただどうやらそのファイルが存在しない模様です。
switch0805

2018/07/05 07:12

うまく動いていないのはtelnetでアクセスしたときなぜか接続できないと出てきてしまう点をさしてのことです。
guest

回答1

0

ベストアンサー

情報にドメインが記述されている(220 が始まる行) 為、
試しにメールを送信してみました。
設定通り動作していると思います。
ドメイン情報は削除しておいたほうがよいでしょう。

smtp

1# telnet xxx.xxx 25 2Trying xx.xx.xx.xx... 3Connected to xxx.xxx 4Escape character is '^]'. 5220 xxx.xxxx.xxxx ESMTP 6EHLO xxx.xxx 7250-xxx.xxxx.xxxx 8250-PIPELINING 9250-SIZE 5242880 10250-ETRN 11250-ENHANCEDSTATUSCODES 12250-8BITMIME 13250-DSN 14250 SMTPUTF8 15mail from: <root@xxx.xxx> 16250 2.1.0 Ok 17rcpt to: <root@xxx.xxx> 18250 2.1.5 Ok 19data 20354 End data with <CR><LF>.<CR><LF> 21Subject: test mail 22 23test 24. 25250 2.0.0 Ok: queued as 0E739660930 26quit 27221 2.0.0 Bye 28Connection closed by foreign host.

おそらく "^]" を入力して "502 5.5.2 Error: command not recognized" が返ってきたから質問をしたのかと思いますが、"^]" は "Escape character" ですので SMTPのコマンドではありません。ちなみに入力方法は CTRL + ] です。

投稿2018/07/04 21:18

編集2018/07/04 21:21
scsi

総合スコア2840

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

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

switch0805

2018/07/05 07:59

さっそくのご回答ありがとうございます。無事私の方にメールが届くことを確認できました。ありがとうございました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問