本文へ移動
cccskills
無料GitHub で公開日本語紹介

configuration-messaging

メール、ファイル、SQLiteのメッセージ送信先や配信ワーカーを設定し、登録通知などの送信経路をCaddyfileで組み立てるスキルです。

原文原文の説明を見る

Configure email, file and SQLite messaging providers, bounded delivery workers, SMTP transport, sender credentials and registration notifications.

greenpau/caddy-securityスター 2,270(GitHub 2,270 + cccskills 0)

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • 登録通知のSMTP送信を設定したいとき
  • メール本文をファイルに出力して確認したいとき
  • SQLiteキューで通知を受け付けたいとき
  • 登録フローに送信プロバイダーを接続したいとき

日本語での紹介

できること

Caddyfileでメール、ファイル、SQLiteのメッセージプロバイダーを設定し、登録フローなどから名前で参照できる送信経路を組み立てます。メールではSMTPまたはSMTPS、送信元、認証情報を指定できます。ファイルプロバイダーは.emlを保存し、SQLiteプロバイダーはメッセージをローカルのキューに受け付けます。配信先をメールプロバイダーに結び付けると、ワーカーがキューから送信します。

こんなときに便利

登録確認、パスワード回復、MFAのワンタイムコード、管理通知などのメッセージ送信を設定するときに使えます。SMTP接続を使わず、ファイル出力でレンダリング内容を確かめたい場合にも向いています。SQLiteキューを使う場合は、送信の受け付けと実際の配信を分けて構成できます。

使い方の例

  • 「登録確認メールを送るSMTPプロバイダーを設定してください」
  • 「通知をSQLiteのキューに保存し、SMTPで配信する設定にしてください」
  • 「メール本文をファイルプロバイダーに出力する設定例を作ってください」

注意点

SMTPは平文接続、または証明書検証付きのSMTPSに対応し、STARTTLSへの切り替えはできません。SQLiteの保存先は既存のプライベートな親ディレクトリ内に置き、本文・宛先・確認コードはディスク上で平文です。キュー配信はSMTP受け付け後に重複する可能性があります。BCCはSMTPの宛先には追加されず、ヘッダーに残る制約があります。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

含まれるファイル(2)

  • SKILL.md10.9 KB
  • agents/openai.yaml214 B

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Configuration Messaging

Purpose

Use this skill to configure messaging <kind> provider <name> blocks. The built-in parser is caddyfile_messaging.go; companion modules use caddyfile_messaging_backend.go. The app owns runtime bindings and delivery.

Messaging is most often needed by registration flows, password recovery, MFA OTP, or administrative notifications.

caddyfile_messaging.go forwards provider subdirectives directly to go-authcrunch/pkg/messaging. Use the authcrunch instruction names exactly; for example, file providers use root_dir, not rootdir.

Email Provider

{
	security {
		messaging email provider localhost-smtp-server {
			address 127.0.0.1:1025
			protocol smtp
			credentials smtp_root
			sender root@example.com "Example Auth Portal"
			bcc admin@example.com audit@example.com
			template password_recovery templates/password_recovery.tmpl
			template registration_confirmation templates/registration_confirmation.tmpl
			template registration_ready templates/registration_ready.tmpl
			template registration_verdict templates/registration_verdict.tmpl
			template mfa_otp templates/mfa_otp.tmpl
		}
	}
}

Email providers require:

  • address <host:port>.
  • protocol smtp or protocol smtps.
  • Exactly one of credentials <name> or passwordless.
  • sender <email> [display_name].

Use passwordless instead of credentials <name> when the SMTP server does not require authentication.

smtp opens a plaintext SMTP connection; the sender does not negotiate STARTTLS. smtps uses implicit TLS with certificate verification. A server requiring STARTTLS is not supported by switching protocol smtp to port 587. Use an endpoint that supports the chosen transport; there is no Caddyfile STARTTLS or custom SMTP CA directive here.

The referenced credentials <name> object follows configuration-credentials.

For local registration message checks, use the built-in file provider below with a disposable root_dir under this checkout's tmp/; no SMTP tool install is needed. This verifies rendered content, not SMTP authentication, TLS or recipient delivery. When the task requires SMTP evidence, use an explicitly configured loopback test server and synthetic credentials, inspect its envelope recipients as well as message headers, and stop it after the check. Keep any added test tooling and its output in the repository and pin its version.

File Provider

messaging file provider local_outbox {
	root_dir tmp/registration-messages
	sender root@example.com "Example Auth Portal"
	template registration_confirmation templates/registration_confirmation.tmpl
	template registration_ready templates/registration_ready.tmpl
	template registration_verdict templates/registration_verdict.tmpl
}

