web-dev-qa-db-ja.com

exim4とGmailを機能させることができません

私は、eximと私のGmailアカウントを介してubuntuサーバーからメールを送信する方法についてさまざまなガイドに従ってきました。私はこれについて何度もブロックの周りにいたので、どういうわけかそれをコックしたと思います。誰もが正しくないことを見ることができますか?

このフォーラムの投稿に実際のメールアドレスやドメイン名を含めたくないので、設定ファイルなどに表示されるたびに、次のように交換します。システム変数などと混同しないように、説明的な名前の代わりにばかげた名前を使用します。

domain name for the server:                bigspanners.com
username i'm logged into the server as:    jimmy
hostname on the server:                    spanners
"long" hostname (result of `hostname -f`): spanners.bigspanners.com
the gmail address i want to send from:     [email protected]
gmail password:                            abcdefgh               

私のexim4構成(/etc/exim4/update-exim4.conf.conf)は次のようになります。

#/etc/exim4/update-exim4.conf.conf

dc_eximconfig_configtype='smarthost'
dc_other_hostnames=''
dc_local_interfaces='127.0.0.1 ; ::1'
dc_readhost='bigspanners.com'
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost='smtp.gmail.com::587'
CFILEMODE='644'
dc_use_split_config='true'
dc_hide_mailname='false'
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'

私はこれを/etc/exim4/passwd.clientファイルに持っています:

# password file used when the local exim is authenticating to a remote
# Host as a client.
#
# see exim4_passwd_client(5) for more documentation
#
# Example:
### target.mail.server.example:login:password
gmail-smtp.l.google.com:[email protected]:abcdefgh
*.google.com:[email protected]:abcdefgh
smtp.gmail.com:[email protected]:abcdefgh

そして私はこれを/etc/email-addressesに持っています

# This is /etc/email-addresses. It is part of the exim package
#
# This file contains email addresses to use for outgoing mail. Any local
# part not in here will be qualified by the system domain as normal.
#
# It should contain lines of the form:
#
#user: [email protected]
#otheruser: [email protected]
jimmy: [email protected]
jimmy@localhost: [email protected]
jimmy@hostname1: [email protected]
[email protected]: [email protected]

私は次のようなメールを送信しようとしています:

echo "This is a test." | mail -s Testing [email protected]

そして、これは私の/var/log/exim4/mainlogファイルにあります。

2014-04-16 13:57:50 1WaQLW-0002dC-9k <= [email protected] U=jimmy P=local S=445
2014-04-16 13:57:51 1WaQLW-0002dC-9k plain authenticator failed H=gmail-smtp-msa.l.google.com [173.194.64.108] 534-5.7.14 <https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbsuj
534-5.7.14 B3VqEmiHZ1icpT_O185MznNwotW78A3DdsElZPGAkfsIWQdd5de1lNbXoR-xdqK5Ko_Rs5
534-5.7.14 8zXBl2vzfUDPSF08dULZVaF8z999DpQNslK02DfEG0YcTUOxLqoosEzuxHA1vG-_bIxi9L
534-5.7.14 hMsYKcMkWJ7g4wf4xG-LK6c1sKQhFx-u1zcsUyLykkzI1qtGXYF5NC-ZpdnALCdQZ3hzUh
534-5.7.14 aAoXTLg> Please log in via your web browser and then try again.
534-5.7.14 Learn more at https://support.google.com/mail/bin/answer.py?answer=787
534 5.7.14 54 tz6sm39939105obc.10 - gsmtp
2014-04-16 13:57:51 1WaQLW-0002dC-9k login authenticator failed H=gmail-smtp-msa.l.google.com [173.194.64.108] 534-5.7.14 <https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbvT4
534-5.7.14 CHLiBFGLWWXIojohtPd9cIM1vLOt1MMyjSUzcFdXOarqE18FzPPxmU9e32_CveJOax5nnB
534-5.7.14 _7-adgi6NtHxbChOOxjRpd8xZCLgNnSjiHFWcbYeLLCZbv-7l6zylE7poh8nFe7SgTEINk
534-5.7.14 Lx1XvFQH1RuA1HJCwsC6nC-jG_4HQF7TY8ma9PBJWv4gz9fNna7wZFX4eeWtFTgpg7dKrX
534-5.7.14 wGYmwwQ> Please log in via your web browser and then try again.
534-5.7.14 Learn more at https://support.google.com/mail/bin/answer.py?answer=787
534 5.7.14 54 tz6sm39939105obc.10 - gsmtp
2014-04-16 13:57:51 1WaQLW-0002dC-9k ** [email protected] R=smarthost T=remote_smtp_smarthost: SMTP error from remote mail server after MAIL FROM:<[email protected]> SIZE=1480: Host gmail-smtp-msa.l.google.com [173.194.64.108]: 530-5.5.1 Authentication Required. Learn more at\n530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 tz6sm39939105obc.10 - gsmtp
2014-04-16 13:57:51 1WaQLX-0002dT-QM <= <> R=1WaQLW-0002dC-9k U=Debian-exim P=local S=1595
2014-04-16 13:57:51 1WaQLW-0002dC-9k Completed
2014-04-16 13:57:52 1WaQLX-0002dT-QM plain authenticator failed H=gmail-smtp-msa.l.google.com [173.194.64.108] 534-5.7.14 <https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbt1l
534-5.7.14 LT1ysO4nisev9cFYPlQZ0Lk_Y0VvwVmgOWTJOEbZzYo5JOP9vMCoh-wwEXhq-8pUkhKejG
534-5.7.14 KRUNECT5VykeH6TSNQ8MR8ZoXe36ZZhpiZXCr0Smbjq512Lq_D5tozz9A9o1_JQePR05w6
534-5.7.14 RjyOK481V2Th6RhKwKqlBsvxfWKbs7twgxyklxBTRihFUEkJpFXDzvWNfUNJhkQq0MJnHv
534-5.7.14 53T4KeQ> Please log in via your web browser and then try again.
534-5.7.14 Learn more at https://support.google.com/mail/bin/answer.py?answer=787
534 5.7.14 54 sm4sm23756569obc.3 - gsmtp
2014-04-16 13:57:53 1WaQLX-0002dT-QM login authenticator failed H=gmail-smtp-msa.l.google.com [173.194.64.108] 534-5.7.14 <https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbt09
534-5.7.14 0DeijxwxzvClKfwY3oc1IhhkdSt_3suNtEsij4ibdikNtCMCiogd6mOma3obSAu2J5PlVh
534-5.7.14 QnZAN8CalbSYOX7mzuQyVqErqsY9uv5yuObmXk8771WBGrOzIxaOTnzChpd_ZVVeSGfmnh
534-5.7.14 qU5KHUrFo-qvHuYuqNZ1IsnbCkDKpov095uSs9wsbqA2WDEIKMI97EScrbjSNTJ35gdzOx
534-5.7.14 D_2ZhLA> Please log in via your web browser and then try again.
534-5.7.14 Learn more at https://support.google.com/mail/bin/answer.py?answer=787
534 5.7.14 54 sm4sm23756569obc.3 - gsmtp
2014-04-16 13:57:53 1WaQLX-0002dT-QM ** [email protected] R=smarthost T=remote_smtp_smarthost: SMTP error from remote mail server after MAIL FROM:<> SIZE=2655: Host gmail-smtp-msa.l.google.com [173.194.64.108]: 530-5.5.1 Authentication Required. Learn more at\n530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 sm4sm23756569obc.3 - gsmtp
2014-04-16 13:57:53 1WaQLX-0002dT-QM Frozen (delivery error message)
2014-04-16 14:00:13 1WaQNg-0002eG-NX <= [email protected] U=jimmy P=local S=2381
2014-04-16 14:00:13 1WaQNg-0002eG-NX == jimmy@localhost R=local_user T=mail_spool defer (13): Permission denied: creating lock file hitching post /var/mail/jimmy.lock.spanners.bigspanners.com.534e8ced.000027cc (euid=1000 egid=8)

