═══════════════════════════════════════════════════════
  NOLIMIT-X — Placeholder & Function Reference
═══════════════════════════════════════════════════════

Use in: messages.html, subjects.txt, senders.txt,
        config.json (from_name, mail_subject), attachment filenames.

───────────────────────────────────────────────────────
 CONTEXT PLACEHOLDERS
───────────────────────────────────────────────────────

{{EMAIL}}              john@company.com
{{DOMAIN}}             company.com
{{NAME}}               John Smith
{{FIRST_NAME}}         John
{{FULL_NAME}}          John Smith
{{COMPANY}}            Company Inc
{{LINK}}               Campaign link
{{SMTP_NAME}}          Sender display name
{{FROM_EMAIL}}         Sender email
{{QRCODE}}             QR code image (set qr_link in config)
{{FAVICON}}            Company favicon image
{{BASE_TAG}}           <base href> for link hiding
{{TIMESTAMP}}          2026-04-22T17:00:00.000Z
{{RANDOM}}             482719
{{LANGUAGE}}           en / fr / de / es
{{CONFIDENCE}}         0.98
{{CULTURAL_GREETING}}  Hello John,  /  Bonjour John,
{{CULTURAL_CLOSING}}   Best regards,  /  Cordialement,
{{FORMATTED_DATE}}     April 22, 2026
{{FORMATTED_NUMBER}}   1,234.56
{{CURRENCY}}           $  /  €  /  £

───────────────────────────────────────────────────────
 FUNCTION PLACEHOLDERS
───────────────────────────────────────────────────────

{{RANDOM(N)}}             {{RANDOM(5)}}          → 48271
{{STRING(N)}}             {{STRING(8)}}          → aB3kZ9mQ
{{STRING(N,type)}}        {{STRING(6,upper)}}    → KZMWRQ
                          {{STRING(4,num)}}       → 7291
                          types: alpha upper lower num mixed
{{UUID}}                  {{UUID}}               → 1ca732e5-76c1-4d5d-cf5d-ec02d97ec09d
                          RFC 4122 v4 UUID — unique per call, use multiple times freely
                          Example: {{UUID}}:{{UUID}}_{{DATE}}
                          → 1ca732e5-76c1-51d5-cf5d-ec02d97ec09d:5bd4ce97-4221-47ac-b02a-f59a94c93f6c_2026-05-26

{{UPPERCASE:text}}        {{UPPERCASE:hello}}    → HELLO
{{LOWERCASE:text}}        {{LOWERCASE:HELLO}}    → hello
{{CAPITALIZE:text}}       {{CAPITALIZE:hello world}} → Hello world
{{NAMECASE:text}}         {{NAMECASE:john doe}}  → John Doe
{{SENTENCECASE:text}}     {{SENTENCECASE:hELLO}} → Hello

{{DATE}}                  2026-04-23             (today)
{{DATE(+1)}}              2026-04-24             (tomorrow)
{{DATE(+7)}}              2026-04-30             (next week)
{{DATE(+30)}}             2026-05-23             (30 days out)
{{DATE(-1)}}              2026-04-22             (yesterday)
{{TIME}}                  17:00:00
{{TIMESTAMP}}             2026-04-22T17:00:00.000Z

{{BASE64:text}}           {{BASE64:hello}}       → aGVsbG8=
{{ENCODE:text}}           RFC 2047 base64        → =?UTF-8?B?...?=
{{QP:text}}               RFC 2047 quoted-print  → =?UTF-8?Q?...?=

───────────────────────────────────────────────────────
 NESTING
───────────────────────────────────────────────────────

{{UPPERCASE:{{NAME}}}}
{{NAMECASE:{{COMPANY}}}}
{{CAPITALIZE:{{FIRST_NAME}}}}

───────────────────────────────────────────────────────
 CONFIG — from_name
───────────────────────────────────────────────────────

"from_name": "{{COMPANY}} Support"
"from_name": "{{SMTP_NAME}}"
"from_name": ""                                        ← auto sender name
"from_name": "{{ENCODE:Apple Support <security@apple.com>}}"

───────────────────────────────────────────────────────
 CONFIG OPTIONS
