Remote connecting to server (by incoming email)

How to customize and extend your OpenVPN installation.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
kt368
OpenVpn Newbie
Posts: 1
Joined: Thu Jun 21, 2018 5:20 am

Remote connecting to server (by incoming email)

Post by kt368 » Thu Jun 21, 2018 5:37 am

Hi everyone!

I'm trying to realize such functionality:
I have Win 10 PC with installed OpenVPN client. At this PC I already have installed and always running Mozilla Thunderbird mail client. I want the VPN client to connect to the server if Mozilla received the email.

For this behavior I'm plan to use such scheme: When incoming email is received by Mozilla, it's extension "Mailbox Alert" executes bat file, which run openvpn client which are connecting to server.
But I can't create bat file, which will able to cennect to VPN server.
I've trying this bat file:

Code: Select all

cd "C:\Program Files\OpenVPN\bin"
START "" /B openvpn.exe --config config.ovpn
It connects to VPN, but can't add routes due to non admin user. If I'm run this bat file as administrator, connection and adding routes are performing normally.
How I can create bat file for connecting to OpenVPN server and adding routes for use in my automatization case?

Post Reply