
Security News
Open Source Maintainers Demand Ability to Block Copilot-Generated Issues and PRs
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
outlook-autoreply-helper
Advanced tools
A Python helper library to automatically manage Outlook auto-reply settings via the Microsoft Graph API.
A Python package that automatically manages Outlook auto-reply settings via the Microsoft Graph API. Perfect for scheduling out-of-office messages during vacations or other absences.
pip install outlook-autoreply-helper
Alternatively, you can skip the explicit installation and use uv
to run the application in an ephemeral Python environment; see below.
Register an application in Azure AD:
http://localhost
to the platform. This is needed for initial authentication when using the Interactive Flow. You do not need this setting if you are using the Device Code Flow.Calendars.Read
, MailboxSettings.ReadWrite
. Ensure you add delegated permissions, not application permissions, as the application needs to access data on behalf of the user.Create a configuration file (.env
):
app__tenant_id=<your-tenant-id>
app__client_id=<your-client-id>
app__auth_flow=interactive # or 'device_code'
absence__keyword=Vacation # Keyword to look for in the subject of the calendar event
Initialize the application:
outlook-autoreply-helper init
You will be prompted to authenticate and consent to the application accessing your calendar and mailbox settings.
If you are using uv
, you also run the application via
uvx outlook_autoreply_helper init
Run the application:
outlook-autoreply-helper run
The application will check for upcoming events and update your mailbox settings accordingly.
Again, using uv
this can also be done via
uvx outlook_autoreply_helper run
The application supports different options for storing configuration and state (e.g. access tokens) that should be shared between runs.
Store settings in environment variables or a .env
file:
# App Registration Settings
app__tenant_id=<tenant-id>
app__client_id=<client-id>
app__auth_flow=interactive # or 'device_code'
absence__keyword=Vacation # Keyword to look for in the subject of the calendar event
The remaining settings have sensible defaults and can be left out; see .env.example.
By default, the application uses the local file system to store state. For example, access tokens are cached in a local file in the current working directory to reduce the need for re-authentication. See the example in examples/local/.
For unattended server deployments, state that should be shared between runs can be stored in an Azure Key Vault. Just modify the .env file to use the keyvault cache type and provide the URL of the key vault:
...
cache__type=keyvault
cache__keyvault_url=https://<your-keyvault>.vault.azure.net
When you run locally, you may be prompted to login to the Azure account that hosts the key vault. You can do this e.g. via the Azure CLI:
az login
When the application runs in an unattended environment, you need to ensure the application can access the key vault as well. If you are deploying to an Azure Function, then you need to add an appropriate role assignment for the role Key Vault Secrets Officer for the corresponding Function App's managed identity in the key vault's IAM settings.
Note that the Azure tenant that hosts the key vault and the app registration that the application uses to manage the calendar and mailbox settings for a user may reside in different tenants. See examples/az_keyvault_cache/ for an example.
In addition to storing caches in Azure Key Vault, you can also store all or parts of the configuration there.
Simply set the environment variable AZURE_KEY_VAULT_URL
to the URL of the corresponding key vault.
Each setting can then be stored as a secret in the key vault; see the Pydantic documentation for details. This is particularly useful to store the auto-reply templates for unattended operation, since they can still be easily changed by the user without the need to redeploy the application.
See ./examples/az_keyvault_cache_and_settings/ for an example.
Customize your auto-reply messages using Jinja2 templates. Variables available in templates:
vacation_start
: Start date of absencevacation_end
: End date of absenceExample template:
I am out of office from {{ vacation_start | date }} to {{ vacation_end | date }}.
I will respond to your message after my return.
The custom filter date
formats the date in the desired format. You can change it to any format supported by Python's strftime
function via the Γ bsence__date_format` setting in the configuration:
...
absence__date_format=%Y-%m-%d
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the Apache License, Version 2.0 - see the LICENSE file for details.
FAQs
A Python helper library to automatically manage Outlook auto-reply settings via the Microsoft Graph API.
We found that outlook-autoreply-helper demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Β It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Research
Security News
Malicious Koishi plugin silently exfiltrates messages with hex strings to a hardcoded QQ account, exposing secrets in chatbots across platforms.
Research
Security News
Malicious PyPI checkers validate stolen emails against TikTok and Instagram APIs, enabling targeted account attacks and dark web credential sales.