<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>TommyBlue.it &#187; openssl</title>
	<atom:link href="http://www.tommyblue.it/tag/openssl/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tommyblue.it</link>
	<description>Bombardare per la pace è un po' come trombare per la verginità...</description>
	<lastBuildDate>Tue, 24 Jan 2012 09:34:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Mailserver with OpenLDAP, Postfix, Dovecot, Horde from source on Debian Etch</title>
		<link>http://www.tommyblue.it/2008/10/06/mailserver-with-openldap-postfix-dovecot-horde-from-source-on-debian-etch/</link>
		<comments>http://www.tommyblue.it/2008/10/06/mailserver-with-openldap-postfix-dovecot-horde-from-source-on-debian-etch/#comments</comments>
		<pubDate>Mon, 06 Oct 2008 20:37:14 +0000</pubDate>
		<dc:creator>TommyBlue</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[Informatica]]></category>
		<category><![CDATA[Software Libero]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[debian etch]]></category>
		<category><![CDATA[dovecot]]></category>
		<category><![CDATA[horde]]></category>
		<category><![CDATA[imap]]></category>
		<category><![CDATA[imp]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[openldap]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[pop]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://www.tommyblue.it/?p=241</guid>
		<description><![CDATA[During this howto i&#8217;ll setup a mail server with LDAP users, Postfix virtual transport and POP/IMAP access (with SSL). I&#8217;ll moreover setup Apache2 with PHP support, Horde webmail, vacation messages and user quotas. Every program will be compiled into /usr/src and installed into /usr/local/program_name. The mailboxes (in Maildir format) will be stored into /mail/uid/ Debian [...]]]></description>
			<content:encoded><![CDATA[<p>During this howto i&#8217;ll setup a mail server with LDAP users, Postfix virtual transport and POP/IMAP access (with SSL). I&#8217;ll moreover setup Apache2 with PHP support, Horde webmail, vacation messages and user quotas.<br />
Every program will be compiled into <em>/usr/src</em> and installed into <em>/usr/local/<strong>program_name</strong></em>. The mailboxes (in Maildir format) will be stored into <em>/mail/<strong>uid</strong>/</em></p>
<h4>Debian Etch installation</h4>
<p>Let&#8217;s start installing Debian Etch from businesscard and unchecking all the default packages (Desktop environment and Base system). After the reboot install some basic package:</p>
<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">apt-get install build-essential vim openssh-server psmisc autoconf file</div></div>
<p>OpenSSH is just an optional server, but i&#8217;m working on a VMWare virtual machine and an ssh console is more comfortable than the VMWare console :)<br />
<span id="more-241"></span></p>
<h4>Softwares</h4>
<p>Now download all the needed packages into <em>/usr/src</em>:</p>
<ul>
<li>OpenSSL 0.9.8i</li>
<li>BerkeleyDB 4.6.21 (<strong>version 4.7 is unsupported from OpenLDAP</strong>)</li>
<li>OpenLDAP 2.4.11</li>
<li>Apache 2.2.9</li>
<li>IMAP 2007b</li>
<li>PHP 5.2.6</li>
<li>Postfix 2.5 Patchlevel 5</li>
<li>Dovecot 1.1.3</li>
</ul>
<h4>OpenSSL</h4>
<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">~$ cd /usr/src/openssl<br />
~$ ./config --openssldir=/usr/local/openssl --prefix=/usr/local/openssl<br />
~$ make<br />
~# make install</div></div>
<h4>BerkeleyDB</h4>
<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">~$ cd /usr/src/db/build_unix<br />
~$ ../dist/configure --prefix=/usr/local/BerkeleyDB<br />
~$ make<br />
~# make install</div></div>
<h4>OpenLDAP</h4>
<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">~# ln -s /usr/local/BerkeleyDB/include/db.h /usr/include/<br />
~$ CPPFLAGS=&quot;-I/usr/local/BerkeleyDB/include/&quot; LDFLAGS=&quot;-L/usr/local/lib -L/usr/local/BerkeleyDB/lib -R/usr/local/BerkeleyDB/lib&quot; LD_LIBRARY_PATH=&quot;/usr/src/db-4.6.21.NC/build_unix/.libs/&quot; ./configure --prefix=/usr/local/openldap --enable-crypt<br />
~$ make depend<br />
~$ make<br />
~$ make test<br />
~# make install</div></div>
<p>For this howto i&#8217;ll use <strong>dc=example,dc=com</strong>. Edit <em>/usr/local/openldap/etc/openldap/slapd.conf</em> including some schemas and setting the password for <strong>cn=Manager,dc=example,dc=com</strong></p>
<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">include &nbsp; &nbsp; &nbsp; &nbsp; /usr/local/openldap/etc/openldap/schema/cosine.schema<br />
include &nbsp; &nbsp; &nbsp; &nbsp; /usr/local/openldap/etc/openldap/schema/nis.schema<br />
include &nbsp; &nbsp; &nbsp; &nbsp; /usr/local/openldap/etc/openldap/schema/inetorgperson.schema</div></div>
<p>Rename <em>/usr/local/openldap/var/openldap-data/DB_CONFIG.example</em> to <em>/usr/local/openldap/var/openldap-data/DB_CONFIG</em> and type:</p>
<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/usr/local/openldap/libexec/slapd</div></div>
<p>to start the server.</p>
<p>Then create an ldif file (<strong>base.ldif</strong>) for the initial user:</p>
<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">dn: dc=example,dc=com<br />
&nbsp; &nbsp; &nbsp; objectclass: dcObject<br />
&nbsp; &nbsp; &nbsp; objectclass: organization<br />
&nbsp; &nbsp; &nbsp; o: example<br />
&nbsp; &nbsp; &nbsp; dc: example<br />
<br />
&nbsp; &nbsp; &nbsp; dn: cn=Manager,dc=example,dc=com<br />
&nbsp; &nbsp; &nbsp; objectclass: organizationalRole<br />
&nbsp; &nbsp; &nbsp; cn: Manager</div></div>
<p>and add it to the database:</p>
<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/usr/local/openldap/bin/ldapadd -x -D &quot;cn=Manager,dc=example,dc=com&quot; -W -f base.ldif</div></div>
<p>Now let&#8217;s create some users, i&#8217;ll use these objects:</p>
<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">objectClass: inetOrgPerson<br />
&nbsp;objectClass: top<br />
&nbsp;objectClass: posixAccount<br />
&nbsp;objectClass: shadowAccount</div></div>
<p>An example:</p>
<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">dn: cn=tommaso,ou=utenti,dc=example,dc=com<br />
cn: Tommaso<br />
gidNumber: 10001<br />
homeDirectory: /mail/tommaso<br />
sn: Visconti<br />
uid: tommaso<br />
uidNumber: 10001<br />
objectClass: inetOrgPerson<br />
objectClass: posixAccount<br />
objectClass: shadowAccount<br />
objectClass: top<br />
loginShell: /bin/bash<br />
givenName: Tommaso<br />
mail: tommaso@example.com<br />
shadowWarning: 7<br />
shadowMax: 99999<br />
shadowLastChange: 14121<br />
labeledURI: pippo<br />
employeeType: active<br />
userPassword: {CRYPT}cfBmIgztxLBh6</div></div>
<p>If you want to set these users as system users install <strong>libnss-ldap</strong></p>
<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">apt-get install libnss-ldap</div></div>
<p>and edit <em>/etc/nsswitch.conf</em></p>
<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">passwd: compat ldap<br />
group: &nbsp;compat ldap<br />
shadow: compat ldap</div></div>
<p>and create the group:</p>
<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">groupadd -g 10001 users</div></div>
<p>You can verify with:</p>
<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">getent passwd</div></div>
<h4>Apache</h4>
<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">~$ cd /usr/src/apache2<br />
<br />
<br />
~$ ./configure --prefix=/usr/local/apache2 --enable-so --with-ssl=/usr/local/openssl/ --enable-ssl<br />
~$ make<br />
~# make install</div></div>
<p>Edit <em>/usr/local/apache2/conf/apache.conf</em> and launch with:</p>
<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/usr/local/apache2/bin/apachectl -k start</div></div>
<h4>IMAP</h4>
<p>The IMAP library is needed from PHP to send email from the webmail.</p>
<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">~$ wget ftp://ftp.cac.washington.edu/imap/imap.tar.Z<br />
~$ cd /usr/src<br />
~$ tar xvzf imap.tar.Z<br />
~$ cd imap-2007b<br />
~$ make slx SSLTYPE=none<br />
~$ mkdir -p /usr/local/imap/lib<br />
~$ mkdir /usr/local/imap/include<br />
~$ cp c-client/*.h /usr/local/imap/include/<br />
~$ cp c-client/*.c /usr/local/imap/lib/<br />
~$ cp c-client/c-client.a /usr/local/imap/lib/libc-client.a</div></div>
<h4>PHP</h4>
<p>First, download and unzip the mysql client libraries, then:</p>
<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">~$ apt-get install libjpeg-dev libpng-dev libxml2-dev libmcrypt-dev libmagic1<br />
~$ cd /usr/src/php<br />
~$ ./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-gettext --with-~$ mcrypt --with-iconv --enable-mbstring=all --enable-mbregex --with-gd --with-png-dir=/usr/lib --with-jpeg-dir=/usr/lib --with-mime-magic=/usr/share/file/magic.mime --with-sqlite --with-ldap=/usr/local/openldap/ --with-imap=/usr/local/imap --with-mysql=/usr/src/mysql-5.0.67-linux-i686/ --with-mysqli=/usr/src/mysql-5.0.67-linux-i686/bin/mysql_config<br />
~$ make<br />
~$ make install</div></div>
<p>Edit <strong>apache.conf</strong> adding <strong>index.php</strong> to the default pages; if not present add this too:</p>
<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&amp;lt;filesmatch \.php$&amp;gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; SetHandler application/x-httpd-php<br />
&amp;lt;/filesmatch&amp;gt;</div></div>
<h4>Postfix</h4>
<p>Create <strong>/etc/ld.so.conf.d/my_libraries.conf</strong>:</p>
<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/usr/local/openssl/lib<br />
/usr/local/BerkeleyDB/lib<br />
/usr/local/openldap/lib</div></div>
<p>and launch <strong>ldconfig</strong>!</p>
<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">~# ln -s /usr/local/BerkeleyDB/lib/libdb.so /usr/lib<br />
~# addgroup --system postfix<br />
~# adduser --system -ingroup postfix --home /mail --no-create-home --disabled-password postfix<br />
~# addgroup --system postdrop<br />
~# addgroup --gid 800 maildeliver<br />
~# adduser --system --uid 800 --gid 800 --home /mail --disabled-password --no-create-home maildeliver<br />
~$ export LD_LIBRARY_PATH=&quot;/usr/local/openldap/lib:/usr/local/BerkeleyDB/lib/&quot;<br />
~$ make makefiles CCARGS='-DDEF_CONFIG_DIR=\&quot;/usr/local/postfix/etc\&quot; -DDEF_COMMAND_DIR=\&quot;/usr/local/postfix/sbin\&quot; -DDEF_DAEMON_DIR=\&quot;/usr/local/postfix/libexec\&quot; -DDEF_MANPAGE_DIR=\&quot;/usr/local/postfix/man\&quot; -DDEF_SENDMAIL_PATH=\&quot;/usr/local/postfix/bin/sendmail\&quot; -DDEF_MAILQ_PATH=\&quot;/usr/local/postfix/bin/mailq\&quot; -DDEF_DATA_DIR=\&quot;/usr/local/postfix/lib\&quot; -DHAS_DB -I/usr/local/BerkeleyDB/include -DHAS_LDAP -I/usr/local/openldap/include' AUXLIBS='-llber -L/usr/local/BerkeleyDB/include/ -ldb -lldap -L/usr/local/openldap/lib'<br />
~$ make<br />
~# make install<br />
~# ln -s /usr/local/postfix/etc/aliases /etc/<br />
~# /usr/local/postfix/sbin/postfix -c /usr/local/postfix/etc/ set-permissions<br />
~# chown -R postfix /usr/local/postfix/lib</div></div>
<p>The gid and user 800 will be used for the virtual transport.</p>
<p>This is <strong>main.cf</strong>:</p>
<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">queue_directory = /usr/local/postfix-2.5.5/spool<br />
command_directory = /usr/local/postfix-2.5.5/sbin<br />
daemon_directory = /usr/local/postfix-2.5.5/libexec<br />
data_directory = /usr/local/postfix-2.5.5/lib<br />
mail_owner = postfix<br />
debug_peer_level = 2<br />
debugger_command =<br />
&nbsp; &nbsp; &nbsp;PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin<br />
&nbsp; &nbsp; &nbsp;ddd $daemon_directory/$process_name $process_id &amp; sleep 5<br />
sendmail_path = /usr/local/postfix-2.5.5/sbin/sendmail<br />
newaliases_path = /usr/local/postfix-2.5.5/bin/newaliases<br />
mailq_path = /usr/local/postfix-2.5.5/bin/mailq<br />
setgid_group = postdrop<br />
html_directory = no<br />
manpage_directory = /usr/local/postfix-2.5.5/man<br />
readme_directory = no<br />
smtpd_banner = Benvenuti ai puri di cuore<br />
biff = no<br />
append_dot_mydomain = no<br />
myhostname = mail.example.com<br />
alias_maps = hash:/etc/aliases<br />
alias_database = hash:/etc/aliases<br />
myorigin = /etc/mailname<br />
mydestination = localhost<br />
relayhost = <br />
mynetworks = 127.0.0.0/8 192.168.0.0/24<br />
mailbox_size_limit = 0<br />
recipient_delimiter = +<br />
inet_interfaces = all<br />
home_mailbox = Maildir/<br />
virtual_transport = virtual<br />
virtual_uid_maps = static:800<br />
virtual_gid_maps = static:800<br />
virtual_mailbox_base = /mail<br />
virtual_mailbox_maps = ldap:/usr/local/postfix-2.5.5/etc/ldap-accounts.cf<br />
virtual_mailbox_domains = example.com<br />
virtual_alias_maps = hash:/etc/aliases<br />
relay_domains = localhost</div></div>
<p><strong>ldap-accounts.cf</strong>:</p>
<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">server_host = localhost<br />
search_base = ou=utenti,dc=example,dc=com<br />
query_filter = mail=%s<br />
result_attribute = uid<br />
version = 3<br />
bind = yes<br />
bind_dn = cn=Manager,dc=example,dc=com<br />
bind_pw = pippo</div></div>
<p>Remember to create an user for bindings and edit Postfix and Dovecot configurations to use it.<br />
To verify the ldap file use postmap:</p>
<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">~$ postmap -q tommaso.visconti@example ldap:/usr/local/postfix/etc/ldap-aliases.cf <br />
tommaso</div></div>
<p>Start postfix with:</p>
<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">~# /usr/local/postfix/sbin/postfix start</div></div>
<h4>Dovecot</h4>
<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">~$ cd /usr/src/dovecot<br />
~$ LDFLAGS=&quot;-L/usr/local/openldap/lib -L/usr/local/openssl/lib&quot; CPPFLAGS=&quot;-I/usr/local/openldap/include -I/usr/local/openssl/include/&quot; ./configure --prefix=/usr/local/dovecot --with-ldap=yes --with-ssl=openssl<br />
~$ make<br />
~# make install<br />
~# adduser --system -ingroup mail --home /usr/local/dovecot/lib --no-create-home --shell /bin/false --disabled-password dovecot</div></div>
<p>This is <strong>dovecot.conf</strong>:</p>
<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">protocols = &nbsp;imap imaps pop3 pop3s<br />
mail_uid = 800<br />
mail_gid = 800<br />
listen = *<br />
disable_plaintext_auth = no<br />
shutdown_clients = yes<br />
log_path = /var/log/dovecot.log <br />
info_log_path = /var/log/mail.log<br />
log_timestamp = &quot;%Y-%m-%d %H:%M:%S &quot;<br />
syslog_facility = mail<br />
ssl_listen = *<br />
ssl_disable = no<br />
ssl_cert_file = /etc/ssl/certs/dovecot.pem<br />
ssl_key_file = /etc/ssl/private/dovecot.pem<br />
login_chroot = yes<br />
login_greeting = Welcome to my mail server.<br />
login_log_format_elements = user=&lt; %u&gt; method=%m rip=%r lip=%l %c<br />
login_log_format = %$: %s<br />
mail_location = maildir:/mail/%n <br />
mail_full_filesystem_access = no<br />
mail_debug = no<br />
first_valid_uid = 800<br />
last_valid_uid = 800<br />
first_valid_gid = 800<br />
last_valid_gid = 800<br />
protocol imap {<br />
}<br />
protocol pop3 {<br />
&nbsp; pop3_uidl_format = %08Xu%08Xv<br />
}<br />
auth_verbose = no<br />
auth_debug = no<br />
auth_debug_passwords = no<br />
auth default {<br />
&nbsp; mechanisms = PLAIN LOGIN<br />
&nbsp; passdb ldap {<br />
&nbsp; &nbsp; args = /usr/local/Dovecot-1.1.3/etc/dovecot-ldap.conf <br />
&nbsp; }<br />
&nbsp; userdb ldap {<br />
&nbsp; &nbsp; # Path for LDAP configuration file, see /etc/dovecot/dovecot-ldap.conf for example<br />
&nbsp; &nbsp; args = /usr/local/Dovecot-1.1.3/etc/dovecot-ldap.conf <br />
&nbsp; }<br />
&nbsp; user = mail_deliver<br />
}<br />
dict {<br />
}<br />
plugin {<br />
}</div></div>
<p>and <strong>dovecot-ldap.conf</strong>:</p>
<div class="codecolorer-container text railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">hosts = localhost<br />
dn = cn=Manager,dc=example,dc=come<br />
dnpass = pippo<br />
ldap_version = 3<br />
base = ou=utenti, dc=example, dc=com<br />
deref = never<br />
scope = subtree<br />
user_attrs = homeDirectory=home<br />
user_filter = (&amp;(employeeType=active)(mail=%u))<br />
pass_attrs = mail=user@domain,userPassword=password<br />
pass_filter = (&amp;(employeeType=active)(mail=%u))<br />
default_pass_scheme = CRYPT</div></div>
<p>Start dovecot with <strong>/usr/local/dovecot/sbin/dovecot</strong></p>
<h4>Webmail</h4>
<p>I suggest <a href="http://www.horde.org/">Horde Framework</a> or <a href="http://roundcube.net/">Roundcube</a></p>
<h4>Webography</h4>
<ul>
<li><a href="http://www.openssl.org/">OpenSSL</a></li>
<li><a href="http://www.oracle.com/technology/products/berkeley-db/index.html">BerkeleyDB</a></li>
<li><a href="http://www.openldap.org">OpenLDAP</a></li>
<li><a href="http://www.apache.org">Apache</a></li>
<li><a href="ftp://ftp.cac.washington.edu/imap/">IMAP</a></li>
<li><a href="http://www.php.net">PHP</a></li>
<li><a href="http://phpldapadmin.sourceforge.net/">PHPLdapAdmin</a></li>
<li><a href="http://www.postfix.org">Postfix</a></li>
<li><a href="http://www.dovecot.org">Dovecot</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.tommyblue.it/2008/10/06/mailserver-with-openldap-postfix-dovecot-horde-from-source-on-debian-etch/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Chiudersi fuori casa</title>
		<link>http://www.tommyblue.it/2008/05/16/chiudersi-fuori-casa/</link>
		<comments>http://www.tommyblue.it/2008/05/16/chiudersi-fuori-casa/#comments</comments>
		<pubDate>Fri, 16 May 2008 16:39:48 +0000</pubDate>
		<dc:creator>TommyBlue</dc:creator>
				<category><![CDATA[Informatica]]></category>
		<category><![CDATA[Software Libero]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[vulnerability]]></category>

		<guid isPermaLink="false">http://www.tommyblue.it/?p=150</guid>
		<description><![CDATA[Come probabilmente molti di voi avranno letto, tutte le distribuzioni Debian-based sono state per un periodo vulnerabili ad un bug piuttosto grossetto (una specie di voragine, per usare un eufemismo): le chiavi generate da openssl patchato da Debian non erano casuali come avrebbero dovuto. Fattostà che il mondo linux ha come sempre reagito con rapidità [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.tommyblue.it/wp-content/uploads/2008/05/foto-11.jpg" alt="" title="io&#038;giulia" width="250" height="188" class="alignleft size-full wp-image-151" /> Come probabilmente molti di voi <a href="http://metasploit.com/users/hdm/tools/debian-openssl/">avranno letto</a>, tutte le distribuzioni Debian-based sono state per un periodo vulnerabili ad un bug piuttosto grossetto (una specie di voragine, per usare un eufemismo): le chiavi generate da openssl patchato da Debian non erano casuali come avrebbero dovuto.</p>
<p>Fattostà che il mondo linux ha come sempre reagito con rapidità e sono fioccati gli aggiornamenti di sicurezza. In particolare Debian ha anche aggiunto il pacchetto <strong>openssl-blacklist</strong> in cui sono elencate una serie di chiavi vulnerabili. Fin qui tutto bene, non fosse che la chiave con cui accedevo via ssh al mio server sia stata simpaticamente messa in blacklist, col risultato che adesso sono allegramente chiuso fuori casa&#8230; </p>
<p>&#8230;e mi sono anche meritatamente preso di <strong>niubbo</strong> da <a href="http://pi242422.wordpress.com/">Alessandro</a> :(</p>
<p><strong>Edit:</strong></p>
<p>Aggiungo questa vignetta fantastica di <a href="http://dilbert.com/strips/comic/2001-10-25/">Dilbert</a> sulla randomizzazione secondo <a href="http://www.debian.org">Debian</a> :D<br />
<a href='http://www.tommyblue.it/wp-content/uploads/2008/05/schermata1.png' rel="lightbox[150]"><img src="http://www.tommyblue.it/wp-content/uploads/2008/05/schermata1-300x87.png" alt="" title="Dilbert.com" width="300" height="87" class="alignnone size-medium wp-image-152" /></a></p>
<p><strong>Edit 2:</strong></p>
<p>Sembra che a quelli di Debian proprio non vogliano fargliela passare liscia :D<br />
<img src="http://imgs.xkcd.com/comics/security_holes.png" alt="xkcd" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tommyblue.it/2008/05/16/chiudersi-fuori-casa/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

