I have ping office.com and smtp.office365.com on my screen capture.you ping a different domain, this says nothing about the configured SMTP server being reachable.
I have ping office.com and smtp.office365.com on my screen capture.you ping a different domain, this says nothing about the configured SMTP server being reachable.
apt-get update && apt-get upgrade -y
apt install -y git python3-pip
rm /usr/lib/python3.11/EXTERNALLY-MANAGED
git clone https://github.com/simonrob/email-oauth2-proxy/
cd email-oauth2-proxy
apt install python3.11-venv
python3 -m venv .env
python3 -m pip install -U pip
python3 -m pip install -r requirements-core.txt
systemctl edit --force --full emailproxy.service
Add the following text and save:
[Unit]
Description=Email OAuth 2.0 Proxy
[Service]
ExecStart=/root/email-oauth2-proxy/.env/bin/python3 /root/email-oauth2-proxy/emailproxy.py --external-auth --no-gui
Restart=always
[Install]
WantedBy=multi-user.target
root@pve:~/email-oauth2-proxy# /root/email-oauth2-proxy/.env/bin/python3 /root/email-oauth2-proxy/emailproxy.py --external-auth --no-gui
Traceback (most recent call last):
File "/root/email-oauth2-proxy/emailproxy.py", line 55, in <module>
from cryptography.fernet import Fernet, MultiFernet, InvalidToken
ModuleNotFoundError: No module named 'cryptography'
root@pve:~/email-oauth2-proxy#
I gave it a try today but i get an error when trying to start the proxy.
I´m not sure if it is a good idea anyway. While installing python, there was a message that the server is externally managed and that python is installed under the root user.
Here´s what i have done so far:
When i try to start the proxy, i get the following error:Code:apt-get update && apt-get upgrade -y apt install -y git python3-pip rm /usr/lib/python3.11/EXTERNALLY-MANAGED git clone https://github.com/simonrob/email-oauth2-proxy/ cd email-oauth2-proxy apt install python3.11-venv python3 -m venv .env python3 -m pip install -U pip python3 -m pip install -r requirements-core.txt systemctl edit --force --full emailproxy.service Add the following text and save: [Unit] Description=Email OAuth 2.0 Proxy [Service] ExecStart=/root/email-oauth2-proxy/.env/bin/python3 /root/email-oauth2-proxy/emailproxy.py --external-auth --no-gui Restart=always [Install] WantedBy=multi-user.target
I already tried to reinstall the cryptography module as suggested by various websites but that didn´t change a thing.Code:root@pve:~/email-oauth2-proxy# /root/email-oauth2-proxy/.env/bin/python3 /root/email-oauth2-proxy/emailproxy.py --external-auth --no-gui Traceback (most recent call last): File "/root/email-oauth2-proxy/emailproxy.py", line 55, in <module> from cryptography.fernet import Fernet, MultiFernet, InvalidToken ModuleNotFoundError: No module named 'cryptography' root@pve:~/email-oauth2-proxy#
Any suggestions..?
PVE notification target configuration
[ATTACH type="full"]72174[/ATTACH]
Oauth 2 proxy installation and configuration
apt-get update && apt-get upgrade -y
apt install -y git python3-pip
rm /usr/lib/python3.11/EXTERNALLY-MANAGED
git clone https://github.com/simonrob/email-oauth2-proxy/
cd email-oauth2-proxy
apt install -y python3.11-venv
python3 -m venv .env
source .env/bin/activate
python3 -m pip install -U pip
python3 -m pip install -r requirements-core.txt
Add account:
nano /root/email-oauth2-proxy/emailproxy.config
Insert und save (use your own e-mail address and data from entra instead of xxxx):
[admin@xyz.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.office365.com/IMAP.AccessAsUser.All https://outlook.office365.com/POP.AccessAsUser.All https://outlook.office365.com/SMTP.Send offline_access
redirect_uri = https://login.microsoftonline.com/common/oauth2/nativeclient
client_id = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
client_secret = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Starting the proxy manually:
/root/email-oauth2-proxy/.env/bin/python3 /root/email-oauth2-proxy/emailproxy.py --external-auth --no-gui
Send a test e-mail:
[ATTACH type="full"]72175[/ATTACH]
OAuth2 proxy authentication:
Follow the instructions shown in the terminal: Copy the URL that is shown in the terminal and paste it into the address field of your browser (private tab recommended). Log in to your O365 account. You should see a blank/white page. Copy that URL, paste it into the terminal and press enter. Wait a few seconds and stop the proxy with STRG+C.
Run proxy automatically at startup:
sudo systemctl enable --now emailproxy
systemctl edit --force --full emailproxy.service
Insert and save:
[Unit]
Description=Email OAuth 2.0 Proxy
[Service]
ExecStart=/root/email-oauth2-proxy/.env/bin/python3 /root/email-oauth2-proxy/emailproxy.py --external-auth --no-gui
Restart=always
[Install]
WantedBy=multi-user.target
Reboot your PVE Server and send a test e-mail once again.
Spam filter?Thats strange...
It works when sending a test e-mail via the webui but it doesn´t work for my backup job, even though the log says the mail was sent:
INFO: notified via target `<admin@xyz.com>`
Atm, i have no clue why.
Did you enable the target in the "Notification Matcher"?
View attachment 72194
Oauth 2 proxy installation and configuration:
apt-get update && apt-get upgrade -y
apt install -y git python3-pip
cd /opt
git clone https://github.com/simonrob/email-oauth2-proxy/
cd email-oauth2-proxy
apt install -y python3.11-venv
python3 -m venv .env
source .env/bin/activate
python3 -m pip install -U pip
python3 -m pip install -r requirements-core.txt
Add account:
nano /opt/email-oauth2-proxy/emailproxy.config
Insert und save (use your own e-mail address and data from entra instead of xxxx):
[admin@xyz.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.office365.com/IMAP.AccessAsUser.All https://outlook.office365.com/POP.AccessAsUser.All https://outlook.office365.com/SMTP.Send offline_access
redirect_uri = https://login.microsoftonline.com/common/oauth2/nativeclient
client_id = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
client_secret = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Starting the proxy manually:
/opt/email-oauth2-proxy/.env/bin/python3 /opt/email-oauth2-proxy/emailproxy.py --external-auth --no-gui
Send a test e-mail
OAuth2 proxy authentication:
Follow the instructions shown in the terminal: Copy the URL that is shown in the terminal and paste it into the address field of your browser (private tab recommended). Log in to your O365 account. You should see a blank/white page. Copy that URL, paste it into the terminal and press enter. Wait a few seconds and stop the proxy with STRG+C.
Run proxy automatically at startup:
nano /etc/systemd/system/emailproxy.service
Insert and save:
[Unit]
Description=Email OAuth 2.0 Proxy
[Service]
ExecStart=/opt/email-oauth2-proxy/.env/bin/python3 /opt/email-oauth2-proxy/emailproxy.py --external-auth --no-gui
Restart=always
[Install]
WantedBy=multi-user.target
systemctl enable --now emailproxy
Reboot your PVE Server and send a test e-mail once again.
Execute your backupjob. A notification should be sent.