File providers write .eml messages under root_dir. Authcrunch requires both root_dir <path> and sender <email> [display_name]. File providers do not use credentials or passwordless.

Email providers put bcc <email>... into a Bcc message header but do not add those addresses to SMTP RCPT TO. Do not rely on it for copy delivery or recipient privacy: recipients can see that header. This is an upstream sender limitation, not configurable Caddy behavior. File providers parse and preserve bcc, but the file sender writes only To; it also omits the configured sender from the .eml content.

Both email and file providers validate and preserve these template IDs:

  • password_recovery.
  • registration_confirmation.
  • registration_ready.
  • registration_verdict.
  • mfa_otp.

Template Directive

Use template <id> <path> to add an entry to the provider's templates map. Authcrunch validates the ID and preserves the path, but the provider parser does not check that the path exists.

Current registration notification rendering does not load provider template paths. It uses embedded English subject/body templates from the sibling go-authcrunch repository, then sends the rendered message through the configured provider.

Default messaging template files live under: https://github.com/greenpau/go-authcrunch/tree/main/pkg/messaging/email_templates/en The embedded asset loader strips email_templates/ and .template, so registration_confirmation_subject.template is looked up as en/registration_confirmation_subject.

Default files by validated template ID:

  • registration_confirmation: registration_confirmation_subject.template and registration_confirmation_body.template.
  • registration_ready: registration_ready_subject.template and registration_ready_body.template.
  • registration_verdict: registration_verdict_subject.template and registration_verdict_body.template.
  • password_recovery: no default messaging subject/body file in pkg/messaging/email_templates; password recovery UI lives in the portal sandbox template, not in the messaging template library.
  • mfa_otp: no default messaging subject/body file in pkg/messaging/email_templates.

Registration Wiring

Registration flows reference messaging providers by name with the historical email provider <name> directive. The referenced provider may be email, file or a bound SQLite outbox. AuthCrunch selects it by exact name at send time. An outbox receives no SMTP credentials; its independently selected delivery transport receives them only when the worker sends.

user registration signup {
	email provider localhost-smtp-server
	admin email admin@example.com
}

The registration block belongs to configuration-registrations.

SQLite outbox

{
 security {
  messaging email provider smtp-local {
   address 127.0.0.1:1025
   protocol smtp
   passwordless
   sender auth@example.test
  }
  messaging sqlite provider notifications {
   path /var/lib/caddy-security/mail/outbox.db
   timeout 1s
   delivery smtp-local
  }
 }
}

The security.messaging.sqlite module appears in native JSON under apps.security.messaging_providers, with driver, name, path, optional timeout and optional delivery. Names must be unique across modules and built-ins. The public SQLite parser owns name/path/timeout validation. Fields are literal; they do not expand Caddy placeholders or secret lookups. Existing email-provider and credential instructions retain runtime resolution.

path is an absolute local POSIX database in an existing private 0700 parent; its database and sidecars use 0600. Use a separate file from other plugin categories. Runtime construction can create the outbox; parsing and module validation perform no storage I/O. Storage is pure Go and requires no SQLite process or cgo. Bodies, recipients and confirmation codes are plaintext on disk. timeout defaults to 1s and accepts 1ms through 30s for database operations.

Optional delivery selects an existing email provider, whose sender, protocol and credentials apply to every message in this queue. It cannot select another outbox or a file provider. Missing or ambiguous credentials fail before storage opens. Omission queues messages without starting a delivery worker; an external consumer must own delivery. Registration references the queue using email provider notifications.

Send success means durable local acceptance. The shared file permits 1000 outstanding messages across all named queues; full storage rejects admission without eviction. Transactions obtain exclusive access before mutation; ordinary reader/writer contention waits within the database deadline before admission. Failed or uncertain acceptance must not be blindly retried. The app rebuilds private runtime bindings after JSON restoration and never serializes handles or delivery credentials into message records.

Workers start only in App.Start. Each claim has a one-minute exclusive lease; the worker uses its exact persisted expiry, reserves five seconds for acknowledgement, and caps an SMTP attempt at fifteen seconds. Claim and acknowledgement contexts are bounded to five seconds, subject to any shorter queue timeout. Empty or failed attempts poll at one-second intervals. Failed or uncertain delivery remains leased until expiry; there is no immediate resend, lease renewal or dead-letter queue. A commit error can quarantine its handle; drain and reopen the runtime before reconciling uncertain work. The worker does not automatically reopen storage or reinterpret an error as non-acceptance. Independent workers can share a named queue. A crash after SMTP acceptance and before acknowledgement may duplicate delivery; applications needing deduplication must provide it downstream.

