Forum
  • Search
  • Member List
  • Calendar
Hello There, Guest! Login Register — Login with Facebook

Mail client ideas, thinking outside the box
Thank you for your donation

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode | Linear Mode
Mail client ideas, thinking outside the box
16th Mar, 2014, 07:16 PM
Post: #4
mk01 Offline
Registered
Posts: 2,485
Joined: Mar 2013
Reputation: 209
RE: Mail client ideas, thinking outside the box
But you understand that the ways you describe are simply non-sense ... for what you need.

Not because are "closed/licensed" or "too fancy" but simply because configure/maintain such "signaling" method will cost so much time - returning on service to you what - one 0/1 status that the picture has changed ?

if the NAS fw has at least configurable retry count on smtp send? or at least user defined smtp gateway? then don't be crazy (be nice to your time) and in case you can define retry count on email send failure - set it to 0 and smtp server use IP of your Raspberry.

on Raspberry install "conntrack" package. in simple script use conntrack as this:
Code:
conntrack -E -p tcp --state SYN_RECV --dport 25 | while read line; do initctl emit -n doorbellalert; done

this will run, listen on new connection on port 25 (smtp). if your NAS will try to send email, you get tick, event named "doorbellalert" will be generated in your RPI.

in /etc/init/ create doorbell.conf
Code:
start on doorbellalert

task
script
    
     xbmc-send --action=XBMC.Play("doorbellnotifycation.audio")
end script

you are finished with notification. although I send you command you don't need XBMC at all. is useless.

change "xbmc-send" for
Code:
cat "doorbellnotifycation.audio" | ffmpeg -i - -codec s16be - | aplay -DNAMEOFAUDIOCARD

this will accept any format of input audio file, autodetected and send ti aplay to play it out on sound card named "NAMEOFAUDIOCARD" (aplay -L will tell you the available sound card names)

so 7 lines of code, implemented in 10minutes. is this not what you wanted ?

if NAS is not providing editable retry count (what means it would be rsending the same event again and again because on our tcp/25 is no real smtp server listening), then only difference to the setup is that you have to fake SMTP server on port 25. this is not too much of a complication, just you will use such script:

Code:
mkfifo FROMNAS

netcat 25 < TONAS  > FROMNAS &

while read line; do
    case $line in
       helo*)
           echo "250" > TONAS
           ;;
       MAIL*)
           echo "250" > TONAS
             ;;
        RCPT*)
           echo "250" > TONAS
            ;;
       DATA*)
            echo "354 ok, send it; end with <CRLF>.<CRLF>" > TONAS
         \.)
            echo "250" > TONAS
       QUIT*)
            echo "221" > TONAS
         *)
                ;;
   esac
done < FROMNAS

initctl emit -n doorbellalert

you are finished again

what is the "push" option anyhow ?

Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here
Find all posts by this user
Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


Messages In This Thread
Mail client ideas, thinking outside the box - Warren Morgan - 16th Mar, 2014, 10:25 AM
RE: Mail client ideas, thinking outside the box - mk01 - 16th Mar, 2014, 11:42 AM
RE: Mail client ideas, thinking outside the box - Warren Morgan - 16th Mar, 2014, 06:36 PM
RE: Mail client ideas, thinking outside the box - mk01 - 16th Mar, 2014 07:16 PM
RE: Mail client ideas, thinking outside the box - Warren Morgan - 16th Mar, 2014, 08:07 PM
RE: Mail client ideas, thinking outside the box - mk01 - 16th Mar, 2014, 08:19 PM

  • View a Printable Version
  • Send this Thread to a Friend
  • Subscribe to this thread
Forum Jump:

Current time: 13th Jun, 2025, 05:09 AM Powered By MyBB, © 2002-2025 MyBB Group.