Motion - Motion Mail
You are here: Foswiki>Motion Web>MotionMail (12 Dec 2017, NickiAllen)Edit Attach

Motionmail

Creates a montage of event images and sends it by email.

Introduction

Perl script which will send a montage of event images to a list of email addresses. uses basic scheduling to enable/disable sending of messages at predefined time blocks.

Detailed Description

This script is typically called from the motion.conf file, it will create a montage of the images for the event given, this montage will then be sent to a list of email addresses. It will also move the event images to a backup location if required. Another feature is scheduling; for each weekday a time block can be defined, no mail will be sent within this block.

This is a work in progress... current version is 0.02

Future changes and additions:
  • web interface for scheduling
  • scheduling per user (so mail will be sent to users on a roster basis)
  • using the imagemagick perl module instead of using a system call
  • ...suggestions?

Attached Files

motionmail.pl - main script

Installation

Requirements:
  • ImageMagick
  • MIME::Lite
  • Getopt::Long
  • Pod::Usage
To install, copy this script to a location on your hard drive, for example /usr/local/bin chown and chmod, owner of the script should be the user motion runs as:
 chown motion:motion /usr/local/bin/motionmail.pl
 chmod 744 /usr/local/bin/motionmail.pl

after this you can run motionmail.pl -man for detailed instructions.

Users Guide

see 'motionmail.pl -man'

Comments and Bug Reports


If number of recorded images for an event exceeds a certain number (e.g > 66 images), motionmail.pl stops working, because montage(image-magick) generates more than one file with the filenames montage.png.0, montage.png.1, montage.png.2, etc.

It would be nice if these images could be also attached in the mail instead the program errorbreak (montage.png: not readable)

Maibe also nice would be if these images would be included inline inside the email.

-- LuMiHei - 02 Sep 2005

I followed the steps below: To install, copy this script to a location on your hard drive, for example /usr/local/bin chown and chmod, owner of the script should be the user motion runs as:

chown motion:motion /usr/local/bin/motionmail.pl chmod 700 /usr/local/bin/motionmail.pl

after this you can run motionmail.pl -man for detailed instructions

When trying to run motionmail.pl -man I get the following error: Can't open /usr/local/bin/motionmail.pl: Permission denied at /usr/share/per/5.8/Pod/Perldoc.pm line 1380.

Any idea what I'm doing wrong?

-- JohnBartels - 09 Nov 2008


I had the same problem as above. It appears the perl man calls the script but it is no longer running as the same user and no longer had permission. Change the script prem to 744 and you should be rocking.

-- JaymeMaurice - 18 Nov 2009

Hi all, I haven't been here in a long time (Life tends to get busy when you start a family!) I finally am back to using Motion after using ZoneMinder for a while. I'm currently fixing some issues with the script and I will write some better instructions on how to install and use it. Jayme: Thank you for your additions and comments in the script, it will help make this script better smile I'm also thinking of doing a complete rewrite of this script to make it more flexible and easier to use. I'll see how I go with that.

this script should be owned by user root and a group that the motion user is member of (in my case its the group 'video', on other systems it may be group 'motion'). Permissions should then be 750 (full permissions for the owner, read and execute for group). If you have trouble running 'motionmail.pl -man' you can also run the command 'perldoc /usr/local/bin/motionmail.pl'

Cheers, Taco

-- TacoScheltema - 20 Sep 2011

Hi folks,

I created my own script if anybody wants to give it a try: https://github.com/7AC/pypymotion

-- GiuseppeValente - 11 Mar 2013

There are thousands and thousands of various automation tools on the market and if used smartly they come out very helpful for routine SEO tasks, small generic epizods and such. It doesn't look like any bots are used in creation of <a href="https://topwritingreviews.com/services/buyessayclub">reviews for BuyEssayClub.com</a>. Do you think so?

-- NickiAllen - 12 Dec 2017

There are thousands and thousands of various automation tools on the market and if used smartly they come out very helpful for routine SEO tasks, small generic epizods and such. It doesn't look like any bots are used in creation of testimonials at Payforessay on https://topwritingreviews.com/services/payforessay. Do you think so?

-- NickiAllen - 12 Dec 2017

-- TacoScheltema - 06 Jun 2005

  • motionmail.pl.txt: My contributions (JaymeMaurice - 18 Nov 2009)...
  • Sorted the file list,
  • Added an important usibility addition to the MAN page (instructions for event)
  • Fixed the image embeding
  • Made script generate a seperate thumbnail for the attachments and leave the montage behind which is linked in as an email link
  • would still like to move a bunch of things into the config file... but hope you enjoy my quick contributions.

RelatedProjectsForm edit

ProjectSummary Perl script, sends a montage of captured images for an event. sending can be scheduled to only send at certain times
ProjectStatus Alpha
ReleaseVersion 0.02
ProjectSubmitter TacoScheltema
I Attachment Action Size Date Who Comment
motionmail.pl.txttxt motionmail.pl.txt manage 9 K 18 Nov 2009 - 17:06 UnknownUser My contributions... sorted the file list, added some important usibility addition to the MAN page, fixed the image embeding, made it generate a seperate thumbnail for the attachments and leave the montage behind.
Topic revision: r8 - 12 Dec 2017, NickiAllen
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.