
Security News
Node.js Homepage Adds Paid Support Link, Prompting Contributor Pushback
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
An automated email reply system with configurable rules and templates.
pip install email-autoreply-bot
email-autoreply-bot --create-config
Edit the generated config.yaml
file with your email settings and preferences.
Run the bot:
email-autoreply-bot
The bot is configured using a YAML file. Here's an overview of the configuration options:
imap:
server: imap.example.com
port: 993
username: your_email@example.com
password: your_password
ssl: true
smtp:
server: smtp.example.com
port: 465
username: your_email@example.com
password: your_password
use_ssl: true
# Format for dates in messages
date_format: "%A, %B %d, %Y"
# When the auto-reply should be active
date_range:
start: "2023-12-24"
end: "2024-01-02"
# How many hours of past emails to check on startup
backfill_hours: 24
# How often to check for new emails (in seconds)
check_interval: 300
autoreply:
subject: "Re: {original_subject} - Out of Office"
message: |
Hello {sender_name},
Thank you for your email regarding "{original_subject}".
I am currently out of the office from {start_date} until {end_date}.
I will respond to your message when I return on {return_date}.
For urgent matters, please contact support@example.com.
Best regards,
Your Name
# CC settings
cc_include_to: false # Include original To recipients in CC
cc_include_cc: false # Include original CC recipients in CC
rules:
# If specified, ONLY these patterns will receive replies
allowlist:
- "@company\\.com$"
- "@client\\.org$"
# These patterns will never receive autoreplies
denylist:
- "noreply@"
- "donotreply@"
- "automated@"
The bot can be configured to only send auto-replies during a specific date range. This is useful for vacation periods, holidays, or other out-of-office scenarios.
date_range:
start: "2024-12-24" # Start date (beginning of day)
end: "2025-01-02" # End date (end of day)
You can specify dates in several formats:
Date only (recommended for simplicity):
start: "2024-12-24" # December 24, 2024 at 00:00:00
end: "2025-01-02" # January 2, 2025 at 23:59:59
Date with time:
start: "2024-12-24 17:00:00" # December 24, 2024 at 5:00 PM
end: "2025-01-02 09:00:00" # January 2, 2025 at 9:00 AM
ISO 8601 format:
start: "2024-12-24T17:00:00" # December 24, 2024 at 5:00 PM
end: "2025-01-02T09:00:00" # January 2, 2025 at 9:00 AM
You can configure the bot to CC other recipients of the original email on your auto-reply:
autoreply:
# Other autoreply settings...
# CC settings
cc_include_to: false # Include original To recipients in CC
cc_include_cc: false # Include original CC recipients in CC
If both settings are false
, the bot will only reply to the original sender.
imap:
server: imap.example.com
port: 993 # Standard SSL port for IMAP
username: your_email@example.com
password: your_password
ssl: true # Use SSL/TLS for connection
ssl_context: null # Options: null (default), "default", "trusted", or path to cert file
verify_ssl: true # Verify SSL certificates
sent_folder: "Sent" # Folder to save sent autoreplies
ssl
: Whether to use SSL/TLS for the connection (recommended)ssl_context
: SSL context configuration:
null
: Use system default SSL context"default"
: Create a default SSL context"trusted"
: Create a context for trusted clients/path/to/cert.pem
: Path to a custom certificate fileverify_ssl
: Whether to verify SSL certificates (recommended for security)sent_folder
: Folder to save sent autoreplies - if unset, the bot will not save sent messagessmtp:
server: smtp.example.com
port: 465 # SSL port for SMTP
username: your_email@example.com
password: your_password
use_ssl: true # Use SSL for connection (port 465)
use_tls: false # Use STARTTLS (usually with port 587)
ssl_context: null # Options: null (default), "default", "trusted", or path to cert file
verify_ssl: true # Verify SSL certificates
timeout: 30 # Connection timeout in seconds
use_ssl
: Use SSL/TLS from the start of the connection (typically port 465)use_tls
: Use STARTTLS to upgrade an unencrypted connection (typically port 587)ssl_context
: SSL context configuration (same options as IMAP)verify_ssl
: Whether to verify SSL certificatestimeout
: Connection timeout in secondsThe following placeholders can be used in the subject and message templates:
{sender_name}
- The name of the sender{sender_email}
- The email address of the sender{original_subject}
- The subject of the original email{date}
- The current date{current_date}
- The current date (same as {date}){message_snippet}
- A snippet of the original message{original_message}
- The full body of the original message{start_date}
- The start date of your out-of-office period{end_date}
- The end date of your out-of-office period{return_date}
- The date you'll return (day after end_date)usage: email-autoreply-bot [-h] [-c CONFIG] [--create-config] [--overwrite] [-v]
Email Autoreply Bot - Automatically reply to incoming emails based on rules
options:
-h, --help show this help message and exit
-c CONFIG, --config CONFIG
Path to configuration file (default: config.yaml)
--create-config Create a default configuration file
--overwrite Overwrite existing configuration file when using --create-config
-v, --verbose Enable verbose logging
You can theoretically also use the Email Autoreply Bot as a library in your own Python code:
from email_autoreply_bot import EmailAutoreplyBot, create_default_config
# Create a default config file if needed
create_default_config('my_config.yaml')
# Initialize and run the bot
bot = EmailAutoreplyBot('my_config.yaml')
bot.run()
chmod 600 config.yaml
)This project is licensed under the MIT License - see the LICENSE file
FAQs
An email auto-reply bot with configurable rules and templates
We found that email-autoreply-bot 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
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.
Research
Security News
The Socket Research Team investigates a malicious Python typosquat of a popular password library that forces Windows shutdowns when input is incorrect.