POP3 Delete
POP3 Delete
Section titled “POP3 Delete”Type: pop3-delete · Package: SMTP / IMAP Email Activities v1.0.5
Deletes an email from a POP3 server, identified by its index (the .Id returned by POP3 Read).
How it works
Section titled “How it works”Connects (port 995 with ssl by default), flags the message at position mailId for deletion and closes the session, which is when the server applies the deletion. Deletion is permanent: POP3 has no trash.
Because each activity opens its own connection, when a message is deleted the ones after it get a lower index in the next connection. If you are going to delete several emails from the same read, do it from the highest index to the lowest, or read again after each deletion.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
host | string | — | POP3 server. |
username | string | — | Username. |
password | string | — | Password, as text: use credential("name")["password"]. |
mailId | string | — | Email index (from email.Id of POP3 Read): an integer from 0. |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
port | int | 995 | POP3 port. |
security | string | "ssl" | Encryption: auto, none, ssl or starttls. |
acceptInvalidCerts | bool | false | Accepts untrusted (self-signed) TLS certificates, useful on test servers. Do not enable it against production servers. |
Output
Section titled “Output”This activity does not return a value.
Common errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
Invalid 'mailId'. It must be the numeric index returned by pop3-read. | mailId is not an integer greater than or equal to 0. Pass email.Id from POP3 Read. |
'host' is required. (and the same for username, password, mailId) | The parameter is missing or the expression returned null. |
| Index out of range error | The mailbox no longer has a message at that position (others were deleted first). Read again with POP3 Read. |
| Authentication or connection error | Same as in POP3 Read. |
Example
Section titled “Example”Read, process and delete the most recent email in the mailbox:
POP3 Read host = "pop.gmail.com" username = credential("mail-bot")["user"] password = credential("mail-bot")["password"] limit = 1 → output: emailsFor Each items = emails itemVariable = email └─ activities: ... process the email ... POP3 Delete host = "pop.gmail.com" username = credential("mail-bot")["user"] password = credential("mail-bot")["password"] mailId = email.IdRelated activities
Section titled “Related activities”- POP3 Read — get the emails to delete.
- IMAP Delete — alternative with stable UID and trash.