searchEmails
Searches for emails sent to a specific username and returns parsed email data. Function signature:Parameters
The username portion of the email address to search for (without the
@zapmail.parth.lol domain).The function automatically formats this into the full recipient address with angle brackets.Example: "user123" is formatted to "<user123@zapmail.parth.lol>"Returns
An array of email objects, ordered by received date (most recent first).
Unique database identifier for the email.
Timestamp when the email was received by the server.
The username extracted from the recipient field.
The full recipient address in angle bracket format.
The parsed email content object returned by
parseEmail.Example
Error handling
Throws an error if the database query fails. Individual email parsing errors are logged but do not stop processing of other emails. Source: ui/src/app/actions/actions.ts:6-49parseEmail
Parses raw email data into a structured format using the mailparser library. Function signature:Parameters
Raw email data in RFC 822 format (headers and body).This is typically the raw SMTP DATA content stored in the database.
Returns
A parsed email content object.
The email subject line. Empty string if not present.
The sender’s email address in text format. Empty string if not present.
Plain text version of the email body. Empty string if not present.
HTML version of the email body. Empty string if not present.
Plain text converted to HTML format. Empty string if not present.
Array of email attachments. Empty array if no attachments.
The date from the email headers. Defaults to current date if not present.