───────────────────────────────────────────────────────

multiple_senders          Rotate senders.txt
subject_rotation          Rotate subjects.txt
qr_code                   Embed QR in body
qr_link                   URL encoded in QR
qr_in_attachment          QR in attachment instead of body
direct_mx                 Send directly via MX
use_nodemailer            Use Nodemailer instead of Rust
raw_smtp                  Raw SMTP mode
message_to_pdf            Convert HTML attachment to PDF
message_to_image          Screenshot messages.html and send as inline image (no attachment needed)
image_width               Viewport width for screenshot (default: 800)
image_height              Viewport height for screenshot (default: 600)
image_quality             JPEG quality 1-100 (default: 92, png ignores this)
turbo_mode                High-speed parallel sending
delay_sending             Delay between sends
delay_sending_seconds     Delay in seconds
calendar_invite           Send .ics invite with email

───────────────────────────────────────────────────────
 CLI COMMANDS
───────────────────────────────────────────────────────

nolimit send                     Send campaign
nolimit auth microsoft           Authenticate Microsoft account
nolimit auth google              Authenticate Google account
nolimit contacts                 Extract contacts → extracted/
nolimit contacts --organize      Extract all smtps.txt → extracted/<user>/
nolimit sort                     Sort emails.txt by provider → sorted/
nolimit validate safe            Validate emails (safe mode)
nolimit dkim <domain> <smtphost> Generate DKIM key pair for your domain.
                                 Resolves the SMTP server's outgoing IP,
                                 generates RSA-2048 key pair, saves private
                                 key to dkim_keys/, and prints the exact
                                 SPF + DKIM DNS records to add at your
                                 registrar. Sets "dkim": true in config.json
                                 automatically. Run once per domain.


───────────────────────────────────────────────────────
 OAUTH2 SMTP FORMAT  (smtps.txt)
───────────────────────────────────────────────────────

{
  "host": "smtp.office365.com",
  "port": 587,
  "user": "user@outlook.com",
  "name": "John Doe",
  "access_token": "...",
  "graph_token": "...",
  "refresh_token": "..."
}

───────────────────────────────────────────────────────
 DKIM SIGNING
───────────────────────────────────────────────────────

"dkim": true       Enable DKIM signing for all outgoing emails.
                   Requires running `nolimit keygen` first to
                   generate the key pair and DNS records.

"dkim": false      Disabled (default).

How it works:
  1. Run: nolimit dkim yourdomain.com smtp.host.com
  2. Add 2 TXT records at your DNS registrar (printed by the command):
       SPF:  v=spf1 ip4:<smtp_ip> ~all
       DKIM: v=DKIM1; k=rsa; p=<public_key>
             Name: <random6chars>._domainkey.yourdomain.com
             (selector is auto-generated — random 6-char string, looks like any service)
  3. "dkim": true is set in config.json automatically
  4. Every email is now cryptographically signed — DKIM passes ✓

State file: dkim_keys/.dkim-state.json (managed automatically)
Private key: dkim_keys/<domain>.pem (keep secure, never share)

The SMTP relay is still your normal smtp[] config. DKIM signs
the email at the From: domain level — the relay just delivers it.

───────────────────────────────────────────────────────
 SMART FROM: ADDRESS GENERATOR
───────────────────────────────────────────────────────

When "from_email" is empty or not set, the sender auto-generates
a realistic service-style From: address using your DKIM domain.

Examples of generated addresses:
  mailnotifications@yourdomain.com
  alertnotification@yourdomain.com
  mailoauthnotification@yourdomain.com
  securityalerts@yourdomain.com
  accountnotifications@yourdomain.com
  systemnotifications@yourdomain.com
  authsystem@yourdomain.com
  loginverification@yourdomain.com
  oauthservice@yourdomain.com
  customerservice@yourdomain.com
  billing@yourdomain.com
  noreply@yourdomain.com
  support@yourdomain.com
  updates@yourdomain.com
  ... (30+ prefix pool, rotated randomly per email)

30% of the time a short number suffix is appended:
  securityalerts42@yourdomain.com
  mailnotifications7@yourdomain.com

