iMessage (레거시: imsg)
상태: 레거시 외부 CLI 통합입니다. Gateway가imsg rpc를 실행하고 stdio 위에서 JSON-RPC로 통신합니다. 별도 daemon이나 port는 필요하지 않습니다.
BlueBubbles (권장)
새 환경에서 권장되는 iMessage 경로입니다.
페어링
iMessage DM은 기본적으로 pairing 모드를 사용합니다.
설정 레퍼런스
iMessage 전체 필드 레퍼런스입니다.
빠른 설정
- 로컬 Mac (빠른 경로)
- SSH를 통한 원격 Mac
요구 사항과 권한 (macOS)
imsg를 실행하는 Mac에서 Messages에 로그인되어 있어야 합니다.- OpenClaw/
imsg가 실행되는 프로세스 컨텍스트에는 Full Disk Access가 필요합니다. (Messages DB 접근) - Messages.app을 통해 메시지를 보내려면 Automation 권한이 필요합니다.
접근 제어와 라우팅
- DM policy
- Group policy + mentions
- 세션과 deterministic replies
channels.imessage.dmPolicy는 direct message 접근을 제어합니다.pairing(기본값)allowlistopen(allowFrom에"*"가 있어야 함)disabled
channels.imessage.allowFromAllowlist 엔트리는 handle 또는 chat target(chat_id:*, chat_guid:*, chat_identifier:*)이 될 수 있습니다.배포 패턴
전용 bot macOS 사용자 (분리된 iMessage identity)
전용 bot macOS 사용자 (분리된 iMessage identity)
bot 트래픽을 개인 Messages 프로필과 분리하려면, 전용 Apple ID와 macOS 사용자를 두는 것이 좋습니다.일반적인 흐름:
- 전용 macOS 사용자를 생성하고 로그인
- 해당 사용자에서 bot Apple ID로 Messages 로그인
- 해당 사용자 컨텍스트에
imsg설치 - OpenClaw가 그 사용자 컨텍스트에서
imsg를 실행할 수 있도록 SSH wrapper 생성 channels.imessage.accounts.<id>.cliPath와.dbPath를 그 사용자 프로필로 지정
Tailscale을 통한 원격 Mac (예시)
Tailscale을 통한 원격 Mac (예시)
흔한 구성:SSH와 SCP가 모두 비대화형으로 동작하도록 SSH key를 사용하세요.
먼저
- gateway는 Linux/VM에서 실행
- iMessage +
imsg는 tailnet 안의 Mac에서 실행 cliPathwrapper가 SSH로imsg를 실행remoteHost가 SCP 첨부 파일 가져오기를 활성화
ssh bot@mac-mini.tailnet-1234.ts.net처럼 접속해 host key를 신뢰시켜 known_hosts를 채워 두는 것이 좋습니다.멀티 계정 패턴
멀티 계정 패턴
iMessage는
channels.imessage.accounts 아래의 per-account 설정을 지원합니다.각 계정은 cliPath, dbPath, allowFrom, groupPolicy, mediaMaxMb, history 설정, attachment root allowlist 같은 필드를 개별적으로 override할 수 있습니다.미디어, 청킹, 전달 대상
첨부 파일과 미디어
첨부 파일과 미디어
- inbound attachment 수집은 선택 사항:
channels.imessage.includeAttachments remoteHost가 설정되면 원격 첨부 파일 경로를 SCP로 가져올 수 있음- 첨부 파일 경로는 허용된 root와 일치해야 함:
channels.imessage.attachmentRoots(로컬)channels.imessage.remoteAttachmentRoots(원격 SCP 모드)- 기본 root 패턴:
/Users/*/Library/Messages/Attachments
- SCP는 strict host-key checking(
StrictHostKeyChecking=yes)을 사용 - outbound media 크기는
channels.imessage.mediaMaxMb를 사용 (기본 16 MB)
Outbound chunking
Outbound chunking
- text chunk limit:
channels.imessage.textChunkLimit(기본 4000) - chunk mode:
channels.imessage.chunkModelength(기본값)newline(문단 우선 분할)
주소 지정 형식
주소 지정 형식
권장되는 명시적 target:
chat_id:123(안정적인 라우팅에 권장)chat_guid:...chat_identifier:...
imessage:+1555...sms:+1555...user@example.com
설정 쓰기
iMessage는 기본적으로 채널에서 시작된 config write를 허용합니다. (commands.config: true일 때 /config set|unset)
비활성화:
문제 해결
imsg를 찾을 수 없거나 RPC를 지원하지 않음
imsg를 찾을 수 없거나 RPC를 지원하지 않음
바이너리와 RPC 지원 여부를 확인하세요.probe가 RPC unsupported를 보고하면
imsg를 업데이트하세요.DM이 무시됨
DM이 무시됨
다음 항목을 확인하세요.
channels.imessage.dmPolicychannels.imessage.allowFrom- pairing 승인 상태 (
openclaw pairing list imessage)
그룹 메시지가 무시됨
그룹 메시지가 무시됨
다음 항목을 확인하세요.
channels.imessage.groupPolicychannels.imessage.groupAllowFromchannels.imessage.groupsallowlist 동작- mention pattern 설정 (
agents.list[].groupChat.mentionPatterns)
원격 첨부 파일 가져오기가 실패함
원격 첨부 파일 가져오기가 실패함
다음 항목을 확인하세요.
channels.imessage.remoteHostchannels.imessage.remoteAttachmentRoots- gateway host에서의 SSH/SCP key auth
- gateway host의
~/.ssh/known_hosts에 host key가 있는지 - Messages가 실행 중인 Mac에서 원격 경로를 읽을 수 있는지
macOS 권한 프롬프트를 놓침
macOS 권한 프롬프트를 놓침
같은 사용자/세션 컨텍스트의 대화형 GUI terminal에서 다시 실행하고 프롬프트를 승인하세요.OpenClaw/
imsg를 실행하는 프로세스 컨텍스트에 Full Disk Access와 Automation이 모두 부여되었는지 확인하세요.