Code: Select all
sudo apt-get install mutt
Code: Select all
pluma ~/.muttrc
Code: Select all
set imap_user = from_my@gmail.com
set imap_pass = verygoodpasswordhere
set smtp_url = smtp://from_my@smtp.gmail.com:587/
set smtp_pass = verygoodpasswordhere
set from = from_my@gmail.com
set realname = seuritycamera
set folder = imaps://imap.gmail.com:993
set spoolfile = "+INBOX"
set postponed="+[Gmail]/Drafts"
set header_cache=~/.mutt/cache/headers
set message_cachedir=~/.mutt/cache/bodies
set certificate_file=~/.mutt/certificates
set move = no
set record = '+Sent'
Code: Select all
sudo apt-get install motion
Code: Select all
sudo adduser myself motion
Code: Select all
gksu pluma /etc/default/motion
Code: Select all
# set to 'yes' to enable the motion daemon
start_motion_daemon=yes
Code: Select all
gksu pluma /etc/motion/motion.conf
Code: Select all
--------------------------------
# Minimum time in seconds between capturing picture frames from the camera.
# Default: 0 = disabled - the capture rate is given by the camera framerate.
# This option is used when you want to capture images at a rate lower than 2 per second.
minimum_frame_time 1
--------------------------------
# Target base directory for pictures and films
# Recommended to use absolute path. (Default: current working directory)
target_dir /path/motion
--------------------------------
# Command to be executed when a motion frame is detected (default: none)
on_motion_detected cd /home/username && ./.startup.sh
--------------------------------
Code: Select all
pluma ~/.startup.sh
Code: Select all
#! /bin/sh
sleep 40 && cd /home/username && ./.mutt.sh
Code: Select all
chmod a+x /home/username/.startup.sh
Code: Select all
pluma ~/.mutt.sh
Code: Select all
#! /bin/sh
TIMESTAMP=$(date +%Y%m%d%H| sed 's/ //g')
find /path/motion -iname "*.swf" -exec mv {} /path/allvideos \; && sleep 30 && genisoimage -o /path/toemail/video$TIMESTAMP.iso /path/allvideos && mutt -z -a /path/toemail/video$TIMESTAMP.iso -s “Security_videos” -- to_some_email@gmail.com from_my@gmail.com < /dev/null
Make the script executable
Code: Select all
chmod a+x /home/username/.mutt.sh
/path/motion
/path/allvideos
/path/toemail
Set the permissions for the folders
Code: Select all
sudo chmod 775 /path/foldername
PS. emails comes always when Motion has react!
PS2. Install Gnash for watching swf-videos.
Code: Select all
sudo apt-get install gnash