Knowledge base

1000 FAQs, 500 tutorials and instructional videos. Here, there are only solutions!

Troubleshooting email errors ($ in the password)

Update 09/01/2026

This guide details the specific rules to follow when using a password containing the “dollar” character $ to send an email via the Infomaniak SMTP in a script (PowerShell, Python, etc.).

 

Introduction

  • If you receive an authentication error (e.g., auth failed, invalid login or password) when sending an email via SMTP, even though the password is correct and works in software like Outlook, the problem may be due to how the $ character is handled in your script or configuration file.
  • To ensure reliable execution of your SMTP scripts, it is strongly recommended to avoid using any special characters with syntactic meaning, especially $, in the passwords used in scripts and configuration files.
  • The problem may also occur when connecting to databases.

 

Rules to follow

The $ character is a special symbol in many languages and environments. When used in a password within a script or configuration file, it may be incorrectly interpreted as a variable or control character.

Here are some common cases where you should not use the $ character in a password:

  • PowerShell: $ is used to declare variables. A password containing $ may cause syntax errors or be truncated.
  • Bash / Shell (Linux): $ is also a variable prefix. It may trigger unexpected substitutions.
  • YAML files (e.g., Home Assistant, GitHub Actions, Docker Compose): $ can be interpreted as an environment variable.
  • .env, .ini files, or other configuration files: the tools that read these files may attempt to interpret the variables.
  • Commands or URLs with authentication: a password containing $ may be incorrectly encoded or fail during parsing.

 

To correct or prevent this type of error:

  • Avoid using the $ character in passwords intended for use in scripts or automated systems.
  • If you absolutely must use it, always enclose the password string correctly according to the language:
    • In PowerShell: use single quotes 'password$Test' if possible.
    • In Python: ensure that the string is properly enclosed in single or double quotes, without interpretation.
    • In Bash: escape the $ with a backslash \$.

Has this FAQ been helpful?