🔍 Code Extractor

Browse Components

Showing 20 of 2143 components

  • function get_o365_token

    Retrieves an OAuth 2.0 access token for Microsoft 365 using the client credentials flow to authenticate with Microsoft Graph API.

    File: /tf/active/vicechatdev/email-forwarder/src/utils/auth.py | Lines: 6-30

    oauth authentication microsoft-365 graph-api token
  • function log_debug

    A logging utility function that writes debug-level messages to a logger named 'EmailForwarder'.

    File: /tf/active/vicechatdev/email-forwarder/src/utils/logger.py | Lines: 70-71

    logging debug utility email-forwarding diagnostics
  • function log_error

    Logs an error message using a named logger instance for the EmailForwarder application.

    File: /tf/active/vicechatdev/email-forwarder/src/utils/logger.py | Lines: 67-68

    logging error-handling debugging monitoring email-forwarder
  • function log_warning

    Logs a warning message using a named logger instance for the EmailForwarder application.

    File: /tf/active/vicechatdev/email-forwarder/src/utils/logger.py | Lines: 64-65

    logging warning email-forwarder monitoring diagnostics
  • function log_info

    Logs an informational message using a logger named 'EmailForwarder'.

    File: /tf/active/vicechatdev/email-forwarder/src/utils/logger.py | Lines: 61-62

    logging info email-forwarder utility wrapper
  • function validate_config

    Validates the presence of required Microsoft 365 configuration settings and raises an error if any are missing.

    File: /tf/active/vicechatdev/email-forwarder/src/config/settings.py | Lines: 59-76

    validation configuration microsoft-365 ms365 error-handling
  • function get_env_value

    Retrieves an environment variable value by key and automatically strips surrounding single or double quotes if present.

    File: /tf/active/vicechatdev/email-forwarder/src/config/settings.py | Lines: 7-14

    environment-variables configuration string-processing utility env
  • class EmailHandler

    EmailHandler is a comprehensive email processing class that parses incoming email data, extracts content and attachments, enforces rate limits, and forwards emails via Office 365 using the O365Client.

    File: /tf/active/vicechatdev/email-forwarder/src/forwarder/email_handler.py | Lines: 26-354

    email smtp email-parsing email-forwarding office365
  • function run_smtp_server

    Initializes and runs an asynchronous SMTP server using a new event loop, with proper error handling and graceful shutdown.

    File: /tf/active/vicechatdev/email-forwarder/src/forwarder/smtp_server.py | Lines: 140-157

    smtp email server async asyncio
  • class SMTPServer

    SMTPServer is a class that manages an SMTP server for receiving emails, handling their forwarding, and providing server statistics.

    File: /tf/active/vicechatdev/email-forwarder/src/forwarder/smtp_server.py | Lines: 66-137

    smtp email server async networking
  • class EmailForwardingHandler

    SMTP message handler class that processes incoming email messages and forwards them using an EmailHandler instance while tracking server statistics.

    File: /tf/active/vicechatdev/email-forwarder/src/forwarder/smtp_server.py | Lines: 24-63

    smtp email async aiosmtpd email-forwarding
  • class O365Client

    A client class for interacting with Microsoft 365 Graph API to send emails with authentication, validation, and attachment support.

    File: /tf/active/vicechatdev/email-forwarder/src/forwarder/o365_client.py | Lines: 21-260

    email microsoft-365 graph-api oauth2 authentication
  • function run_server

    Initializes and runs an asynchronous SMTP server with platform-specific event loop configuration and error handling.

    File: /tf/active/vicechatdev/email-forwarder/src/main.py | Lines: 75-93

    server smtp asyncio event-loop windows-compatibility
  • function print_banner

    Prints a formatted ASCII banner displaying the Email Forwarder application's configuration settings including version, SMTP settings, message size limits, and debug status.

    File: /tf/active/vicechatdev/email-forwarder/src/main.py | Lines: 20-33

    banner display startup configuration ascii-art
  • class TestEmailHandler

    A unit test class that validates the functionality of the EmailHandler class, specifically testing email forwarding success and failure scenarios using mocked O365Client dependencies.

    File: /tf/active/vicechatdev/email-forwarder/tests/test_email_handler.py | Lines: 6-54

    unit-testing email mocking test-case email-forwarding
  • class TestSmtpServer

    A test class for validating the functionality of the SmtpServer class, including server startup, email handling, email forwarding, and error handling for invalid inputs.

    File: /tf/active/vicechatdev/email-forwarder/tests/test_smtp_server.py | Lines: 5-30

    testing unit-test smtp email mock
  • function check_service_stats

    Validates that the email forwarding service can retrieve operational statistics by instantiating an EmailHandler and calling its get_stats() method.

    File: /tf/active/vicechatdev/email-forwarder/test_e2e.py | Lines: 59-78

    health-check diagnostics service-monitoring email-service statistics
  • function send_test_email_v1

    Sends a test email to a local SMTP server (127.0.0.1:2525) to verify email forwarding functionality and service connectivity.

    File: /tf/active/vicechatdev/email-forwarder/test_e2e.py | Lines: 26-57

    email testing smtp integration-test email-forwarding
  • function test_smtp_connection

    Tests the SMTP connection to a local email forwarder service running on port 2525 by establishing a connection and performing an EHLO handshake.

    File: /tf/active/vicechatdev/email-forwarder/test_e2e.py | Lines: 12-24

    smtp email connection-test health-check network
  • function test_configuration_v3

    A test function that validates the presence and loading of required Microsoft 365 and SMTP configuration settings from a settings module.

    File: /tf/active/vicechatdev/email-forwarder/test_imports.py | Lines: 52-75

    configuration validation testing microsoft-365 oauth