Environment Setup
Environment File Overview
MailTrixy uses a .env file for all configuration. If you used the Web Installer, this file was created automatically — you don't need to edit it manually.
Most users don't need this page. The Web Installer handles everything. This page is only for users who want to change settings later or set up optional features like AI, WhatsApp, or cloud storage.
Application Settings
APP_NAME="MailTrixy" APP_ENV=production APP_KEY=base64:generated-key-here APP_DEBUG=false APP_TIMEZONE=UTC APP_URL=https://yourdomain.com APP_LOCALE=en APP_FALLBACK_LOCALE=en
| Variable | Description |
|---|---|
APP_NAME | Application name displayed in emails and the UI |
APP_ENV | Environment mode: production, local, or staging |
APP_KEY | Encryption key (auto-generated by installer or php artisan key:generate) |
APP_DEBUG | Set to false in production. Shows detailed errors when true |
APP_TIMEZONE | Server timezone (e.g., UTC, America/New_York, Asia/Kolkata) |
APP_URL | Full URL of your installation (used for generating links in emails) |
Database Configuration
DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=mailtrixy_db DB_USERNAME=your_db_user DB_PASSWORD=your_db_password
MailTrixy supports MySQL 5.7+ and MariaDB 10.3+. The database must use the utf8mb4 character set for proper emoji and multi-language support.
Shared Hosting: On some shared hosts, the database host may be different from127.0.0.1. Check your hosting panel for the correct MySQL hostname (e.g.,mysql.hostinger.com).
Mail / SMTP Configuration
This configures how MailTrixy sends system emails (password resets, verification emails, subscription notifications). This is separate from the email accounts users connect for their inbox.
MAIL_MAILER=smtp
MAIL_HOST=smtp.example.com
MAIL_PORT=587
MAIL_USERNAME=your@email.com
MAIL_PASSWORD=your_smtp_password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=no-reply@yourdomain.com
MAIL_FROM_NAME="${APP_NAME}"
Common SMTP providers:
| Provider | Host | Port | Encryption |
|---|---|---|---|
| Gmail | smtp.gmail.com | 587 | TLS |
| Outlook / Office 365 | smtp.office365.com | 587 | TLS |
| Amazon SES | email-smtp.us-east-1.amazonaws.com | 587 | TLS |
| Mailgun | smtp.mailgun.org | 587 | TLS |
| SendGrid | smtp.sendgrid.net | 587 | TLS |
SMTP can also be configured via the Admin Panel: Admin → System Settings → SMTP.
OAuth Configuration (Gmail, Outlook, GitHub)
OAuth is used for two purposes: (1) social login for users, and (2) connecting Gmail/Outlook accounts to the inbox via OAuth instead of app passwords.
Gmail OAuth
# Gmail OAuth (for inbox connection & social login)
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_REDIRECT_URI=${APP_URL}/auth/google/callback
To obtain credentials:
- Go to Google Cloud Console
- Create a project (or select existing)
- Enable the Gmail API and Google+ API
- Go to Credentials → Create Credentials → OAuth 2.0 Client ID
- Set the authorized redirect URI to:
https://yourdomain.com/auth/google/callback
Outlook / Microsoft OAuth
# Microsoft OAuth (for inbox connection & social login)
MICROSOFT_CLIENT_ID=your_microsoft_client_id
MICROSOFT_CLIENT_SECRET=your_microsoft_client_secret
MICROSOFT_REDIRECT_URI=${APP_URL}/auth/microsoft/callback
To obtain credentials:
- Go to Azure Portal → Azure Active Directory → App Registrations
- Register a new application
- Set the redirect URI to:
https://yourdomain.com/auth/microsoft/callback - Under Certificates & Secrets, create a new client secret
- Under API Permissions, add:
Mail.Read,Mail.Send,User.Read,offline_access
GitHub OAuth
# GitHub OAuth (social login only)
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
GITHUB_REDIRECT_URI=${APP_URL}/auth/github/callback
Go to GitHub Developer Settings → OAuth Apps → New OAuth App. Set the callback URL to: https://yourdomain.com/auth/github/callback.
AI Provider Configuration
MailTrixy supports four AI providers for generating email replies, summaries, and knowledge base answers. You can enable one or multiple providers simultaneously.
# OpenAI (GPT-4o, GPT-4, GPT-3.5-turbo) OPENAI_API_KEY=sk-your-openai-key OPENAI_MODEL=gpt-4o # Anthropic (Claude 3.5 Sonnet, Claude 3 Haiku) ANTHROPIC_API_KEY=sk-ant-your-anthropic-key ANTHROPIC_MODEL=claude-3-5-sonnet-20241022 # Google Gemini (Gemini 1.5 Pro, Gemini 1.5 Flash) GEMINI_API_KEY=your-gemini-api-key GEMINI_MODEL=gemini-1.5-pro # Mistral (Mistral Large, Mistral Medium, Mistral Small) MISTRAL_API_KEY=your-mistral-api-key MISTRAL_MODEL=mistral-large-latest
| Provider | Get API Key | Best For |
|---|---|---|
| OpenAI | platform.openai.com | General-purpose replies, high accuracy |
| Anthropic | console.anthropic.com | Long-form responses, nuanced tone |
| Google Gemini | aistudio.google.com | Cost-effective, fast responses |
| Mistral | console.mistral.ai | European data residency, multilingual |
AI providers can also be configured via the Admin Panel: Admin → AI Configuration.
Stripe Payment Configuration
# Stripe STRIPE_KEY=pk_live_your_publishable_key STRIPE_SECRET=sk_live_your_secret_key STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret
To set up Stripe:
- Go to Stripe Dashboard
- Get your API keys from Developers → API Keys
- Create a webhook endpoint at
https://yourdomain.com/webhooks/stripe - Select events:
checkout.session.completed,customer.subscription.updated,customer.subscription.deleted,invoice.payment_succeeded,invoice.payment_failed
Note: Stripe is one of 40+ supported payment gateways. Other gateways (PayPal, Razorpay, Mollie, etc.) are configured through the Admin Panel: Admin → Payment Gateways.
Channel Configuration
WhatsApp (Meta Cloud API)
# WhatsApp Business API
WHATSAPP_TOKEN=your_whatsapp_access_token
WHATSAPP_PHONE_NUMBER_ID=your_phone_number_id
WHATSAPP_BUSINESS_ACCOUNT_ID=your_business_account_id
WHATSAPP_VERIFY_TOKEN=your_custom_verify_token
WHATSAPP_WEBHOOK_URL=${APP_URL}/webhooks/whatsapp
SMS (Twilio)
# Twilio SMS TWILIO_SID=your_account_sid TWILIO_AUTH_TOKEN=your_auth_token TWILIO_FROM_NUMBER=+1234567890
Telegram
# Telegram Bot
TELEGRAM_BOT_TOKEN=your_bot_token
TELEGRAM_WEBHOOK_URL=${APP_URL}/webhooks/telegram
Create a bot via @BotFather on Telegram and use the provided token.
Slack
# Slack Integration SLACK_BOT_TOKEN=xoxb-your-bot-token SLACK_SIGNING_SECRET=your_signing_secret SLACK_APP_ID=your_app_id
Create a Slack app at api.slack.com/apps. Required scopes: chat:write, channels:history, im:history, users:read.
Storage Configuration
# Default: local filesystem FILESYSTEM_DISK=local # Amazon S3 (or S3-compatible: DigitalOcean Spaces, MinIO, Wasabi) AWS_ACCESS_KEY_ID=your_access_key AWS_SECRET_ACCESS_KEY=your_secret_key AWS_DEFAULT_REGION=us-east-1 AWS_BUCKET=your_bucket_name AWS_URL=https://your-bucket.s3.amazonaws.com AWS_USE_PATH_STYLE_ENDPOINT=false
To use S3 storage, change FILESYSTEM_DISK=s3. For S3-compatible providers like DigitalOcean Spaces or Wasabi, set the AWS_ENDPOINT variable:
# DigitalOcean Spaces AWS_ENDPOINT=https://nyc3.digitaloceanspaces.com # Wasabi AWS_ENDPOINT=https://s3.wasabisys.com
Storage settings can also be managed via: Admin → System Settings → Storage.
Queue Configuration
QUEUE_CONNECTION=database
The default database driver works out of the box on all hosting environments. For higher performance on VPS, you can switch to Redis:
QUEUE_CONNECTION=redis REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379
See the Queue & Cron Setup page for detailed configuration of queue workers and scheduled tasks.
Broadcasting (Real-time)
# Pusher (recommended for shared hosting) BROADCAST_CONNECTION=pusher PUSHER_APP_ID=your_app_id PUSHER_APP_KEY=your_app_key PUSHER_APP_SECRET=your_app_secret PUSHER_APP_CLUSTER=mt1 # OR Laravel Reverb (self-hosted, for VPS) BROADCAST_CONNECTION=reverb REVERB_APP_ID=your_app_id REVERB_APP_KEY=your_app_key REVERB_APP_SECRET=your_app_secret REVERB_HOST=0.0.0.0 REVERB_PORT=8080
Broadcasting is used for real-time inbox updates, live chat notifications, and workflow execution feedback. It is optional — the application works without it, but the UI will not update in real time.
Complete .env Reference
Below is a complete .env file with all available variables and their default values:
APP_NAME="MailTrixy"
APP_ENV=production
APP_KEY=
APP_DEBUG=false
APP_TIMEZONE=UTC
APP_URL=https://yourdomain.com
APP_LOCALE=en
APP_FALLBACK_LOCALE=en
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=mailtrixy_db
DB_USERNAME=root
DB_PASSWORD=
MAIL_MAILER=smtp
MAIL_HOST=smtp.example.com
MAIL_PORT=587
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=no-reply@yourdomain.com
MAIL_FROM_NAME="${APP_NAME}"
QUEUE_CONNECTION=database
CACHE_STORE=database
SESSION_DRIVER=database
FILESYSTEM_DISK=local
BROADCAST_CONNECTION=log
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_REDIRECT_URI=${APP_URL}/auth/google/callback
MICROSOFT_CLIENT_ID=
MICROSOFT_CLIENT_SECRET=
MICROSOFT_REDIRECT_URI=${APP_URL}/auth/microsoft/callback
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
GITHUB_REDIRECT_URI=${APP_URL}/auth/github/callback
OPENAI_API_KEY=
OPENAI_MODEL=gpt-4o
ANTHROPIC_API_KEY=
ANTHROPIC_MODEL=claude-3-5-sonnet-20241022
GEMINI_API_KEY=
GEMINI_MODEL=gemini-1.5-pro
MISTRAL_API_KEY=
MISTRAL_MODEL=mistral-large-latest
STRIPE_KEY=
STRIPE_SECRET=
STRIPE_WEBHOOK_SECRET=
WHATSAPP_TOKEN=
WHATSAPP_PHONE_NUMBER_ID=
WHATSAPP_BUSINESS_ACCOUNT_ID=
WHATSAPP_VERIFY_TOKEN=
WHATSAPP_WEBHOOK_URL=${APP_URL}/webhooks/whatsapp
TWILIO_SID=
TWILIO_AUTH_TOKEN=
TWILIO_FROM_NUMBER=
TELEGRAM_BOT_TOKEN=
TELEGRAM_WEBHOOK_URL=${APP_URL}/webhooks/telegram
SLACK_BOT_TOKEN=
SLACK_SIGNING_SECRET=
SLACK_APP_ID=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1