From 427ef022bb5bc9a28a707fbb1efe08a72286b7ab Mon Sep 17 00:00:00 2001 From: Kablersalat Date: Wed, 19 Mar 2025 01:10:02 +0100 Subject: less swearing and first public push --- config/config.env | 20 ++++++++++++++++++++ config/emailproxy-auth.config | 22 ++++++++++++++++++++++ config/emailproxy.config | 22 ++++++++++++++++++++++ config/nginx-emailproxy.conf | 24 ++++++++++++++++++++++++ 4 files changed, 88 insertions(+) create mode 100644 config/config.env create mode 100644 config/emailproxy-auth.config create mode 100644 config/emailproxy.config create mode 100644 config/nginx-emailproxy.conf (limited to 'config') diff --git a/config/config.env b/config/config.env new file mode 100644 index 0000000..44f2099 --- /dev/null +++ b/config/config.env @@ -0,0 +1,20 @@ +EMAILPROXY_EXECUTABLE=/home/crt/.local/bin/emailproxy +EMAILPROXY_LOG_FILE=/home/crt/helper-emailproxy/logs/python/proxy.log +EMAILPROXY_CONFIG_FILE=/home/crt/helper-emailproxy/config/emailproxy.config +EMAILPROXY_AUTH_CONFIG=/home/crt/helper-emailproxy/config/emailproxy-auth.config +COMMAND_PORT=8765 +ALLOWED_DOMAINS=example.com +DEBUG_WEB=true +DEBUG_WEB_LOG_FILE=/home/crt/helper-emailproxy/logs/php/webui.log + +# Mail server settings for client configuration +MAIL_SERVER_NAME=172.16.57.101 +MAIL_IMAP_PORT=1993 +MAIL_SMTP_PORT=1465 +MAIL_IMAP_SSL=false +MAIL_SMTP_SSL=false +MAIL_IMAP_PROTOCOL=IMAP +MAIL_SMTP_PROTOCOL=SMTP + +# Admin contact +SYSADMIN_EMAIL=hostmaster@example.com diff --git a/config/emailproxy-auth.config b/config/emailproxy-auth.config new file mode 100644 index 0000000..7bc4bb1 --- /dev/null +++ b/config/emailproxy-auth.config @@ -0,0 +1,22 @@ +[IMAP-2993] +server_address = outlook.office365.com +server_port = 993 +local_address = 0.0.0.0 + +[SMTP-2465] +server_address = smtp.office365.com +server_port = 465 +local_address = 0.0.0.0 + +[@rafisa.ch] +permission_url = https://login.microsoftonline.com/common/oauth2/v2.0/authorize +token_url = https://login.microsoftonline.com/common/oauth2/v2.0/token +oauth2_scope = https://outlook.office.com/IMAP.AccessAsUser.All https://outlook.office.com/POP.AccessAsUser.All https://outlook.office.com/SMTP.Send offline_access +redirect_uri = https://login.microsoftonline.com/common/oauth2/nativeclient +client_id = 9e5f94bc-e8a4-4e73-b8be-63364c29d753 +client_secret = + +[emailproxy] +delete_account_token_on_password_error = False +use_login_password_as_client_credentials_secret = True +allow_catch_all_accounts = True \ No newline at end of file diff --git a/config/emailproxy.config b/config/emailproxy.config new file mode 100644 index 0000000..b464145 --- /dev/null +++ b/config/emailproxy.config @@ -0,0 +1,22 @@ +[IMAP-1993] +server_address = outlook.office365.com +server_port = 993 +local_address = 0.0.0.0 + +[SMTP-1465] +server_address = smtp.office365.com +server_port = 465 +local_address = 0.0.0.0 + +[@example.com] +permission_url = https://login.microsoftonline.com/common/oauth2/v2.0/authorize +token_url = https://login.microsoftonline.com/common/oauth2/v2.0/token +oauth2_scope = https://outlook.office.com/IMAP.AccessAsUser.All https://outlook.office.com/POP.AccessAsUser.All https://outlook.office.com/SMTP.Send offline_access +redirect_uri = https://login.microsoftonline.com/common/oauth2/nativeclient +client_id = 9e5f94bc-e8a4-4e73-b8be-63364c29d753 +client_secret = + +[emailproxy] +delete_account_token_on_password_error = False +use_login_password_as_client_credentials_secret = True +allow_catch_all_accounts = True diff --git a/config/nginx-emailproxy.conf b/config/nginx-emailproxy.conf new file mode 100644 index 0000000..60ac318 --- /dev/null +++ b/config/nginx-emailproxy.conf @@ -0,0 +1,24 @@ +crt@tc-rafisa-eproxy ~/helper-emailproxy (main)> cat /etc/nginx/conf.d/emailproxy-ui.conf +server { + listen 8080; + server_name _; + + root /var/www/emailproxy-ui; + index index.php; + + access_log /home/crt/helper-emailproxy/logs/nginx/nginx-access.log; + error_log /home/crt/helper-emailproxy/logs/nginx/nginx-error.log; + + location / { + try_files $uri $uri/ =404; + } + + location ~ \.php$ { + include snippets/fastcgi-php.conf; + fastcgi_pass unix:/run/php/php8.2-fpm.sock; # maybe ajust this if u got older version yk + } + + location ~ /\.ht { + deny all; + } +} \ No newline at end of file -- cgit v1.2.3-70-g09d2