Guide for installing PlexEmail?

Status
Not open for further replies.

Backdraft76

Dabbler
Joined
Oct 23, 2014
Messages
11
Hey Adrian. Just to follow up, I got everything working. I decided to leave the listening port alone in the httpd.conf file and just forward the port in my router. I just set it all up again and when i use the local ip address (192.168.1.9) in the web_domain line of the config.conf file everything works. I get the proper link in my email when clicking on "View this email in your browser". But when I replace the local ip with with my dyndns address to make it accessible outside my LAN the "View this email in your browser" isn't underlined and isn't a clickable link any longer. Any ideas from any of you smarter people as to why?
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
I've never tried exposing the PlexEmail generated web page to the outside world, so not too sure what your problem might be. What happens if you just try and browse to your external IP address? Is the port forwarding sending it to the PlexEmail jail and displaying the web page?
 

Backdraft76

Dabbler
Joined
Oct 23, 2014
Messages
11
Yes, browsing to the external IP address works perfectly. Port forwarding is working as expected. The only thing that I can think of is the config file likes a numeric web domain and doesn't like alphanumeric on that line. But that doesn't make a lot of sense as all it is doing is copying the entry onto the email. My only reason for this is to have the option available to the users when they get the email.
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
What have you changed in the config.conf file? I've just had a quick look, and I'd be changing the {website} reference in the line below to match your dyndns address

Code:
msg_header3 = '<a href="{website}" style="color: #9A9A9A

It's quite a long way down the file.
 

Backdraft76

Dabbler
Joined
Oct 23, 2014
Messages
11
OK, playing around a little more with it I'm starting to believe that its the ":port" that's causing issues. The {website} reference in that line comes from the "web_domain" and "web_path" lines under the #Web section near the top. When putting the dyndns address in the web_domain line, it will create the clickable link in the email, however, adding the port number to that address breaks it. Adding the port number and "plexdata" path to the web_path line also doesn't work. So far, the closest I can get to a working link has the dyndns address and the path (dyndns.net/plexemail). Now its just a matter of figuring out how to insert ":portnumber" in the middle between the ".net" and the "/plexemail"
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231

Backdraft76

Dabbler
Joined
Oct 23, 2014
Messages
11
No, it doesn't work. I tried that with and without anything in the web domain line.

Edit: I read your last comment wrong. I'll give it a shot and see what happens.
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
How is the port forwarding set-up? And is the dyndns.net adding something that you're not seeing?
 

Backdraft76

Dabbler
Joined
Oct 23, 2014
Messages
11
I have a TCP port forwarded to internal port 80 on the local IP of the jail that plexemail is running. Router is running Tomato. The dyn address is "example.blahblah.net". I think its come down to a syntax issue/error. Ive tried it as "dynaddress.example.net:portnumber" and I get nothing. I replace the colon with a period (dynaddress.example.net.portnumber) and I get the link just fine. Obviously a broken like since the formatting is incorrect without the colon.
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
Very strange! That said, if your accessing externally on port 80 and forwarding to PlexEmail on port 80, you don't need to add the port into the URL?
 

Backdraft76

Dabbler
Joined
Oct 23, 2014
Messages
11
BAM!!!

You're a scholar and a gentleman. That did the trick. Thank you SO much! I guess I was just overthinking it. Just to clarify, in case anyone else wishes to access the web page outside their LAN, I put my dyndns web address into the #Web section on the "web_domain =" line. Then forwarded external port 80 to internal port 80 on the router. Adrian, if you have a paypal, I'll gladly buy you a whisky, beer, or soft drink of your choice.
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
Just glad to hear you got it sorted, but thanks for the offer!
 

Muddro

Explorer
Joined
Oct 6, 2014
Messages
59
I had a look at this today, installed and configured in it's own jail. Not done one before, but an attempt at some instructions below:

1. Create new Jail (default options, I'd called it plexemail)
2. Add storage to the plexemail jail pointing to your plexdata folder in your plex jail (my destination was /plexms)
3. From the CLI in the jail run:

Code:
pkg upgrade
pkg install py27-sqlite3 py27-requests apache24 nano
git clone https://github.com/jakewaldron/PlexEmail.git
mkdir /usr/local/www/apache24/data/plexemail
cp -R /PlexEmail/web/ /usr/local/www/apache24/data/plexemail


Update 03/05: I've update the above code as the mkdir and cp command were the wrong way around!

4. Edit the config.conf file with relevant details:

Code:
nano /PlexEmail/scripts/config.conf


nb: you’ll need to change the path to the plex media server storage link (mine was /plexms) and web folder (/usr/local/www/apache24/data) along with SMTP settings for your e-mail service.

5. Run the plexEmail script:

Code:
python2.7 /PlexEmail/scripts/plexEmail.py


6. Set-up a weekly Cron job to run the script:

Code:
crontab -u root -e
59 23 * * 0 python2.7 /PlexEmail/scripts/plexEmail.py


nb: Hit the 'i' button to set vi into 'insert mode'. Copy & paste line 2 into the editor, then hit the "Escape" button then ":" then "w" then "q" then "enter"

Alternatively, you can create a Cron task in the FreeNAS GUI with the following command:

Code:
jexec plexmail python2.7 /PlexEmail/scripts/plexEmail.py
You have a code per chance on how to update PlexEmail with newest version? Tried git clone command and said fatal error because directory already existed
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
When I updated it I renamed the old folder and then used git clone to copy the new version. From there you could try copying the old config.conf file into the new scripts folder, but as I hadn't updated for a while I was guessing there would be new stuff so manually updated it based on the previous files settings.
 

Muddro

Explorer
Joined
Oct 6, 2014
Messages
59
When I updated it I renamed the old folder and then used git clone to copy the new version. From there you could try copying the old config.conf file into the new scripts folder, but as I hadn't updated for a while I was guessing there would be new stuff so manually updated it based on the previous files settings.

Yeah i did something similar. Renamed the config to a backup, then went into the PlexEmail folder and put "git pull" and it updated it and put a new config file. Then you can compare and see if config has anything added to see whether old one would work or whether you need to copy and past the info over.
 

ajlanga

Cadet
Joined
Apr 15, 2016
Messages
5
So I get PlexEmail to work just fine. It will email out appropriately when I run it manually or as a Cron Job. However, when I reboot my FreeNAS box the script stops working, even if I try to run it manually. Has anyone else had this problem or know how to fix it?
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
I've had similar problems when the PMS jail has been restarted and the mount point in the PlexEmail jail is lost. Going into Jails > Storage and remounting things fixed the problem. Might not be the same issue when you're rebooting the server, but worth checking?
 

ajlanga

Cadet
Joined
Apr 15, 2016
Messages
5
Thanks for the thought. Unfortunately that doesn't seem to be my situation. It retains the mount points when I reboot. It seems that the PlexEmail.py script just doesn't want to run when I call on it.
 
Status
Not open for further replies.
Top