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

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

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

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

Arch Linux

arch(アーク)は、バージョン管理システムです。 また、リポジトリ(アーカイブ)操作を行えるツールの総称として扱われています。

Q&A

解決済

2回答

6127閲覧

PostfixでRelay access deniedが出る問題について

switch0805

総合スコア25

Postfix

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

Arch Linux

arch(アーク)は、バージョン管理システムです。 また、リポジトリ(アーカイブ)操作を行えるツールの総称として扱われています。

0グッド

1クリップ

投稿2018/07/06 06:27

PostfixでのSMTPサーバーの立ち上げに成功し、ローカルでのメールのやり取りと外部(gmail)から送られてくるメールの受信に成功しました。しかし外部(gmail)への送信がうまく行きません。telnetでアクセスしメール送信を試みると
554 5.7.1 <送信先アドレス>: Relay access denied
というエラーが出ます。
自力で調べたところSMTP認証たるものをしなくてはならないとありましたが、手順がどうも要領を得ず(書いてあることがばらばらで何を信じるべきかよくわからない状態です)質問させていただいた次第です。この問題の解決のため、手順の方向性をご教示いただきたいです。

main.cf

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ページで確認できます。

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

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

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

guest

回答2

0

ベストアンサー

必要な作業は下記です。
saslauthd をインストールし、設定し、起動する
postfixのmain.cfを設定し、submission portを使えるようにする。
手順は解説サイトで調べるのが手っ取り早いかと。

あとはspf,dkimあたりにも対応しないと送信したメールが迷惑メールになる可能性が高いです。
一つ一つ問題クリア、頑張ってください。

投稿2018/07/06 06:45

scsi

総合スコア2840

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

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

switch0805

2018/07/06 13:01

度々ありがとうございます。 なるほど、ではその方向性でトライしてみます。 また質問をするかもしれませんが、その際はぜひよろしくお願い致します。
guest

0

接続元(メールクライアントの)IPアドレスが固定の場合、mynetworks に IPアドレスを追加する方法が簡単です。
接続元IPアドレスが不定の場合、scsi さんの回答のとおり、SMTP-Auth でしょうね。

あと、mynetworks_style = 127.0.0.0/24 は正しくないし、不要です。

投稿2018/07/06 09:28

TaichiYanagiya

総合スコア12141

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

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

switch0805

2018/07/06 12:59

回答をして頂きありがとうございます。mynetwork_styleの部分は不要なのですね。ありがとうございます。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.49%

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

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

質問する

関連した質問