ElektoMailPosh.psd1
|
# # Module manifest for module 'ElektoMailPosh' # # Generated by: JP Negri # # Generated on: 2024-12-19 # @{ # Script module or binary module file associated with this manifest. RootModule = 'ElektoMailPosh.psm1' # Version number of this module. ModuleVersion = '2.0.4' # Supported PSEditions CompatiblePSEditions = @('Core') # ID used to uniquely identify this module GUID = '663950f9-1b51-4cef-ad96-2ad771df86c7' # Author of this module Author = 'JP Negri' # Company or vendor of this module CompanyName = 'Elekto Produtos Financeiros' # Copyright statement for this module Copyright = '(c) 2024-2026 Elekto Produtos Financeiros. Licensed under the MIT License.' # Description of the functionality provided by this module Description = 'Lightweight SMTP email module for PowerShell. Zero dependencies, several sending accounts like msmtp (passwords in the Windows Credential Manager or an owner-only file) or environment-based configuration, automatic retry with exponential backoff. Perfect for CI/CD pipelines, automation scripts, and scheduled tasks.' # Minimum version of the PowerShell engine required by this module PowerShellVersion = '7.4' # Name of the PowerShell host required by this module # PowerShellHostName = '' # Minimum version of the PowerShell host required by this module # PowerShellHostVersion = '' # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # DotNetFrameworkVersion = '' # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # ClrVersion = '' # Processor architecture (None, X86, Amd64) required by this module # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module # RequiredModules = @() # Assemblies that must be loaded prior to importing this module # RequiredAssemblies = @() # Script files (.ps1) that are run in the caller's environment prior to importing this module. # ScriptsToProcess = @() # Type files (.ps1xml) to be loaded when importing this module # TypesToProcess = @() # Format files (.ps1xml) to be loaded when importing this module # FormatsToProcess = @() # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess # NestedModules = @() # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. FunctionsToExport = @('Send-Mail', 'Get-MailAccount', 'Set-MailAccount', 'Remove-MailAccount') # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. CmdletsToExport = @() # Variables to export from this module VariablesToExport = @() # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. AliasesToExport = @() # DSC resources to export from this module # DscResourcesToExport = @() # List of all modules packaged with this module # ModuleList = @() # List of all files packaged with this module # FileList = @() # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. PrivateData = @{ PSData = @{ # Tags applied to this module. These help with module discovery in online galleries. Tags = @( 'Email', 'SMTP', 'Mail', 'Send-Mail', 'Notification', 'Automation', 'CI-CD', 'DevOps', 'GitHub-Actions', 'Azure-Pipelines', 'Lightweight', 'Simple', 'Environment-Variables', 'Accounts', 'Reply-To', 'Cross-Platform', 'PSEdition_Core', 'Windows', 'Linux', 'macOS' ) # A URL to the license for this module. LicenseUri = 'https://github.com/elekto-com-br/ElektoMailPosh/blob/main/LICENSE' # A URL to the main website for this project. ProjectUri = 'https://github.com/elekto-com-br/ElektoMailPosh' # ReleaseNotes of this module ReleaseNotes = @' ## 2.0.4 - An accounts file that cannot be read stops the command, saying so. It was taken for an empty one: Send-Mail went back to the SMTP_* environment variables, and Set-MailAccount wrote the new account over the others (a file its owner could write but not read it left empty, and every account was lost) - accounts.json is written beside itself and then put in its place, so a write that fails leaves the previous file whole. Outside Windows the new file keeps the mode of the old one, and a file that is a link (into a dotfiles repository, say) stays a link, the change going to the file it points to - On macOS the folder is ~/.config/ElektoMailPosh (or XDG_CONFIG_HOME), as the README said, and the same as on Linux: since .NET 8 it was ~/Library/Application Support/ElektoMailPosh. That folder is still used while the new one has no accounts.json; the README says how to move it - Two accounts whose names give the same password variable, such as work.prod and work-prod (both SMTP_PASS_WORK_PROD), are refused, in the file and by Set-MailAccount for a new account: with the variable set, one sent the password of the other to its own server - Remove-MailAccount deletes the password before it removes the account from the file, and a password that cannot be deleted stops it. Before, the account was removed and its password left behind, with no account to show it, and reported as deleted - A failure of the password store, or of putting the accounts file in its place, stops Set-MailAccount and Remove-MailAccount: an error of .NET (of the Windows Credential Manager, say) ended only its own statement, and the command went on as if it had worked - When accounts.json cannot be replaced, the error says so, and on Windows that another program may have the file open: .NET says only "Access to the path is denied" - Set-MailAccount says why a stored password cannot be used (a file it cannot read, or one that others can read), rather than that the account has none - The README's command that removes the SMTP_* variables on Windows deletes them on PowerShell 7.5 and later too, where it left them in place, empty, and removes SMTP_REPLY_TO as well - Account names are checked alike in every culture, and take only the letters A to Z: a name with a dotless i was taken in a session in Turkish, and one with a dotted capital I in any session, and the accounts file was then refused in sessions in other cultures. A file that holds such a name is now refused everywhere: rename that account - In a session in Turkish, Get-MailAccount, Remove-MailAccount and the completion of account names find an account whatever the case of the i in its name: "Remove-MailAccount work-inbox" missed the account WORK-INBOX ## 2.0.3 - accounts.json is read ignoring case, as account names already were: "default" and "accounts" written in lower case were taken for an empty file, and Send-Mail went back to the SMTP_* environment variables without a word - Two accounts whose names differ only in case, or a key or setting written twice in different case, are an error; before, one of them was dropped without a word ## 2.0.2 - Send-Mail takes its parameters by position again, in the order of 1.x (Subject, Body, IsHtml, FromName, To, Cc, Bcc, Priority, Attachments), so scripts written for 1.x, such as Send-Mail $subject $body $true, work unchanged; 2.0.0 and 2.0.1 took them only by name. The parameters added in 2.0 take names only - Tests, run with Pester before each release, call Send-Mail the way scripts written for 1.x do ## 2.0.1 - Remove-MailAccount takes several names, wildcards and the accounts piped from Get-MailAccount; Remove-MailAccount * removes every account and its stored password, so Send-Mail goes back to the SMTP_* environment variables - The README says that upgrading from 1.x needs only the update, and warns that a Windows scheduled task set to "Do not store password" (S4U) cannot read the Credential Manager - Copyright 2024-2026 ## 2.0.0 - Requires PowerShell 7.4 or later; Windows PowerShell 5.1 is no longer supported - Accounts, like those of msmtp: Set-MailAccount, Get-MailAccount and Remove-MailAccount keep named sets of SMTP settings (server, port, user, sender, default recipients), and Send-Mail -Account sends from one of them, or from the default account - Account passwords go to the Windows Credential Manager, or on Linux and macOS to a file only its owner can read; the SMTP_PASS_<ACCOUNT> environment variable takes precedence - Set-MailAccount -FromEnvironment moves a configuration in SMTP_* environment variables to an account - Added -ReplyTo parameter (default: the account's ReplyTo or the SMTP_REPLY_TO environment variable) - Added -BodyFile parameter, for long messages: the body is read from a UTF-8 file, and an .html or .htm file is sent as HTML - Added -MessageId, -InReplyTo and -References parameters, so a follow-up (an alert and then its resolution, or a reply) shows in the same conversation - A sender display name with commas or quotes no longer breaks the From header ## 1.0.1 - The copyright in the manifest names Elekto Produtos Financeiros, as the LICENSE does ## 1.0.0 - Added -Cc and -Bcc parameters (defaults: SMTP_CC and SMTP_BCC environment variables) - -To now accepts multiple addresses (array or comma-separated list, also in SMTP_TO) - Added SMTP_FROM_NAME environment variable as the default sender display name - Body can come from the pipeline; piped lines are joined and sent as a single email - Added -Priority parameter (Low, Normal, High) ## 0.2.1 - Fixed empty default sender display name (-FromName) on Linux and macOS: now uses [Environment]::MachineName instead of $env:COMPUTERNAME - X-Mailer header now reads the version from the module manifest - Module loader builds the Public path with Join-Path instead of a hard-coded backslash ## 0.2.0 - Added file attachments support (-Attachments parameter) - Added automatic retry with exponential backoff - Added X-Mailer header per RFC 2076 - Environment-based configuration for CI/CD compatibility - PowerShell 5.1+ compatibility '@ } # End of PSData hashtable } # End of PrivateData hashtable # HelpInfo URI of this module # HelpInfoURI = '' # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. # DefaultCommandPrefix = '' } |