reportbugのメールをGmailのSMTPサーバーを使って送信する
Debianのバグ報告ツールのreportbugは、バグ報告のメールをSMTPを使って直接メールを投げます。
クライアントマシンとしてDebianを使っているとSMTPサーバーがない場合があるので、その場合にGmailのSMTPを指定して送るTips。
reportbugを最設定するので –configureオプションを指定して実行します。
$ reportbug --configure
設定
reportbugの設定について一問ずつ対話形式で答えていきます。
- Please choose the default operating mode for reportbug.
- 「novice」か「standard」でよいと思うので、1か2でよいでしょう。
- Please choose the default operating mode for reportbug.
- 「novice」か「standard」でよいと思うので、1か2でよいでしょう。
- Please choose the default interface for reportbug.
- テキストは使いづらいので「urwid」か「gtk2」でよいと思います。「urwid」、「gtk2」を利用する場合は、python-urwid、python-gtk2パッケージを入れておいてください。
- Will reportbug often have direct Internet access?
- インターネットにつながっていると思うので「Y」
- What real name should be used for sending bug reports?
- 実名で名前を入力します。
- Which of your email addresses should be used when sending bug reports?
- 連絡に使用するEメールアドレスを入力します。
- Do you have a “mail transport agent” (MTA) like Exim, Postfix or SSMTP configured on this computer to send mail to the Internet?
- このマシンにはSMTPサーバーがないので「N」です。
- Please enter the name of your SMTP host. Usually it's called something like “mail.example.org” or “smtp.example.org”. If you need to use a different port than default, use the <host>:<port> alternative format. Just press ENTER if you don't have one or don't know, and so a Debian SMTP host will be used.
- GmailのSMTPサーバーを指定するので「smtp.google.com:587」と入力します。
- If you need to use a user name to send email via “smtp.google.com:587” on your computer, please enter that user name. Just press ENTER if you don't need a user name.
- SMTPのユーザー名を指定します。gmailのユーザー名を指定するので「(あなたのユーザー名)@gmail.com」と指定します。
- Do you want to encrypt the SMTP connection with TLS (only available if the SMTP host supports it)?
- TLSは必要なので「Y」と答えます。
- Please enter the name of your proxy server. It should only use this parameter if you are behind a firewall. The PROXY argument should be formatted as a valid HTTP URL, including (if necessary) a port number; for example, http://192.168.1.1:3128/. Just press ENTER if you don't have one or don't know.
- プロキシがあれば設定します。
設定ファイル
reportbugの設定は ~/.reportbugrc に保存されています。
正しい設定だとこういう風になっていると思います。
# name and email setting (if non-default)
# realname "Real Name"
# email "your_gmail_address@gmail.com"
# Send all outgoing mail via the following host
smtphost "smtp.gmail.com:587"
smtpuser "your_gmail_address@gmail.com"
smtptls