Customize Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

No cookies to display.

携帯からメールで投稿する

[追記]以下のように書いては見たが、実際は携帯から投稿なんかしないし、写真はTwitterとかFlickrとか別の場所にあげるので、結局、モバイルからのアップロード機能はやめてしまいました。

この間、モバイル用のテーマを入れてみようと苦戦したが、本当にやりたいことは携帯電話からサイトを見ることよりも、写真なり文章なりを投稿することだと気がついた。

しかし、携帯から何かをUploadするとなると認証の問題があり、i-mode からではSession管理などが難しくうまく行かないであろうこともわかった。フルブラウザを使ってまで何かしたいとは思わない。

そこで、メールを使って写真なり文章なりを投稿する方法を探した。すると、Mailhandler というモジュールを使えばよいことがわかった。

早速、導入してみたのだが、モジュールを有効にしたとたん、「PHPがIMAP Extensionをサポートしていない」というメッセージがでた。Mailhandler の設定メニューがどこにも無いので、よくみるとモジュールが無効化されている。

MailhandlerのREADMEをみると、The IMAP dynamic extension must be enabled. と書かれている。さくらインターネットのPHPはIMAP extension をサポートしていないようだ。

そこで、いろいろ調べたのだが、php.iniでどうにかなる話ではなさそうなので、考えた末にPHPそのものを自分でインストールしてしまうことにした。
PHPのインストールについては、さくらにPHP5.2.8をインストール に書いた。

IMAP ExtensionをサポートするPHPが動いたところで改めてMailhandlerモジュールを有効にすると、今度はうまくいった。

Mailhandlerの設定については、以下のページを参考にした。

Adding content to site via email

まず、さくらインターネットのサーバコントロールパネルからメール投稿用の専用メールアドレスを作っておく。

上記ページにあるように以下のモジュールもインストールしておく。

http://drupal.org/project/mailhandler
http://drupal.org/project/mailsave (Mailsave と Mailsave to CCK Imagefield を有効にしておく)
http://drupal.org/project/unwrap
http://drupal.org/project/safehtml

次に、管理セクション/サイトの環境設定/入力書式 で efilter という名前で新しい書式を作る。HTMLフィルタ、Safe HTML、URLフィルタ、unwrap filter にチェックを入れた。

管理セクション/コンテンツ/Mailhandler でメールの設定をする。

管理セクション/ユーザの管理/ロールで、email content provider という新しいロールを作る。権限は、imagefield moduleのview imagefield uploads、Mailsave moduleのsave attachments、mailsave_to_imagefield module のconvert to imagefield、node moduleのストーリーコンテンツの作成にそれぞれチェックをいれる。(Mailhandlerでストーリーコンテンツを作成するよう設定している)

モバイル投稿用の新しいユーザを作り、メールアドレスを携帯のアドレスにしておく。email content provider ロールを付与する。

PAGE TOP