Coder Social home page Coder Social logo

ew.email's Introduction

EW.Email v1.0.0

Use email to wake your PC, and so on.

Screenshot

Sent email with subject alive & ip & wake Ray Eldath's Desktop:

System Log

And you will receive:

Received

Features

  • Multi-commends email (email whose subject is multiple commends separate by &, like alive & ip & wake Ray Eldath's Desktop) supported.
  • Useful commend handlers contained:
    • wake <TARGET NAME>: sent magic package to target in order to wake target device.
    • ip: returns public IP address.
    • alive|heartbeat: test if server still alive.
  • Support mainstream mail protocol (POP3, IMAP, SMTP).
  • Easy to expand.

Using

Basic using

  1. Decompression RELEASE file which downloaded here.
  2. Create file config.json under directory EW.Email-VERSION/bin.
  3. Config config.json which describe in next part.
  4. Execute file EW.Email (Linux) or EW.Email.bat (Windows).
  5. Star and Follow this project :-)

Start when system started

Following instructions are for Linux system. (Tested on Debian 8)

For Windows, just add EW.Email.bat into your list of startup items.

  1. Download ew file and move it into /etc/init.d. (remember in sudo! )
  2. Use chkconfig to set it start automatically.

Configuration

This part explains config file config.json.

config.json:

{
  "update_frequency": 60,             // Frequency of connect email server and handle email.
  "daemon": true,                     // Use daemon mode. If on, log will outputs into temp file, not stdout.
  "zone_id": "Asia/Shanghai",         // Your zone id, used for zoned time. All available values see `https://docs.oracle.com/javase/8/docs/api/java/time/ZoneId.html#SHORT_IDS`.
  "permitted_addresses": [            // Emails from these addresses will be handled.
    "[email protected]"

  ],
  "email": {
    "name": "Ray Eldath",
    "address": "[email protected]",          // Your email address, also used for login email server.
    "password": "TestForTest@!%!",      // Password of your email.
    "sender": {                         // Config sender server.
      "protocol": "SMTP",               // Only support SMTP protocol yet.
      "host": "smtp-mail.outlook.com",  // Server host.
      "port": 587,                      // Server port.
      "transport_strategy": "SMTP_TLS"  // Transport strategy, available values containes `SMTP_PLAIN` `SMTP_SSL` and `SMTP_TLS`. Default `SMTP_PLAIN`.
    },
    "receiver": {
      "protocol": "IMAP",               // Support IMAP and POP3 protocols.
      "host": "imap-mail.outlook.com",
      "port": 993,
      "ssl": true                       // Use SSL or not. Default `false`.
    }
  },
  "handler": {                          // Config for commend handler
    "Wake": {                           // Config for handler:Wake.
      "target": [
        {
          "name": "Ray Eldath's Laptop",   // Name of this target. You should wake this device with email with subject `wake Ray Eldath's Laptop`.
          "mac": "4C:CC:6A:30:C2:5A",      // MAC of the device.
          "ip": "192.168.0.8"              // IP of the device.
        }
      ]
    }
  },
  "debug": false                           // Only for debug purpose.
}

Expend

This part describes how to add custom commend handler into EmailEverything.

  1. Created class under package ray.eldath.ew.handler
  2. Make this class implements Handler
  3. Let method titleRegex returns regex for email subject
  4. Fill main processing in method handle
  5. Register your handler in array MainHandler/allHandler
  6. Star and Follow this project :-)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.