PHP/Mysql version of aliases management
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
apple-touch-icon
css
img
js
.gitignore
README.md
config.inc.php-ex
create-postfix.sql
index.php
mysql-aliases.cf

README.md

Disclamer

I use: bootstrap transition v2.3.2

It's an old version of the framework. An update may be a good idea. But I don't want take the time to do it.

Security

I quickly wrote this tool to be functionnal. It's protected with an http authentification. I'm the single user of this app.

Do not use it in production :p

Installation

Install app in your public http folder.

App need php & mysql functionnal. Yes I known PHP :(

Create user & db

Open a mysql connexion as root and launch (replace 'your-pass' with right one):

CREATE DATABASE IF NOT EXISTS postfix;

CREATE USER 'postfix'@'localhost' IDENTIFIED BY 'your-pass';
GRANT USAGE ON *.* TO 'postfix'@'localhost' IDENTIFIED BY 'your-pass' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
GRANT SELECT ON postfix.* TO 'postfix'@'localhost';

CREATE USER 'postfix_rw'@'localhost' IDENTIFIED BY 'other_pass';
GRANT USAGE ON *.* TO 'postfix_rw'@'localhost' IDENTIFIED BY 'other_pass' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
GRANT INSERT ON postfix.* TO 'postfix_rw'@'localhost';

FLUSH PRIVILEGES;

Update postfix config

# ALIAS DATABASE
alias_maps = hash:/etc/aliases, mysql:/etc/postfix/mysql-aliases.cf
alias_database = hash:/etc/aliases
local_recipient_maps = hash:/etc/aliases, mysql:/etc/postfix/mysql-aliases.cf

Content of /etc/postfix/mysql-aliases.cf:

sudo cp mysql-aliases.cf /etc/postfix/mysql-aliases.cf

And edit it to replace with right password

Update app configuration

cp config.inc.php-ex config.inc.php

And edit your config.inc.php and replace with right values.