Cleanup closes request admission and drains producers, then cancels and joins workers before closing the root and queues. Cancellation closes the actual SMTP socket, including greeting, TLS handshake, DATA and QUIT stalls. A successful send still gets a bounded acknowledgement when cleanup starts concurrently. Validation-only candidates never send mail. A candidate that reaches Start may deliver before an unrelated app fails; Caddy startup has no transaction spanning external SMTP side effects. Queued work and outstanding leases survive restart. Other restrictions, including local identity/dropbox overlap, still apply.

Registration renders quoted-printable HTML. The worker preserves those bytes and the email sender supplies matching MIME headers; it does not double encode or reinterpret content. General queue callers must honor that body contract. Logs report fixed failure phases without recipients, bodies, codes, credentials, leases or raw transport diagnostics. bcc retains the built-in sender limitation above; queue delivery does not turn a header into an envelope recipient.

Validation surfaces

plugins/messaging-sqlite/consumer_test.go and ownership_test.go cover public parsing, private storage, independent queue handles, stale leases and durable reopen. Root messaging_sqlite_test.go retains dispatch, native loading and adaptation. app_messaging_test.go covers binding validation, candidate cleanup and producer drain; app_messaging_worker_test.go covers budgets, cancellation, failure redaction and concurrent workers. app_messaging_e2e_test.go exercises actual TLS Caddy registration, SMTP envelope/body delivery, queue errors, restart and shutdown. Legacy registration confirmation writes a dropbox record; it does not implicitly activate a login account. Dedicated registration workflows have their own owner.

Adaptation cases include testcase_messaging_sqlite and testcase_authenticate_with_registration in testdata/caddyfile_adapt/. File output checks alone do not verify SMTP authentication, TLS or recipients. Use a disposable loopback server and synthetic credentials for transport tests; inspect RCPT TO separately from headers and close all test-owned connections.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

authentication-portal-api

無料概要あり

認証ポータルのログインやトークン更新、プロフィール、管理APIを利用するHTTPクライアントの仕様確認とトラブル対応を支援します。

  • ポータル向けJSONログインを実装したいとき
  • ブラウザーのトークン更新を調べたいとき
  • ネイティブ認証APIを扱いたいとき
greenpau/caddy-security2,2702026年10月28日 更新

break-fix-troubleshooting

無料概要あり

Caddyの認証・認可まわりで起きた設定や実行時の障害を、設定ファイル、ログ、バージョン、HTTPの証拠から切り分け、最小修正や調査報告にまとめます。

  • ログイン障害の原因を調べたいとき
  • OIDCやSAMLの失敗を切り分けたいとき
  • 最小限の設定修正を探したいとき
greenpau/caddy-security2,2702026年10月28日 更新

coding-directives

無料概要あり

caddy-securityのGoコードやCaddyモジュール、Caddyfileパーサー、HTTP連携の実装・レビューで、境界やライフサイクル、エラー処理の規約を確認するスキルです。

  • Caddyfileパーサーの変更をレビューしたいとき
  • CaddyモジュールやHTTP処理を実装したいとき
  • アプリの起動・終了処理を確認したいとき
greenpau/caddy-security2,2702026年10月28日 更新

configuration

無料概要あり

caddy-securityのCaddyfile全体を作成・点検し、認証方式に合う設定ガイドを選びながらsecurityアプリとHTTPルートを配線するスキルです。

  • Caddyfile全体を作成したいとき
  • 認証ポータルをルートに接続したいとき
  • 保護対象パスに認可ポリシーを設定したいとき
greenpau/caddy-security2,2702026年10月28日 更新

Caddyの認証ポータルとルートへの認証処理を設定し、利用するログイン元やリダイレクト先の信頼条件、更新機能などを組み立てるスキルです。

  • 認証ポータルを新しく構成したいとき
  • ログインに使うストアやプロバイダーを選びたいとき
  • 保護ルートをポータル認証につなぎたいとき
greenpau/caddy-security2,2702026年10月28日 更新

認証ポータルのCookie名や接頭辞、属性、ドメインを設定し、認可ポリシーが探すトークンCookieとの対応を整えます。

  • ポータルのCookie名を一括で変更したいとき
  • Cookie属性やドメインを調整したいとき
  • 更新トークン用Cookie名を上書きしたいとき
greenpau/caddy-security2,2702026年10月28日 更新

greenpau のスキルをすべて見る

このスキルの問題を報告する