Back to all work

Engineering · Support Mail API A backend that turns app support requests into email.

An API-only backend for validated, rate-limited support requests from approved mobile applications.

CONTRIBUTION
Syed Shahbaz HussainBackend application engineering
PLATFORM / STATUS
Node.js server runtime · Engineering project
TOOLS
Next.js · TypeScript · Zod · Upstash Redis
THE PRODUCT

The problem
and the approach.

The challenge

A support form is also an untrusted network entry point. Missing validation can produce malformed emails, repeated taps can send duplicate messages and unrestricted attachments can be costly or unsafe to process. Email credentials and delivery decisions need to remain on the server.

The approach

A focused API accepts JSON from approved applications, validates and normalizes it, applies persistent rate limits and acquires a duplicate lock before sending. One optional supported image is decoded within bounds, stripped of metadata and re-encoded. SMTP stays server-side, and Redis retains abuse-control state and duplicate digests rather than support submissions. The backend has no public dashboard to illustrate with product screenshots.

Who it helps

Mobile applications that need to send user-initiated support requests without embedding SMTP credentials in the app.

A typical workflow

  1. An approved application submits the user’s support message and an optional image.
  2. The server validates the request, applies abuse controls and prepares a sanitized attachment if present.
  3. The mailer delivers the message through SMTP and returns a response for the app to handle.
MAIN FEATURES
/01

Validated requests

Strict request schemas and bounded bodies support predictable processing.

/02

Abuse controls

Persistent rate limits, duplicate locks, and honeypot handling protect the request path.

/03

Email delivery

Escaped message bodies and sanitized optional image attachments are delivered through SMTP.

ENGINEERING

How it
is built.

Keeping mail credentials on the server

Approved mobile apps send support requests to a server endpoint instead of carrying SMTP credentials. The request path checks the origin when present, bounds the JSON body, validates it with Zod, and applies persistent rate limits before delivery. A claimed app identifier is part of validation, not proof that a caller is an authentic app installation.

Treating an attachment as untrusted input

An optional image is decoded with size and pixel limits, checked against its declared format, resized, and re-encoded as a new JPEG without the original metadata. The server chooses the attachment filename. This keeps client-supplied paths, filenames, and raw image metadata out of the delivered attachment.

Coordinating delivery and retries

An atomic Redis lock suppresses duplicate sends within its retention window. The request fingerprint uses a keyed digest. If SMTP fails, the service attempts to release the pending lock so a retry can proceed. Redis retains abuse-control state and duplicate digests; the support message is delivered by email rather than stored as a database record. These notes describe the source reviewed on October 17, 2026.

OUTCOME

A focused backend project connecting approved applications to support email, with validation, abuse controls, and bounded attachment handling.

MORE PROJECTS

Other projects.

All projects
FULL-TIME ROLES

Hiring a
React Native developer?

I’m open to full-time roles, remote or onsite.

CONTACT ME