<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Gmail | kulog</title>
	<atom:link href="https://kulog.org/tag/gmail/feed/" rel="self" type="application/rss+xml" />
	<link>https://kulog.org</link>
	<description></description>
	<lastBuildDate>Sat, 09 Feb 2013 08:37:10 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>
	<item>
		<title>PostfixでGmailへリレー設定</title>
		<link>https://kulog.org/pc/software/k5370/</link>
					<comments>https://kulog.org/pc/software/k5370/#respond</comments>
		
		<dc:creator><![CDATA[akahane]]></dc:creator>
		<pubDate>Sat, 19 May 2012 02:25:43 +0000</pubDate>
				<category><![CDATA[ソフトウェア]]></category>
		<category><![CDATA[Postfix]]></category>
		<category><![CDATA[Gmail]]></category>
		<guid isPermaLink="false">http://kulog.org/?p=5370</guid>

					<description><![CDATA[以前にもPostfixを使ってGmail転送設定の記事を書いたのですが 間違っていたり、古くて陳腐化していたので、再度書いてみました。 下記をインストール # yum install cyrus-sasl # yum i [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>以前にもPostfixを使ってGmail転送設定の記事を書いたのですが<br />
間違っていたり、古くて陳腐化していたので、再度書いてみました。<br />
<span id="more-5370"></span><br />
下記をインストール</p>
<div class="command">
# yum install cyrus-sasl<br />
# yum install /usr/bin/c_rehash
</div>
<p>Gmailの証明書を取得</p>
<div class="command">
# openssl s_client -connect smtp.gmail.com:465 -showcerts</p>
<p>0 s:/C=US/ST=California/L=Mountain View/O=Google Inc/CN=smtp.gmail.com<br />
  i:/C=US/O=Google Inc/CN=Google Internet Authority<br />
<a>ここから</a><br />
&#8212;&#8211;BEGIN CERTIFICATE&#8212;&#8211;</p>
<p>&#8212;&#8211;END CERTIFICATE&#8212;&#8211;<br />
<a>ここまでを/etc/pki/tls/certs/google.pem として保存</a><br />
1 s:/C=US/O=Google Inc/CN=Google Internet Authority<br />
  i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority<br />
<a>ここから</a><br />
&#8212;&#8211;BEGIN CERTIFICATE&#8212;&#8211;</p>
<p>&#8212;&#8211;END CERTIFICATE&#8212;&#8211;<br />
<a>ここまでを/etc/pki/tls/certs/euqifax.pem として保存</a>
</div>
<p>証明書をハッシュ化</p>
<div class="command">
# c_rehash /etc/pki/tls/certs<br />
Doing /etc/pki/tls/certs<br />
google.pem => xxxxxxxx.0<br />
euqifax.pem => xxxxxxxx.0
</div>
<p>gmailのパスワードファイル作成</p>
<div class="command">
# vi /etc/postfix/auth_passwd<br />
[smtp.gmail.com]:587 xxxxx@gmail.com:password</p>
<p># chown root. /etc/postfix/auth_passwd<br />
# chmod 600 /etc/postfix/auth_passwd<br />
<a>ファイルを更新したらpostmapを必ず実行</a><br />
# postmap /etc/postfix/auth_passwd
</div>
<p>Postfixの設定</p>
<div class="command">
# vi /etc/postfix/main.cf<br />
relayhost = [smtp.gmail.com]:587</p>
<p>smtp_use_tls = yes</p>
<p>smtp_sasl_auth_enable = yes<br />
smtp_sasl_password_maps = hash:/etc/postfix/auth_passwd<br />
smtp_sasl_security_options = noanonymous<br />
smtp_sasl_mechanism_filter = plain</p>
<p>smtp_tls_CApath = /etc/pki/tls/certs<br />
smtpd_tls_session_cache_database = btree:/var/lib/postfix/smtpd_scache
</p></div>
<p>Postfixを再起動</p>
<div class="command">
# /etc/init.d/postfix restart
</div>
<p>これで設定は終了です。<br />
エラーがないか/var/log/maillogを確認ください。</p>
<p>このままだと独自メールアドレスで送信しても<br />
Gmailのアドレスで表示されてしまいます。<br />
それを解決するためにGmailの設定を変更します。</p>
<ol>
<li>Gmailにログインし右上にある歯車アイコンから設定を選択
<li>「アカウントとインポート」を選択
<li>真ん中あたりにある「メールアドレスを追加」を選択
<li>独自メールアドレスを入力し「次のステップ」を選択
<li>「SMTPサーバー経由でxxxx.xxx送信します」を選択
<li>SMTPサーバ名、メールアドレスのユーザー名、パスワードを入力
<li>確認のメールを送信
<li>メールを確認して書き込まれているURLをクリック
</ol>
<p>これで設定完了です。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://kulog.org/pc/software/k5370/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Postfixのリレー設定 -Gmail-</title>
		<link>https://kulog.org/pc/software/k2071/</link>
					<comments>https://kulog.org/pc/software/k2071/#respond</comments>
		
		<dc:creator><![CDATA[akahane]]></dc:creator>
		<pubDate>Mon, 12 Apr 2010 15:23:34 +0000</pubDate>
				<category><![CDATA[ソフトウェア]]></category>
		<category><![CDATA[Gmail]]></category>
		<category><![CDATA[Postfix]]></category>
		<guid isPermaLink="false">http://kulog.org/?p=2071</guid>

					<description><![CDATA[Postfixのリレー設定 -Gmail サーバを入れ直したとき、毎回メール設定に苦労します。 それはOP25Bのため、Gmailへリレーさせているのですが 毎回、記憶があいまいで設定を覚えていないのです。 ということで [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Postfixのリレー設定 -Gmail</p>
<p>サーバを入れ直したとき、毎回メール設定に苦労します。<br />
それはOP25Bのため、Gmailへリレーさせているのですが<br />
毎回、記憶があいまいで設定を覚えていないのです。<br />
ということでメモを残すことにしました。<br />
<span id="more-2071"></span></p>
<div class="command" style="color:#000;background:#ddd;">
この記事は間違えているところがあったので、こちらを参考にしてください。<br />
<a href="https://kulog.org/pc/software/k5370/">PostfixでGmailへリレー設定</a>
</div>
<p>■証明書を手に入れる<br />
オレオレ証明書だとGmailから怒られます。<br />
ということで、thawte.comからルート証明書をゲットしてきます。<br />
<a href="http://www.thawte.com/roots/">http://www.thawte.com/roots/</a><br />
解凍するとたくさんありますが下記のファイルを使います。<br />
Thawte Roots &#8211; Thawte SSLWeb Server Roots &#8211;<br />
　thawte Premium Server CA &#8211; Thawte Premium Server CA.pem</p>
<p>適当な名前(google.pem)に変えて下記に置きます。<br />
/etc/pki/tls/certs/google.pem</p>
<p>■ smtp認証のパスワードファイル作成</p>
<div class="command">
# vi /etc/postfix/auth_passwd<br />
[smtp.gmail.com]:587 xxxxx@gmail.com:password</p>
<p># chown root. /etc/postfix/auth_passwd<br />
# chown 600 /etc/postfix/auth_passwd</p>
<p># postmap /etc/postfix/auth_passwd
</p></div>
<p>■ Postfixの設定</p>
<div class="command">
# vi /etc/postfix/main.cf<br />
relayhost = [smtp.gmail.com]:587</p>
<p>smtp_sasl_auth_enable = yes<br />
smtp_sasl_password_maps = hash:/etc/postfix/authinfo<br />
smtp_sasl_security_options = noanonymous<br />
smtp_sasl_mechanism_filter = login plain xoauth<br />
smtp_use_tls = yes</p>
<p>smtpd_use_tls = yes<br />
smtpd_tls_cert_file = /etc/pki/tls/certs/google.pem<br />
smtpd_tls_key = /etc/pki/tls/certs/google.pem<br />
smtpd_tls_session_cache_database = btree:/var/lib/postfix/smtpd_scache</p>
<p># vi /etc/postfix/master.cf<br />
smtps     inet  n       &#8211;       n       &#8211;       &#8211;       smtpd<br />
  -o smtpd_tls_wrappermode=yes<br />
  -o smtpd_sasl_auth_enable=yes</p>
<p># /etc/init.d/postfix restart
</p></div>
<p>■Gmailの設定<br />
このままだとサーバからメールを送信すると<br />
送信元がGmailのメールアドレスに書き換えられます。<br />
その対処方法です。</p>
<p>1. Gmailにログイン<br />
2. 右上の「設定」をクリック<br />
3. 「アカウントとインポート」をクリック<br />
4. 名前：の「別のアドレスからメッセージを送信」をクリック<br />
5. メールアドレスを入力<br />
6. 届いたメールから承認する</p>
<p>これで独自のメールアドレスのまま送信できます。</p>
<p>参考記事：<br />
<a rel="noopener" href="http://memo.xight.org/2009-05-24-3" target="_blank">memo.xight.org: PostfixからGmail経由でメールを送る方法</a><br />
<a rel="noopener" href="http://redmine.gendosu.jp/projects/25/wiki/Postfix-Gmail%E3%82%92%E3%83%AA%E3%83%AC%E3%83%BC%E3%81%97%E3%81%A6%E3%83%A1%E3%83%BC%E3%83%AB%E9%80%81%E4%BF%A1%E3%81%99%E3%82%8B%E8%A8%AD%E5%AE%9A" target="_blank">Gmailをリレーしてメール送信する設定</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://kulog.org/pc/software/k2071/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
