Giter Club home page Giter Club logo

nginx-mail-auth-ldap's Introduction

PHP MAIL Auth Server LDAP

A very simple authentication server for NGINX mail authentication that relies on modern libraries to authenticate with LDAP.

Setup

Install Libraries

cd /usr/share/nginx/html;
git clone https://github.com/MelonSmasher/nginx-mail-auth-ldap.git;
cd nginx-mail-auth-ldap;
composer install;
cp .env.example .env;
# edit the new .env file

Auth Server Setup

server {
    listen                127.0.0.1:9500;
    root                  /usr/share/nginx/html/nginx-mail-auth-ldap;
    index                 index.php index.html;

    location ~ \.php$ {
        include           fastcgi_params;
        fastcgi_param     SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param     PATH_INFO $fastcgi_path_info;
        fastcgi_pass      unix:/run/php/php7.1-fpm.sock;
     }
}

Mail Setup

SMTP example:

mail {
    server_name            mail.example.com;
    auth_http              127.0.0.1:9500/auth.php;
    
    ssl_certificate       /path/to/cert.pem;
    ssl_certificate_key   /path/to/private/key.key;
    ssl_protocols         TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers           HIGH:!aNULL:!MD5;
    ssl_session_cache     shared:MAIL:10m;
    ssl_session_timeout   10m;
    starttls              on;
    smtp_auth             plain login;
    xclient               off;
    
    server {
        listen 465 ssl;
        protocol smtp;
    }
    
    server {
        listen 587;
        protocol smtp;
    }
}

nginx-mail-auth-ldap's People

Contributors

melonsmasher avatar

Watchers

 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.