For when your IT admin is blocking automatic email forwarding from Outlook to addresses outside your organization, but you want to do it anyway.
- Clone this repository:
git clone https://github.com/Alyetama/Force-Forward-Outlook.git
cd Force-Forward-Outlook
- Install dependencies:
- If you want to use Docker, skip this step.
pip install -r requirements.txt
- Download and install
Rclone
if you haven't already. Then, create a new remote if you don't have one.
rclone config create mydrive drive
- Create directories
emails/sent
:
# Replace `mydrive` with your actual remote name if different
rclone mkdir mydrive:emails/sent
- Log in to your outlook account, then go to Microsoft Power Automate.
- Click
+ Create
->Automated cloud flow
-> pick a name -> underChoose your flow's trigger
searchWhen a new email arrives
(make sure to select the correct service! If you have a school/work email, it's probablyOffice 365 Outlook
, otherwise,Outlook
). - Click
Create
, then sign in to your Outlook email account and selectInbox
underFolder
. - Add a new step, then search for the cloud storage provider that you used for rclone (e.g., Google Drive) -> select
Create File
. - Under
Folder path
type:emails
. UnderFile name
click onAdd dynamic content
, then search and selectMessage Id
. UnderFile content
, click onAdd dynamic content
, then search and selectBody
(the one that starts with a capital letter). - Save, then test your workflow to make sure everything is setup correctly.
- In the repository directory, rename
.env.example
to.env
:
mv .env.example .env
- Then open it in your favorite text editor and fill out the variables value.
FROM_EMAIL
: The email you want to send from (use a Gmail address here!).FROM_EMAIL_PASSWORD
: The password of the email you want to send from (see note bleow)*.TO_EMAIL
: Your outlook email address where automatic forwarding is disabled.REMOTE_NAME
: The name of the rclone remote you used in Step 2 (e.g.,mydrive
).
*Important note: FROM_EMAIL_PASSWORD
should not be your standrad email password! Use an app password instead.
python forwardgod.py
# or in the background:
nohup python forwardgod.py &
docker run -d --env-file .env \
--restart unless-stopped \
-v "$(dirname $(rclone config file | tail -1))":/root/.config/rclone \
alyetama/force-forward-outlook:latest