email2DynDNS (email to dyndns)

Download        Deutsche Beschreibung

Purpose of email2DynDNS

email2DynDNS is a PHP4 script that processes an incoming email from a webcam, other device or an email sent from your mail client and updates DynDNS with the sender IP. Instead of delivering the email to a mailbox the mail server forwards the email to email2DynDNS PHP script which will process the content and update the sender IP at DynDNS.

email2DynDNS was created out of an annoying situation. My webcam located in a place where the electricity is not stedy and my dynamic IP would change very often, wasn't able to reliably update the IP address at DynDNS.
The webcam in my case a D-Link 5300G is able to send emails on a predefined schedule e.g. every hour. For a couple of months I receivied those emails and copied the sender's IP address from the email header and manually updated DynDNS.
After a while I was board doing the same routine sometimes 3-4 times a day and I decided to code a script doing this repeating work for me.
The PHP Script (email2DynDNS) reads the incoming email, extracts the sender IP address and triggers a DyndDNS update.

How does email2DynDNS work?

  1. The script first verifies that the incoming email really comes from your device. If it is a spam sent to your email forwarding address it exits. Is the email coming from your device it will process.
  2. The IP address will be extracted from the email header.
  3. The IP is tested against the IP on file from last email. Is it the same IP like before the script exits. Is it a new IP it will be processed.
  4. Isit a new IP the script will make a connection to DynDNS, login with your user name and password and update the dynamic IP at DynDNS.

Acknowlegment

The DynDNS update function used in email2DynDNS is based on a script from R.J. Vrijho's Dyndns.php, thanks R.J.!
The update function makes use of Manuel Lemos HTTP Class. Thanks Manuel!

License

This script is distributet under GPL.

Warranty

The script comes as is. Support by email.

Rate this script at Hotscripts

email2DynDNS is ...
Excellent!
Very Good
Good
Fair
Poor


Download

Download Version
Downloadlink
 email2DynDNS 1.0
Download

 

English Description     Deutsche Beschreibung


Deutsche Beschreibung

email2DynDNS (email to dyndns)

Was ist email2DynDNS?

email2DynDNS ist ein PHP4 Script, das ein eingehendes Email einer Webcam oder von einem Email Programm abgesendetes Email prozessiert und DynDNS mit der IP des Senders aktualisiert. Anstatt das Email in eine Mailbox zu kopieren leitet der Mailserver das Email email2DynDNS PHP Script weiter. Dieses liest den Inhalt, extrahiert die Sender-IP und führt bei DynDNS eine aktualisierung aus.

email2DynDNS entstand aus einer Notlage. Meine Webcam, die an einem Standort aufgestellt wurde, wo die dynamischen IP wegen Stromschwankungen andauernd wechselt, war nicht in der Lage mit dem integrierten DynDNS-Client die geänderte IP zuverlässig bei DynDNS zu aktualisieren.

Die Webcam eine D-Link 5300G ist aber in der Lage zuverlässig und regelmässig z.B. jede Stunde ein Email an beliebige Emailadresse zu versenden. Ein paar Monate öffnete ich jeweils diese Emails und kopierte aus dem Email Header die Absender-IP-Adresse manuell und machte dann den DynDNS-update von Hand.
Irgendwann wurde mir dieses Prozedere zu mühsam und ich entschloss mich die Sache programmiererisch zu lösen.
Das PHP Script (email2DynDNS) übernimmt das ankommende Email, extrahiert die Absender IP Adresse und führt den DyndDNS-update durch.

Wie funktioniert email2DynDNS?

  1. Das ankommende Email wird zuerst auf seine Echtheit geprüft. Ist es ein Spam, das zufälligerweise an diese Emailadresse geschickt wurde, bricht das Script den Vorgang ab. Kommt das Email tatsächlich von meiner Webcam, wird es weiterverarbeitet.
  2. Die Absender-IP-Adresse wird aus dem Emailheader extrahiert.
  3. Die IP Adresse wird mit der alten IP Adresse vom letzten Email verglichen, die in einem File zwischengespeichert wurde. Ist es die gleiche IP bricht das Script ab. Ist es eine neue IP wird diese weiterverarbeitet.
  4. Ist die IP neu, baut das Script eine Verbindung zu DynDNS auf, loggt sich mit dem registrierten Benützername und Passwort ein und macht den Update.

Danksagung

Die DynDNS Update Funktion von email2DynDNS basiert auf einem Script von R.J. Vrijho's Dyndns.php.
Für den Update von DyndDNS verwendet das Script die HTTP Class von Manuel Lemos. Thanks Manuel

Lizenz

Dieses Script wird unter der GPL verteilt.

Garantie

Es besteht keine Garantie für die funktionalität dieses Script. Support per Email.

Bewerten Sie dieses Script bei Hotscripts

email2DynDNS is ...
Excellent!
Very Good
Good
Fair
Poor

English Description     Download