Git Product home page Git Product logo

postal's Introduction

Build Status Carthage Pods Swift 5.0 Platforms

Postal is a swift framework providing simple access to common email providers.

Example

Connect

let postal = Postal(configuration: .icloud(login: "[email protected]", password: "mypassword"))
postal.connect { result in
    switch result {
    case .success:
        print("success")
    case .failure(let error):
        print("error: \(error)")
    }
}

Search

let filter = .subject(value: "Foobar") && .from(value: "[email protected]")
postal.search("INBOX", filter: filter) { result in
    switch result {
    case .success(let indexes):
        print("success: \(indexes)")
    case .failure(let error):
        print("error: \(error)")
    }
}

Fetch

let indexset = NSIndexSet(index: 42)
postal.fetchMessages("INBOX", uids: indexset, flags: [ .headers ], onMessage: { email in
    print("new email received: \(email)")
}, onComplete: error in
    if error = error {
        print("an error occured: \(error)")
    }
}

Want to debug your IMAP session ?

postal.logger = { log in
    print(log)
}

What about Mailcore ?

Postal does not address the same goal as MailCore. You can take a look at our thoughts in the TechnicalNotes document.

Provider quirks

Email protocol is standardized. However providers implementations often provides extension or variations of these standards. We tried to build a document to synthesize working around these variations here: ProviderQuirks.

Contributing

Postal has been a great effort and we could really use your help on many areas:

  • Finding and reporting bugs.
  • New feature suggestions.
  • Answering questions on issues.
  • Documentation improvements.
  • Reviewing pull requests.
  • Fixing bugs/new features.
  • Improving tests.
  • Contribute to elaborate the Roadmap.

If any of that sounds cool to you, please send a pull request!

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms that you can find here: CodeOfConduct.

Requirements

  • Xcode 10
  • OS X 10.10 or later
  • iOS 8.0 or later

Installation

Carthage

Postal is Carthage compatible.

  • Add github "snipsco/Postal" to your Cartfile.
  • Run carthage update.

CocoaPods

Postal also can be used by CocoaPods.

  • Add the followings to your Podfile:
use_frameworks!
pod 'Postal'
  • Run pod install.

Manual

  1. Add the Postal repository as a submodule of your application’s repository.
git submodule add https://github.com/snipsco/Postal.git
git submodule update --init --recursive
  1. Drag and drop Postal.xcodeproj into your application’s Xcode project or workspace.
  2. On the “General” tab of your application target’s settings, add Postal.framework to the “Embedded Binaries” section.
  3. If your application target does not contain Swift code at all, you should also set the EMBEDDED_CONTENT_CONTAINS_SWIFT build setting to “Yes”.

License

Postal is released under the MIT License.

postal's People

Contributors

jeremiegirault avatar mpdifran avatar loicwolff avatar kvap avatar greg3z avatar jibeex avatar atomicbird 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.