<?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>forever 5 years old blog &#187; Gmail</title>
	<atom:link href="http://www.f5yo.net/archives/tag/gmail/feed" rel="self" type="application/rss+xml" />
	<link>http://www.f5yo.net</link>
	<description>今年も 5 歳になりました</description>
	<lastBuildDate>Wed, 29 Apr 2009 01:32:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>sSMTP で Gmail からメールを送る</title>
		<link>http://www.f5yo.net/archives/1</link>
		<comments>http://www.f5yo.net/archives/1#comments</comments>
		<pubDate>Sat, 14 Feb 2009 06:01:49 +0000</pubDate>
		<dc:creator>ihara</dc:creator>
				<category><![CDATA[いろいろ]]></category>
		<category><![CDATA[Gmail]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.f5yo.net/wordpress/?p=1</guid>
		<description><![CDATA[Debian を入れて自宅サーバとして使っていた Thinkpad T42 が Fan Error で起動しなくなり、パーツ交換するのも面倒だし中古の X40 2371-7VJ を GENO で 3 万円弱で買いました。 [...]]]></description>
			<content:encoded><![CDATA[<p>Debian を入れて自宅サーバとして使っていた Thinkpad T42 が Fan Error で起動しなくなり、パーツ交換するのも面倒だし中古の X40 2371-7VJ を <a href="http://www.geno-web.jp/">GENO</a> で 3 万円弱で買いました。サイトが多少重いときがあるみたいですが、安いですし届いたマシンもめちゃきれいでした。</p>
<p>というわけで、今回は Ubuntu 入れてみようと思い CD ドライブもないので <a href="http://unetbootin.sourceforge.net/">UNetBootin</a> で Ubuntu 8.10 を選んでインストール。Windows のパーティションもガツンと消して無事完了。</p>
<p>パッケージの管理の仕方も Debian とほとんど同じみたいだしセットアップで困ることはあまりなかったのですが、WordPress の WP-DB-Backup でバックアップを定期的にメールで送ろうとすると PHPMailer が使う /usr/sbin/sendmail を用意してあげないといけません。Sendmail とか Postfix とか別にメールサーバ立てたいわけじゃなくて送信だけしたいんスよ、というわけで sSMTP。</p>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo apt-get install ssmtp</pre></div></div>



<p>でインストールして、Gmail のアカウントからメールを送れるよう /etc/ssmtp/ssmtp.conf を編集します。23 行目の AuthUser と 24 行目の AuthPass は自分のアカウントのものにすれば良いです。</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
</pre></td><td class="code"><pre class="text" style="font-family:monospace;">#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids &lt; 1000
# Make this empty to disable rewriting.
root=postmaster
&nbsp;
# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=smtp.gmail.com
&nbsp;
# Where will the mail seem to come from?
rewriteDomain=gmail.com
&nbsp;
# The full hostname
hostname=gmail.com
&nbsp;
# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
FromLineOverride=YES
&nbsp;
AuthUser=your_id@gmail.com
AuthPass=your_password
useSTARTTLS=YES
# DEBUG=YES</pre></td></tr></table></div>



<p>で、テスト。最終行の test を入力して改行した後は Ctrl-D で抜けます。From と To は自分のアドレスを指定しましょう。</p>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sendmail -t
From: your_id@gmail.com
To: your_id@gmail.com
Subject: test
&nbsp;
test</pre></div></div>



<p>これで Gmail に自分からメールが届くはずです。めでたい。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.f5yo.net/archives/1/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
