imsg rpc を起動し、stdio 上の JSON-RPC で通信します。別個のデーモンや専用ポートは不要です。
BlueBubbles (recommended)
新規構成ではこちらを推奨します。
Pairing
iMessage の DM はデフォルトでペアリングモードです。
Configuration reference
iMessage の設定項目一覧です。
Quick setup
- Local Mac (fast path)
- Remote Mac over SSH
Requirements and permissions (macOS)
imsgを実行する Mac で Messages にサインインしている必要があります。- OpenClaw /
imsgを実行するプロセスコンテキストには、Messages DB へアクセスするための Full Disk Access が必要です。 - Messages.app 経由でメッセージを送信するには Automation 権限が必要です。
Access control and routing
- DM policy
- Group policy + mentions
- Sessions and deterministic replies
channels.imessage.dmPolicy でダイレクトメッセージを制御します。pairing(デフォルト)allowlistopen(allowFromに"*"を含める必要があります)disabled
channels.imessage.allowFrom です。allowlist のエントリには、handle またはチャットターゲット (chat_id:*, chat_guid:*, chat_identifier:*) を使えます。Deployment patterns
Dedicated bot macOS user (separate iMessage identity)
Dedicated bot macOS user (separate iMessage identity)
専用の Apple ID と macOS ユーザーを用意すると、ボット用トラフィックを個人の Messages プロファイルから分離できます。典型的な流れ:
- 専用の macOS ユーザーを作成し、そのユーザーでサインインします。
- そのユーザー上で、ボット用 Apple ID を使って Messages にサインインします。
- そのユーザーに
imsgをインストールします。 - OpenClaw がそのユーザーコンテキストで
imsgを実行できるよう、SSH ラッパーを作成します。 channels.imessage.accounts.<id>.cliPathと.dbPathをそのユーザープロファイルに向けます。
Remote Mac over Tailscale (example)
Remote Mac over Tailscale (example)
よくある構成例:SSH キーを使い、SSH と SCP の両方が非対話で動作するようにしてください。
また、最初にホストキーを信頼して
- ゲートウェイは Linux / VM 上で動作
- iMessage と
imsgは tailnet 内の Mac で動作 cliPathのラッパーが SSH でimsgを実行remoteHostを使って SCP による添付ファイル取得を有効化
known_hosts を埋める必要があります。たとえば ssh bot@mac-mini.tailnet-1234.ts.net を一度実行してください。Multi-account pattern
Multi-account pattern
iMessage では
channels.imessage.accounts の下でアカウントごとの設定を行えます。各アカウントでは、cliPath、dbPath、allowFrom、groupPolicy、mediaMaxMb、履歴設定、添付ファイルルート allowlist などを上書きできます。Media, chunking, and delivery targets
Attachments and media
Attachments and media
- 受信添付ファイルの取り込みはオプションです:
channels.imessage.includeAttachments remoteHostが設定されていれば、リモート添付ファイルのパスを SCP 経由で取得できます- 添付ファイルパスは、許可されたルートに一致している必要があります
channels.imessage.attachmentRoots(ローカル)channels.imessage.remoteAttachmentRoots(リモート SCP モード)- デフォルトのルートパターン:
/Users/*/Library/Messages/Attachments
- SCP では厳密なホストキー検証を使います (
StrictHostKeyChecking=yes) - 送信メディアのサイズ上限は
channels.imessage.mediaMaxMbで制御します (デフォルト 16 MB)
Outbound chunking
Outbound chunking
- テキストチャンクの上限:
channels.imessage.textChunkLimit(デフォルト 4000) - チャンクモード:
channels.imessage.chunkModelength(デフォルト)newline(段落優先で分割)
Addressing formats
Addressing formats
推奨される明示的ターゲット:
chat_id:123(安定したルーティングに推奨)chat_guid:...chat_identifier:...
imessage:+1555...sms:+1555...user@example.com
Config writes
iMessage ではデフォルトで、チャンネル開始の設定書き込みを許可します (commands.config: true のときの /config set|unset)。
無効にするには:
Troubleshooting
imsg not found or RPC unsupported
imsg not found or RPC unsupported
バイナリと RPC サポートを確認します。probe が RPC 非対応を報告する場合は、
imsg を更新してください。DMs are ignored
DMs are ignored
確認事項:
channels.imessage.dmPolicychannels.imessage.allowFrom- ペアリング承認 (
openclaw pairing list imessage)
Group messages are ignored
Group messages are ignored
確認事項:
channels.imessage.groupPolicychannels.imessage.groupAllowFromchannels.imessage.groupsの allowlist 挙動- メンションパターン設定 (
agents.list[].groupChat.mentionPatterns)
Remote attachments fail
Remote attachments fail
確認事項:
channels.imessage.remoteHostchannels.imessage.remoteAttachmentRoots- ゲートウェイホストからの SSH / SCP キー認証
- ゲートウェイホスト上の
~/.ssh/known_hostsにホストキーがあること - Messages を実行している Mac 上で、リモートパスが読み取り可能であること
macOS permission prompts were missed
macOS permission prompts were missed
同じユーザー / セッションコンテキストの対話型 GUI ターミナルで再実行し、プロンプトを承認してください。OpenClaw /
imsg を実行するプロセスコンテキストに Full Disk Access と Automation が付与されていることも確認してください。