adding message viewer - fixing log view, change to aiosmtplib
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#!/bin/bash
|
||||
# apt-get install -y swaks
|
||||
receiver="info@example.com"
|
||||
EMAIL_SERVER="localhost" #"pymta.example.com" "localhost"
|
||||
EMAIL_SERVER_auth="10.100.111.1" # IP for authenticated server ( not localhost), use your main interface ip
|
||||
@@ -14,17 +15,12 @@ cc_recipient="ccrecipient@example.com"
|
||||
bcc_recipient="bccrecipient@example.com"
|
||||
|
||||
<<com
|
||||
python -m email_server.cli_tools add-domain $domain
|
||||
python -m email_server.cli_tools add-user $username $password $domain
|
||||
python -m email_server.cli_tools add-ip 127.0.0.1 $domain
|
||||
python -m email_server.cli_tools add-ip 213.249.224.235 $domain
|
||||
python -m email_server.cli_tools generate-dkim $domain
|
||||
python -m email_server.cli_tools add-custom-header $domain X-Auth-Token "abc123-example-auth"
|
||||
python -m email_server.cli_tools add-custom-header $domain X-Server-ID "mail01.example.com"
|
||||
|
||||
# options to add CC and BCC recipients for swaks
|
||||
--cc $cc_recipient
|
||||
--bcc $bcc_recipient
|
||||
--cc $cc_recipient \
|
||||
--bcc $bcc_recipient \
|
||||
--header "To: $receiver" \
|
||||
--header "Cc: $cc_recipient" \
|
||||
|
||||
swaks --to $receiver \
|
||||
--from $sender \
|
||||
|
||||
Binary file not shown.
+1
-1
@@ -4,7 +4,7 @@ import ssl
|
||||
import argparse
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--port', type=int, default=4025)
|
||||
parser.add_argument('--porttls', type=int, default=40587)
|
||||
parser.add_argument('--porttls', type=int, default=40465)
|
||||
parser.add_argument('--recipient', type=str, default="test@target-email.com")
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
"""
|
||||
Debug script to test database operations.
|
||||
"""
|
||||
|
||||
import sys
|
||||
import os
|
||||
import sqlite3
|
||||
|
||||
# Add current directory to path
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
print("Testing database operations...")
|
||||
|
||||
# Test direct SQLite connection
|
||||
try:
|
||||
conn = sqlite3.connect('smtp_server.db')
|
||||
cursor = conn.cursor()
|
||||
|
||||
# Check tables
|
||||
cursor.execute("SELECT name FROM sqlite_master WHERE type='table';")
|
||||
tables = cursor.fetchall()
|
||||
print(f"Tables in database: {[table[0] for table in tables]}")
|
||||
|
||||
# Check domains
|
||||
cursor.execute("SELECT * FROM domains;")
|
||||
domains = cursor.fetchall()
|
||||
print(f"Domains: {domains}")
|
||||
|
||||
conn.close()
|
||||
print("Direct SQLite test successful")
|
||||
|
||||
except Exception as e:
|
||||
print(f"Direct SQLite test failed: {e}")
|
||||
|
||||
# Test SQLAlchemy models
|
||||
try:
|
||||
from email_server.models import Session, Domain, User, WhitelistedIP, create_tables
|
||||
print("Models imported successfully")
|
||||
|
||||
# Create session
|
||||
session = Session()
|
||||
|
||||
# Check domains
|
||||
domains = session.query(Domain).all()
|
||||
print(f"SQLAlchemy domains: {[(d.id, d.domain_name) for d in domains]}")
|
||||
|
||||
session.close()
|
||||
print("SQLAlchemy test successful")
|
||||
|
||||
except Exception as e:
|
||||
print(f"SQLAlchemy test failed: {e}")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
Reference in New Issue
Block a user