この投稿が長かったことをお詫びしますが、関連すると思われる情報を提供しようとしています。誰かが何が悪いのかわかりますか?

編集:私は関連するかもしれない何か他のものを考えました:私はすべての発信リクエストを許可するが、ホワイトリストにあるものに期待されるすべての着信リクエストをブロックするようにiptablesを設定しています。 Gmail認証がどのように機能するのかわかりません。ホワイトリストに登録されていないポートに着信しているために認証プロセスの一部がブロックされている可能性があります。そのために失敗しますか?これが私のiptablesルールです:

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            
REJECT     all  --  anywhere             127.0.0.0/8         reject-with icmp-port-unreachable 
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED 
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:www 
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:https 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:24367 
ACCEPT     icmp --  anywhere             anywhere            icmp echo-request 
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:2812 
LOG        all  --  anywhere             anywhere            limit: avg 5/min burst 5 LOG level debug prefix `iptables denied: ' 
REJECT     all  --  anywhere             anywhere            reject-with icmp-port-unreachable 

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
REJECT     all  --  anywhere             anywhere            reject-with icmp-port-unreachable 

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:2812 

編集2:これを投稿してから、「誰かがあなたのメールアカウントにアクセスしようとしました、あなたでしたか?」というGmailからの通知がありました。 (またはその趣旨の言葉)、私のサーバーのIPアドレスを一覧表示します。 「はい、それは私でした」ボックスをクリックして再試行しましたが、それでも機能しません。

2
Max Williams

数時間同じ問題が発生しましたが、他のIPから通常どおりログインしようとするため、アカウントアクセスをブロックするのはGoogleの構成ではありません。

開くhttp://www.google.com/accounts/DisplayUnlockCaptcha次に、たとえば次のように使用して電子メールを送信してみます。echo'MyTest Text '| mail -s Testmail [email protected]

/ etc/exim4/passwd.client

# password file used when the local exim is authenticating to a remote
# Host as a client.
#
# see exim4_passwd_client(5) for more documentation
#
# Example:
### target.mail.server.example:login:password

gmail-smtp.l.google.com:[email protected]:yourpassword
*.google.com:[email protected]:yourpassword
smtp.gmail.com:[email protected]:yourpassword

/ etc/exim4/update-exim4.conf.conf

# /etc/exim4/update-exim4.conf.conf
# (...)
# This is a Debian specific file

dc_eximconfig_configtype='satellite'
dc_other_hostnames='ServerName'
dc_local_interfaces='127.0.0.1 ; ::1'
dc_readhost='yourdomain_which_points_to_server.com'
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost='smtp.gmail.com::587'
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname='true'
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'
5
FireEmerald

Tlsネゴシエーションが正しく完了しないと、Gmail認証は失敗します。 Gmailと話しているときに、実際にstarttlsを使用していることを確認してください。 -d-all + tls + transportを使用してeximを実行できます。

それはより多くの情報を与えるはずです

0
alxgomz