Scaling Dovecot using Mysql and Virtual Users AfNOG 2013 Scalable Internet Services (SS-E) Lusaka, Zambia Presented by Michuki Mwangi.

Slides:



Advertisements
Similar presentations
Presentation Heading – font Arial
Advertisements

Module 6: Configuring Windows XP Professional to Operate in a Microsoft Network.
What is MySQL? MySQL is a relational database management system (A relational database stores data in separate tables rather than putting all the data.
Installation and Deployment in Microsoft Dynamics CRM 4.0
Unauthorized Reproduction Prohibited SkyPoint Alarm Integration Add-On Using OnGuard Alarms to create events in SkyPoint Also called ‘SkyPoint V0’ CR4400.
SETUP AND CONFIGURATIONS WEBLOGIC SERVER. 1.Weblogic Installation 2.Creating domain through configuration wizard 3.Creating domain using existing template.
SquirrelMail for Webmail AfNOG 2012 Scalable Internet Services (SS-E) Presented by Michuki Mwangi Serrekunda, Gambia (Original Materials by Joelja)
SquirrelMail for Webmail AfNOG 2013 Scalable Internet Services (SS-E) Presented by Michuki Mwangi Lusaka, Zambia (Original Materials by Joelja)
UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.
1 Linux Networking and Security Chapter 3. 2 Configuring Client Services Configure DNS name resolution Configure dial-up network access using PPP Understand.
Implementing POP3 and IMAP4 Using Dovecot
August 25, SSO with Microsoft Active Directory Presented by: Craig Larrabee.
Microsoft Windows 2003 Server. Client/Server Environment Many client computers connect to a server.
This presentation will guide you though the initial stages of installation, through to producing your first report Click your mouse to advance the presentation.
Session 5: Working with MySQL iNET Academy Open Source Web Development.
NOC TOOLS rancid AfNOG Cairo, SI-E, 4 of 5 Sunday Folayan.
Dovecot – server for pop and imap AfNOG CHIX Blantyre, Malawi October - November, 2011 (Materials developed by Joel Jaeggli For AfNOG)‏
Managing User Accounts. Module 2 – Creating and Managing Users ♦ Overview ► One should log into a Linux system with a valid user name and password granted.
Agenda User Profile File (.profile) –Keyword Shell Variables Linux (Unix) filters –Purpose –Commands: grep, sort, awk cut, tr, wc, spell.
File Permissions. What are the three categories of users that apply to file permissions? Owner (or user) Group All others (public, world, others)
Mailing Lists Plus Ayitey Bulley
Adding New Users User as an entity - username(UID), GID. UID - typically a number for system to identify the user. GID – a number that recognizes a set.
ATG Environment Setup In this session you will learn – Setting Up ATG environment – Creating new ATG application – Configuring Data Source – Configuring.
Copyright (c) by CNAPTICS Corporation. All rights reserved.1 INFO Oracle Database 11g: Administration II Presented By: Marc S. Paller,
Unix System Administration Chapter 6 Adding New Users.
Single Sign-on with Kerberos 1 Chris Eberle Ryan Thomas RC Johnson Kim-Lan Tran CS-591 Fall 2008.
Mailserver. Why Postfix ? Sendmail’s legacy Built from ground up Central queue-ing More future-proof Exim4 default of debian, but...
1 Electronic Messaging Module - Electronic Messaging ♦ Overview Electronic messaging helps you exchange messages with other computer users anywhere in.
How to configure DNS for a Windows 2000 domain? 1.Start the Install/Remove Programs Control Panel Applet (Start - Settings - Control Panel - Add/Remove.
Present :Arezoo Mollahasani. Step 1  Define your server connection Open MySQL WorkBench and click New Server Instance on the right of the window.
1 and Exim Introduction AfNOG 2012 Serekunda, The Gambia Chimwemwe Fredrick.
IST 210 Introduction to UNIX (AIX) Todd Bacastow IST 210: Organization of Data.
Proxy Server PROXY SERVER. What is a Web Proxy? Proxy Server A proxy is a host which relays web access requests from clients Used when clients do not.
Managing Users  Each system has two kinds of users:  Superuser (root)  Regular user  Each user has his own username, password, and permissions that.
Computer Networking From LANs to WANs: Hardware, Software, and Security Chapter 13 FTP and Telnet.
Bloomer User Notes Installing and Running a Bloomer Installation Jack Park Latest: Project Home:
Install Appaserver ©Tim Riley. Apache Group ©Tim Riley Add yourself to the apache group. Both the apache user and group are called “www-data”. This step.
Implementing POP3 and IMAP4 Using Dovecot AfNOG 2012 Scalable Internet Services (SS-E) Serrekunda, Gambia Presented by Michuki Mwangi (Built on materials.
1 Day 18 Bash and the.files. 2 The.files ls shows you the files in your directory –Or at least most of them. –Some files are hidden. Try: ls –a –This.
MySQL Getting Started BCIS 3680 Enterprise Programming.
From “Control Panel”, launch “Programs and Features” then select “Turn Windows features on or off” Lab 2: Setup Lab Environment.
VIRTUAL HOSTING WITH PureFTPd And MYSQL (Quota And Bandwidth Management) BY Odoh Kenneth Emeka Sun Yu Patrick Appiah.
CITA 310 Section 6 Providing Services (Textbook Chapter 8)
1 Web Server Administration Chapter 8 Providing Services.
CSC414 “Introduction to UNIX/ Linux” Lecture 6. Schedule 1. Introduction to Unix/ Linux 2. Kernel Structure and Device Drivers. 3. System and Storage.
Module 5: Managing Addresses and Address Lists.
SquirrelMail for Webmail Quick and Dirty Michuki Mwangi for AfNOG 2010.
Managed by UT-Battelle for the Department of Energy Kay Kasemir ORNL/SNS 2012, April at SLAC Control System Studio Training - Alarm System.
Settings MySQL Database and JDBC configuration Instructor: Sergey Goldman.
LINUXCHIX WEBMAIL. Software run by an ISP or online service that provides access to send, receive, and review using only your Web browser. Users.
MySQL Getting Started BCIS 3680 Enterprise Programming.
Building Your Own Website Using:. Install & configure LAMP. Download WordPress and run it as a local website on your Raspberry Pi. Configure WordPress.
Implementing POP3 and IMAP4 Using Dovecot AfNOG 2016 Scalable Internet Services (SS-E) Gaborone, Botswana Presented by Michuki Mwangi (Built on materials.
16 Copyright © 2004, Oracle. All rights reserved. Testing the Migrated Oracle Database.
COM621: Advanced Interactive Web Development Lecture 10 PHP and MySQL.
Presentation Heading – font Arial
How to change the LOGO on PecStarWeb V3.6
SquirrelMail for Webmail
LINUX ADMINISTRATION 1
Dovecot – server for pop and imap
Chapter 2 User Management
Step by step instructions to Add an Admin User in WordPress utilizing FTP Guided By: - WPGLOBALSUPPORTWPGLOBALSUPPORT.
IIS.
CSCI The UNIX System Shell Startup and Variables
Practical Exercise Overview
Limiting SQL Server Exposure
Configuration Of A Pull Network.
Ch 1 .Installing and configuring SQL Server 2005
Presentation transcript:

Scaling Dovecot using Mysql and Virtual Users AfNOG 2013 Scalable Internet Services (SS-E) Lusaka, Zambia Presented by Michuki Mwangi

Overview This presentation will provide a step by step option on how to configure Dovecot to authenticate virtual users from a Mysql Database Configure the MTA to deliver to the virtual users stored in the Mysql Database

Dovecot Configuration All Dovecot configuration files are stored in /usr/local/etc/dovecot/ /usr/local/etc/dovecot/conf.d/

Config files to Open and Edit 1.Authentication & Mysql Setup../dovecot/conf.d/10-auth.conf../dovecot/conf.d/auth-sql.conf.ext../dovecot/dovecot-sql.conf 2.Mailbox location and Addresses../dovecot/conf.d/10-mail.conf../dovecot/conf.d/15-lda.conf../dovecot/conf.d/

../dovecot/conf.d/10-auth.conf Edit the following lines to match below; disable_plaintext_auth = no auth_default_realm = xxx.sse.ws.afnog.org auth_mechanisms = plain login Comment the auth-system.conf.ext #!include auth-system.conf.ext Uncomment the auth-sql.conf.ext !include auth-sql.conf.ext

../dovecot/conf.d/auth-sql.conf.ext Fix the passdb path for sql config file to; args = /usr/local/etc/dovecot/dovecot-sql.conf Fix the userdb path for sql config file to; args = /usr/local/etc/dovecot/dovecot-sql.conf

../dovecot/dovecot-sql.conf The file /usr/local/etc/dovecot/dovecot-sql.conf.ext is provided. Copy the example file to the expected.conf file. cd /usr/local/etc/dovecot/ cp dovecot-sql.conf.ext dovecot-sql.conf

../dovecot/dovecot-sql.conf Define the Driver driver = mysql Mysql Connection details connect = host= dbname=dovecot user=root password=afnog Find and set the default password scheme default_pass_scheme = MD5 Uncomment and modify password query (red values change) password_query = SELECT userid AS user, password AS \ password FROM users WHERE userid = '%n' AND active = 'Y’ Uncomment and modify user query user_query = SELECT home, uid, gid FROM users WHERE userid = '%n’

../dovecot/conf.d/10-mail.conf Find and Change the Mail Location to; mail_location = maildir:/home/vmail/%d/%n Uncomment and Fix the Directory path where to find mail plugins mail_plugin_dir = /usr/local/lib/dovecot

../dovecot/conf.d/15-lda.conf Add the following values in bold postmaster_address =

Creating Dovecot’s Mysql DB Having configured dovecot to use Mysql, we need to setup create the database in Mysql and populate the database with a user information We have provided for a basic sql schema that will be used in this class and placed it at /home/afnog/dovecot-mysql- schema.sql Change directory to /home/afnog cd /home/afnog Check to see that the file exists in the directory ls Run the schema in mysql to create the database mysql –p <dovecot-mysql-schema.sql Enter the mysql password on the prompt

…Cont’d Create a user that will manage the virtual users pw adduser vmail -m check the the UID of the vmail user and take note of it for the next steps cat /etc/passwd | grep vmail

Inserting records in Mysql DB The database created by the dovecot-mysql-schema.sql is empty To populate data on the mysql database there are two options; i)Manually from the mysql CLI ii)Using Web/GUI like PHPMyAdmin For this class we shall use the mysql CLI to get more hands on experience Replace UID and GID below with the “vmail” UID/GID for example GID is ‘1002’ Xxxx.bogus.gh is the domain created in the DNS class. Important Replace UID and GID below with that of vmail user #mysql –p Mysql> use dovecot; Mysql> insert into users (userid, domain, password, home, uid, gid) values (‘afnog’, ‘xxxx.bogus.gh’, md5(‘success’), ‘/home/vmail/%d/%n’, ’UID’, ‘GID’); Mysql> insert into users (userid, domain, password, home, uid, gid) values (‘yourname’, ‘xxxx.bogus.gh’, md5(‘2013’), ‘/home/vmail/%d/%n’, ’UID’, ‘GID’);

Exim Delivery to Virtual Users using Dovecot Delivery

Exim Accepting Open and Edit /usr/local/etc/exim/configure # vi /usr/local/etc/exim/configure Add the Mysql database access config line below primary_hostname hide mysql_servers = localhost/dovecot/root/afnog Then Add a localuser Router the following lines in the “Routers Section” dovecot_router: driver = accept condition = ${lookup mysql {SELECT home FROM users WHERE userid=‘$local_part’}} transport = dovecot_delivery

Exim Delivery to Dovecot Add local_delivery with the following lines under the transport section in the configure file. dovecot_delivery: driver = pipe command = /usr/local/libexec/dovecot/deliver message_prefix = message_suffix = delivery_date_add envelope_to_add return_path_add log_output user = vmail temp_errors = 64 : 69 : 70 : 71 : 72 : 73 : 74 : 75 : 78

Restart Exim & Dovecot Restart both Exim and Dovecot # /usr/local/etc/rc.d/exim restart # /usr/local/etc/rc.d/dovecot restart Send tests and watch the logfiles. Try and log in using the virtual user names and passwords.