GithubHelp home page GithubHelp logo

melinite / php-mail_mda_mongodb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ferraro/php-mail_mda_mongodb

0.0 2.0 0.0 64 KB

Postfix compatible MDA for saving messages inside a MongoDB.

License: GNU General Public License v3.0

php-mail_mda_mongodb's Introduction

PHP-Mail_MDA_MongoDB

Mail delivery agent, which stores incoming emails from Postfix into MongoDB using PHP.

REQUIREMENTS

  • php extension mailparse (can be installed by "pecl install mailparse")
  • postfix 2.9.x, good for implementation would be the MongoDB version 2.9.4 at https://github.com/ferraro/postfix-mongodb, because it supports MongoDB for virtual addresses lookup.

FILES

  • mda_config.php.dist Configuration example file
  • mda.php Mail Delivery Agent called by Postfix
  • main.cf Postfix example main configuration file
  • master.cf Postfix example master configuration file
  • test/* E-Mail MBOX test files, e.g. can be run with "./mda.php < test/attachments.mbox"

INSTALLATION

After extracting the GIT repository, run the following commands:

curl -s https://getcomposer.org/installer | php
php composer.phar update

Copy mda_config.php.dist to mda_config.php file:

cp mda_config.php.dist mda_config.php

Edit /etc/postfix/main.cf file and add the following entries:

# my10minutemail.com mongodb alias test
myorigin = my10minutemail.com
virtual_mailbox_domains = my10minutemail.com
virtual_mailbox_maps = mongodb:/etc/postfix/mongodb-aliases.cf
virtual_mailbox_base = /var/mail
virtual_minimum_uid = 65534
virtual_uid_maps = static:65534
virtual_gid_maps = static:65534
virtual_mailbox_limit = 0
# *** Use the mongodb  agent for the transport, to store messages inside MongoDB ***
virtual_transport = mongodb:
# MongoDB is limited to 4 MB by file attachment, so limit messages completly to 4 MB
message_size_limit = 4000000

Edit /etc/postfix/master.cf file and add the following entries:

#
# MongoDB mail delivery agent
#
mongodb unix  -       n       n       -       20      pipe
  flags=FDRhu user=nobody argv=/var/www/my10minutemail/mda/src/mda.php

Note: In this example the mda.php script has been installed at /var/www/my10minutemail, please update this path where your file is located. Additionally please check if you need "virtual_mailbox_maps = mongodb:/etc/postfix/mongodb-aliases.cf", this is only used if you use virutal address mapping with mongodb. In this case you need the Postfix version of MongoDB of https://github.com/ferraro/postfix-mongodb which has an example in its README.md file how looks the /etc/postfix/mongodb-aliases.cf file.

LICENSE

GPL 3 - GNU GENERAL PUBLIC LICENSE version 3: http://www.gnu.org/licenses/gpl-3.0.en.html

php-mail_mda_mongodb's People

Contributors

ferraro avatar

Watchers

 avatar James Cloos 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.