ElektoImapPosh

0.9.0

Read email by IMAP from PowerShell, from several accounts (Gmail and Google Workspace first): list folders, search messages and Gmail threads, read them as text, save attachments or a message whole, without marking anything as read. Passwords in the Windows Credential Manager or an owner-only file, or configuration by environment variables. Built on MailKitLite and Mi
Read email by IMAP from PowerShell, from several accounts (Gmail and Google Workspace first): list folders, search messages and Gmail threads, read them as text, save attachments or a message whole, without marking anything as read. Passwords in the Windows Credential Manager or an owner-only file, or configuration by environment variables. Built on MailKitLite and MimeKitLite.
Show more

Minimum PowerShell version

7.6

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name ElektoImapPosh

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name ElektoImapPosh

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

(c) 2026 Elekto Produtos Financeiros. Licensed under the MIT License.

Package Details

Author(s)

  • JP Negri

Tags

Email IMAP Mail Gmail Google-Workspace Inbox Attachments Automation Accounts MailKit MimeKit Cross-Platform Windows Linux macOS

Functions

Get-ImapAccount Set-ImapAccount Remove-ImapAccount Test-ImapAccount Get-ImapPolicy Set-ImapPolicy Remove-ImapPolicy Get-ImapFolder Get-ImapMessage Get-ImapThread Read-ImapMessage Save-ImapAttachment Save-ImapMessage

PSEditions

Core

Dependencies

This module has no dependencies.

Release Notes

## 0.9.0
- The first version. It reads mail by IMAP and changes nothing in the mailbox: folders are opened read-only and bodies fetched without setting \Seen, so nothing is marked as read. Until 1.0, commands, parameters and settings may still change, as use shows what they should be
- Accounts apart from those of ElektoMailPosh, each with an app password of its own, kept in the Windows Credential Manager or in a file only its owner can read: Set-ImapAccount, Get-ImapAccount, Remove-ImapAccount, and Test-ImapAccount, which connects and shows how. Without accounts, the IMAP_* environment variables
- Always TLS, unless an account says NoTls, meant for tests; SkipCertificateCheck for a server with a certificate of its own
- Get-ImapFolder lists the folders with their counts; Get-ImapMessage searches them by sender, subject, date and unread, newest first, and Gmail by its own search (-Query); Get-ImapThread lists the messages of a Gmail conversation
- Read-ImapMessage returns the text of a message without downloading its attachments; Save-ImapAttachment saves its attachments, and with -Inline the images shown in its body, under names safe on every platform and, on Windows, with the Mark of the Web; Save-ImapMessage saves one message whole, as an .eml
- Policies, for giving the module to an AI agent: folders that may not be read, senders whose messages and attachments may be read (as authenticated by the receiving server), attachments by type and by name, sizes, age and counts. A message withheld still shows its metadata, and why it is withheld. The README says what a policy does not do
- What a sender writes comes back without the characters that drive a terminal or hide text, and cut where it would flood the context of an AI agent
- Gmail and Google Workspace first (labels, conversations, the folders whose names Gmail translates), on standard IMAP, so that other servers work too

FileList

Version History

Version Downloads Last updated
0.9.0 (current version) 9 11/11/2026