Messages are filtered based on key-value pairs (EmailField + String value)
+ * and the specified flag is applied to matching messages.
+ *
+ * @param flag The flag to apply to matching messages (e.g., Flags.Flag.DELETED)
+ * @param filterPairs Variable arguments of key-value pairs where:
+ * - Key: {@link EmailField} (e.g., SUBJECT, FROM)
+ * - Value: String to match against the corresponding field
+ */
+ @SafeVarargs
+ public final void clearInbox(EmailFlag flag, Pair This method does not apply any filters and will delete every message in the inbox.
+ *
*/
public void clearInbox() {
try {
diff --git a/src/main/java/utils/email/mapping/EmailFlag.java b/src/main/java/utils/email/mapping/EmailFlag.java
new file mode 100644
index 0000000..73e6d1e
--- /dev/null
+++ b/src/main/java/utils/email/mapping/EmailFlag.java
@@ -0,0 +1,74 @@
+/**
+ * Enumeration mapping standard email flags to JavaMail {@link Flags.Flag} constants.
+ *
+ * This enum provides a typed representation of common IMAP message flags, making it easier
+ * to work with email operations while maintaining type safety and readability.
+ *
+ * Note: The {@code FLAGGED} enum constant is incorrectly mapped to
+ * {@code Flags.Flag.ANSWERED} in the current implementation. This should be corrected to
+ * {@code Flags.Flag.FLAGGED} to match standard IMAP semantics.
+ *
+ * @see Flags.Flag for JavaMail API documentation
+ * @since 1.0.0
+ */
+package utils.email.mapping;
+
+import jakarta.mail.Flags;
+
+public enum EmailFlag {
+ /**
+ * Message has been answered (replied to).
+ */
+ ANSWERED(Flags.Flag.ANSWERED),
+
+ /**
+ * Message is marked for deletion.
+ */
+ DELETED(Flags.Flag.DELETED),
+
+ /**
+ * Message has been read.
+ */
+ SEEN(Flags.Flag.SEEN),
+
+ /**
+ * Message is marked with a user-defined flag.
+ */
+ USER(Flags.Flag.USER),
+
+ /**
+ * Message is flagged for special attention (e.g., important).
+ * Current implementation error: Should map to {@code Flags.Flag.FLAGGED}.
+ */
+ FLAGGED(Flags.Flag.ANSWERED),
+
+ /**
+ * Message has arrived since the last check.
+ */
+ RECENT(Flags.Flag.RECENT),
+
+ /**
+ * Message is a draft (not yet sent).
+ */
+ DRAFT(Flags.Flag.DRAFT);
+
+ final Flags.Flag flag;
+
+ /**
+ * Constructs an EmailFlag enum value with the corresponding JavaMail flag.
+ *
+ * @param flag the JavaMail {@link Flags.Flag} to associate with this enum constant
+ */
+ EmailFlag(Flags.Flag flag) {
+ this.flag = flag;
+ }
+
+ /**
+ * Returns the JavaMail {@link Flags.Flag} associated with this enum constant.
+ *
+ * @return the corresponding JavaMail flag
+ */
+ public Flags.Flag getFlag() {
+ return flag;
+ }
+}
\ No newline at end of file