Okay. I seem to have it all working finally so here is a recap on all the files and configs that I'm using.
First off, the system ZoneMinder is installed on is a multi-function system. I only have one webcam to watch the dog and be alerted when people are in the house. I am also running MythTV at full HD front and backend as well as Boxee.
I'm currently upgraded to Ubuntu 10.04.1 32bit. I am not running a local mail server of any kind. I go through gmail directly for all my email sending needs. Also, my address isn't a "@gmail.com" address. It is my own domain that I have Google Apps tied into to handle all my domain's email.
I basically did everything listed on the first page of this thread. I'm not exactly sure why it wouldn't work before and works now but I have been tinkering with scripts as well as ZoneMinder's filter settings and am now in good shape.
I want to give a
HUGE thank you to the author of this thread,
mateuszknapik. He has more than gone out of his way to help me through this issue of gmail SSL not working in Ubuntu.
I will first post my /usr/bin/zmfilter.pl file so you know my end result that I am now working with.
http://nerdsonstandby.com/zmfilter
My SQL database was updated via SSH as I never installed PHPMyAdmin or any other mySQL GUI. I terminaled directly into the database to edit ZoneMinder's DB config. I used to following to login. You'll need your ZoneMinder DB username and password. Enter into your database like this. (Change 'zmusername' to your mySQL username, zmpassword to your mySQL password and replace zm at the end with the database name ZoneMinder uses in your configuration. You can get all this information at the end of the file: '/etc/zm/zm.conf'.)
Code: Select all
mysql --user=zmusername --password=zmpassword zm
Now you are at the mysql prompt where you can paste in the database additions/corrections mateuszknapik posted.
Code: Select all
INSERT INTO `Config` (`Id`, `Name`, `Value`, `Type`, `DefaultValue`, `Hint`, `Pattern`, `Format`, `Prompt`, `Help`, `Category`, `Readonly`, `Requires`) VALUES
(183, 'ZM_SMTP_SSL', '0', 'boolean', 'yes', 'yes|no', '(?i-xsm:^([yn]))', '($1 =~ /^y/) ? "yes" : "no" ', 'Whether to use SMTP with authorization and SSL or not', NULL, 'mail', 0, 'ZM_NEW_MAIL_MODULES=1'),
(184, 'ZM_SMTP_PORT', '465', 'integer', '465', NULL, '(?-xism:^(d+)$)', '$1', 'SMTP port', NULL, 'mail', 0, 'ZM_SMTP_SSL=1\r\nZM_NEW_MAIL_MODULES=1'),
(185, 'ZM_SMTP_PASSWORD', 'your_smtp_password', 'string', NULL, 'string', '(?-xism:^(.+)$)', '$1', 'Your SMTP auth password', NULL, 'mail', 0, 'ZM_SMTP_SSL=1\r\nZM_NEW_MAIL_MODULES=1');
Now make the ConfigAdmin.pm additions. The location of this file is '/usr/share/perl5/ZoneMinder/ConfigAdmin.pm'. Use your favorite editor again and the end result should be this. I've added the previous entry and what follows so you'll know exactly where it goes. Just look at Normando's post for clarification if you need more info.
Above:
Code: Select all
{
name => "ZM_DYN_SHOW_DONATE_REMINDER",
default => "yes",
description => "Remind about donations or not",
help => "",
type => $types{boolean},
readonly => 1,
category => "dynamic",
},
Added lines:
Code: Select all
{
name => "ZM_SMTP_SSL",
default => "yes",
description => "Whether to use SMTP with authorization and SSL or not",
help => "",
type => $types{boolean},
readonly => 0,
requires => [ { name=>"ZM_NEW_MAIL_MODULES", value=>"1" } ],
category => "mail",
},
{
name => "ZM_SMTP_PORT",
default => "465",
description => "SMTP port",
help => "",
type => $types{integer},
readonly => 0,
requires => [ { name=>"ZM_SMTP_SSL", value=>"1" }, { name=>"ZM_NEW_MAIL_MODULES", value=>"1" } ],
category => "mail",
},
{
name => "ZM_SMTP_PASSWORD",
default => "",
description => "Your SMTP auth password",
help => "",
type => $types{string},
readonly => 0,
requires => [ { name=>"ZM_SMTP_SSL", value=>"1" }, { name=>"ZM_NEW_MAIL_MODULES", value=>"1" } ],
category => "mail",
},
Below:
Code: Select all
);
our %options_hash = map { ( $_->{name}, $_ ) } @options;
sub INIT
Now we need to make sure perl is good to go for sending emails. Make sure you have all the dependencies. I didn't have them all for some reason. Thanks again to mateuszknapik for supplying:
Code: Select all
sudo apt-get install libnet-smtp-ssl-perl libio-socket-ssl-perl libnet-ssleay-perl libauthen-sasl-perl
EDIT: The below cpan part I did not do on the newest ZM ubuntu box I built. I am able to complete the test.pl script noted above in a previous post without installing cpan and hence, then doing 'install Net::SMTP::SSL'. Save yourself the extra step!
Next thing is to install cpan. I don't know for a fact that this was necessary but I did do it and it is now working so I'll add it in this list of things to do.
Code: Select all
sudo cpan
>> install Net::SMTP::SSL
[blablabla]
>> quit
The above will take you through seemingly endless prompts to configure. The majority of the prompts had defaults to simply accept by hitting enter.
There is a test script to use that I posted (also from mateuszknapik of course). Give it a try now and make sure the email portion works.
from there I configured the ZoneMinder Email tab in the options panel just as illustrated in the first post of this thread.
http://img208.imageshack.us/img208/7299 ... 004xb7.jpg
The only thing I didn't do was check the 'ZM_OPT_MESSAGE' option as I don't care to text my phone. Email on a smart phone is rather common now days. You can find other ZoneMinder info to add in your emails if you'd like at the ZM wiki:
http://www.zoneminder.com/wiki/index.ph ... ing_Events
For a email filter, I just used alarm frames. I may adjust the amount of frames to match depending on how many emails I end up getting. I made the filter settings as illustrated, saved, gave it a name and checked to run in the background.
I also changed another setting so I would get the email quicker while the alarm frames were being triggered. (I don't doubt there is a better way but it does shave off some time from when the alarm is triggered and when the email with the picture comes in. The change is in the ZoneMinder options screen under the Config tab. The listing is 'EVENT_CLOSE_MODE'. I changed it from idle to alarm.
That does it though. I now have my email updates through gmail SSL working flawlessly on an Ubuntu installation.
Time never ceases to accelerate.