Giter Site home page Giter Site logo

mail's Introduction

Collect your email

These scripts will grab a folder of your choosing from gmail and insert it into a MySQL table. Be sure that the PHP IMAP extension is enabled.

#####Getting Started

I started learning how to do this using this example. Check it out. I'm doing this, because, ultimately, I want to play around with my emails using Sphinx. Also, I wrote more about my very first steps here.

To get started, download these files, create a table with 'id', 'sender', 'subject', 'date' and 'message' fields. gmail.php will expect those names. Then, open up form.php in your browser.

#####form.php

This will ask you for your email and password, then send you to folders.php, where it will connect to your mailbox and show you a list of available folders.

#####folders.php

This will present a list of folders from your gmail account. Copy and paste one of them into the field at the bottom.

#####gmail.php

This brings together your authorization details, gets emails, and inserts the sender name, subject, date and content into MySQL. Depending on the size of your mailbox, it could take a very long time (if you know a way to speed this up, please let me know)...

#####gmail.conf

This is the Sphinx configuration file used to index a table with 'sender', 'subject', 'date', and 'message' fields. It connects to a database named 'test' on 127.0.0.1:9306 with the 'root' user and no password. It uses the field/string data type. So, it's fulltext indexed but also stored as a string attribute (so, when searching Sphinx, we'll get text content in the result set.. otherwise, Sphinx ditches the actual text content with fulltext fields).

After your table is ready, run indexer like this:

indexer -c /path/to/project/gmail.conf emails

Then, play around, search your emails with Sphinx!

#####that's it for now

Let me know if you see ways to improve this process. I have a lot to learn :)

mail's People

Contributors

stefobark avatar

Watchers

James Cloos avatar  avatar

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.