Config behavior:
  "from_email": ""         → auto-generate from pool (uses DKIM domain)
  "from_email": "no-reply@yourdomain.com"  → use exactly as-is, no generation

───────────────────────────────────────────────────────
 THREAD PREFIX  (Re: / Fwd: Subject Randomizer)
───────────────────────────────────────────────────────

"thread_prefix": false     Disabled (default).
"thread_prefix": true      Randomly prepends one of the following to every
                           outgoing subject line before sending:
                             Re:   RE:   Fwd:   FW:
                           Makes the email appear to be part of an existing
                           conversation thread.

Set under: configurations > agent > thread_prefix

───────────────────────────────────────────────────────
 ATTACHMENT FORMAT SWITCHING
───────────────────────────────────────────────────────

The attachment output format is determined by the filename extension.
One entry in attachments[] — just change "filename" to switch format.

  "filename": "Invoice_{{RANDOM(5)}}.pdf"    → Real PDF (Puppeteer)
  "filename": "Invoice_{{RANDOM(5)}}.png"    → Full-page screenshot
  "filename": "Invoice_{{RANDOM(5)}}.eml"    → RFC 822 email file
  "filename": "Invoice_{{RANDOM(5)}}.url"    → Windows Internet Shortcut
  "filename": "Notice.html"                  → HTML page (browser opens it)

  "path" always points to your HTML source template regardless of output format.

───────────────────────────────────────────────────────
 OBFUSCATE REDIRECT  (HTML attachment evasion)
───────────────────────────────────────────────────────

"obfuscate_redirect": false    Normal passthrough — default.
"obfuscate_redirect": true     Only works when filename ends in .html / .htm.

What it does:
  Generates a self-contained HTML page where your button is preserved
  visually but the link is hidden from gateway scanners:

  - The button href is set to "#" in the raw source (no URL visible to scanner).
  - Your {{LINK}} is base64-encoded, split into 4 chunks, and reassembled
    by a self-executing JS block the moment the page opens in the browser.
  - Gateway scanners see href="#" and base64 noise — no URL to detonate.
  - Recipient opens the attachment → browser runs JS → button href becomes
    the real link → they click → lands on your page.

  Requires: filename must end in .html or .htm.

Example:
  { "filename": "Notice.html", "obfuscate_redirect": true }

───────────────────────────────────────────────────────
 WINDOWS URL SHORTCUT  (.url attachment)
───────────────────────────────────────────────────────

  Set filename ending in .url to attach a Windows Internet Shortcut.
  File content is plain INI text — gateways do not scan it as a URL.
  On Windows: double-click opens the link in the default browser.
  On macOS / Linux / Mobile: opens as plain text (not functional).

  Example: "filename": "Document.url"

───────────────────────────────────────────────────────
 SVG ATTACHMENT  (.svg — image/svg+xml)
───────────────────────────────────────────────────────

  Set filename ending in .svg to attach a branded SVG image that opens
  the campaign link when the recipient clicks it.

  How it works:
    1. Puppeteer screenshots the resolved HTML template at email width (600px).
    2. The screenshot is base64-encoded and embedded as an SVG <image> element.
    3. The <image> is wrapped in <a xlink:href="link"> using the legacy XLink
       namespace — many scanners only parse <a href> and skip xlink:href.
    4. The outer SVG has proper metadata, a <defs> block with gradients, and
       decorative layers — it looks like a legitimate branded image asset.

  What the scanner sees: an SVG image file with a linked JPEG inside it.
  This is identical to how email signature logos and letterhead SVGs work.
  Most gateways classify it as image/svg+xml and skip deep URL inspection.

  What the recipient sees: their full branded email design as an image.
  Clicking anywhere on the image opens the campaign link in the browser.

  Fallback: if Puppeteer is unavailable, a pure-SVG branded notification
  card is generated with gradient background, company name, and a button.
  The link is still on xlink:href — the same anti-detection structure applies.

  Template: path should point to your HTML email template.
  The generator reads {{LINK}}, {{COMPANY}}, and {{NAME}} from the resolved HTML.

  Example:
    { "filename": "notification.svg", "path": "attachments/messages-svg.html" }
