<?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>asingh &#187; Zimbra</title>
	<atom:link href="http://asingh.com.np/tag/zimbra/feed/" rel="self" type="application/rss+xml" />
	<link>http://asingh.com.np</link>
	<description>A fusion of Art &#38; Technology</description>
	<lastBuildDate>Thu, 31 May 2012 08:06:29 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>How to use Procmail with ZCS</title>
		<link>http://asingh.com.np/blog/how-to-use-procmail-with-zcs/</link>
		<comments>http://asingh.com.np/blog/how-to-use-procmail-with-zcs/#comments</comments>
		<pubDate>Tue, 18 Oct 2011 09:08:06 +0000</pubDate>
		<dc:creator>Abhishek Singh</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Guides]]></category>
		<category><![CDATA[Mail Server]]></category>
		<category><![CDATA[Planet Fedora]]></category>
		<category><![CDATA[Procmail]]></category>
		<category><![CDATA[Zimbra]]></category>

		<guid isPermaLink="false">http://asingh.com.np/?p=461</guid>
		<description><![CDATA[This article will guide you through setting up Procmail along with Zimbra Collaboration Server (ZCS). For those who do not know about procmail, it is a mail delivery agent (MDA) capable of sorting incoming mail into various directories and filtering out spam messages. The important feature of procmail is its ability to filter out incoming/outgoing [...]]]></description>
				<content:encoded><![CDATA[<p>This article will guide you through setting up <a title="Procmail Home" href="http://www.procmail.org/" target="_blank">Procmail</a> along with Zimbra Collaboration Server (ZCS). For those who do not know about procmail, it is a mail delivery agent (MDA) capable of sorting incoming mail into various directories and filtering out spam messages. The important feature of procmail is its ability to filter out incoming/outgoing mails based on regular expression, and take action upon the sorted out mail (e.g. move to a different folder, mark as spam, forward it to another address, or discard/delete it).</p>
<p>ZCS does not natively support Procmail, and hence there are 3 ways to use procmail with ZCS:</p>
<ol>
<li>Use ZCS with a MTA set to a server/installation with procmail configured (e.g. ZCS has a MTA set to another machine which has postfix with procmail configured and all the filtering is done by that server)</li>
<li>Use ZCS as normal, and run procmail on your mailbox (through the procmailrc file), to do the sorting/filtering.</li>
<li>Use ZCS with procmail as a pipe for mail delivery. (This guide will discuss this way of using procmail.)</li>
</ol>
<p>Let&#8217;s assume:</p>
<ul>
<li>The mail server with ZCS has already been installed and configured. If not, check my <a href="http://asingh.com.np/blog/installing-zimbra-collaboration-server-zcs-on-centos/">ZCS installation guide</a> and install ZCS.</li>
<li>We want to use procmail to filter all emails.</li>
<li>We want to discard emails with attachments that are destined for outside of our domain (i.e. test-example.com), but allow email with attachments for inside our domain.</li>
<li>We are using a CentOS 6 machine (works on Fedora, RHEL as well).</li>
<li>sudo is configured for the user or we are executing commands as root user.</li>
</ul>
<h2>Install Procmail</h2>
<pre class="brush: bash; title: ; notranslate">
sudo yum -y install procmail</pre>
<h2>Set ZCS Transport Map</h2>
<ul>
<li>Login as <strong>zimbra</strong> user.</li>
</ul>
<pre class="brush: bash; title: ; notranslate">
su - zimbra</pre>
<ul>
<li>Check the currently configured transport map for postfix:</li>
</ul>
<pre class="brush: bash; title: ; notranslate">
cat /opt/zimbra/postfix/conf/main.cf | grep transport_maps</pre>
<p>The output should look like:</p>
<pre class="brush: plain; title: ; notranslate">
transport_maps = proxy:ldap:/opt/zimbra/conf/ldap-transport.cf</pre>
<ul>
<li>Add the transport file to the zimbra configuration.</li>
</ul>
<pre class="brush: bash; title: ; notranslate">
zmlocalconfig -e postfix_transport_maps=' hash:/opt/zimbra/postfix/conf/transport,proxy:ldap:/opt/zimbra/conf/ldap-transport.cf'</pre>
<div class="woo-sc-box info   ">Note that the second part of the value of the postfix_transport_maps key (i.e. proxy:ldap:/opt/zimbra/conf/ldap-transport.cf) is the same as the output of the previous step/command.</div>
<ul>
<li>Add procmail pipe to the transport file (requires to edit the file as root user).</li>
</ul>
<pre class="brush: bash; title: ; notranslate">
su -
vim /opt/zimbra/postfix/conf/transport</pre>
<p>Add the following content to the file:</p>
<pre class="brush: plain; title: ; notranslate">
*    procmail-pipe</pre>
<div class="woo-sc-box info   ">The above configuration means to configure the pipe of every mail (hence *). For other configuration sets, please see <a href="http://www.postfix.org/transport.5.html">Postfix Manual</a>for details.</div>
<ul>
<li>Create the db file for the transport map.</li>
</ul>
<pre class="brush: bash; title: ; notranslate">
su - zimbra
postmap /opt/zimbra/postfix/conf/transport</pre>
<ul>
<li>For the pipe to work, a corresponding set of configuration needs to be done in the postfix&#8217;s master.cf file. In this case master.cf.<strong>in</strong> file.</li>
</ul>
<pre class="brush: bash; title: ; notranslate">
vim /opt/zimbra/postfix/conf/master.cf.in</pre>
<p>Add the following text at the end of the file:</p>
<pre class="brush: plain; title: ; notranslate">
procmail-pipe    unix    -    n    n    -    -    pipe
flags=    user=zimbra    argv=/usr/bin/procmail /opt/zimbra/procmail/procmailrc</pre>
<div class="woo-sc-box info   ">Note that the first line does not start with white space, the second line should be just below the first line and should start with a whitespace.</div>
<h2>Create the Procmail Recipe</h2>
<ul>
<li>Create the Procmail recipe file (i.e. /opt/zimbra/procmail/procmailrc file that we have configured in the previous step).</li>
</ul>
<pre class="brush: bash; title: ; notranslate">
mkdir /opt/zimbra/procmail/
cd /opt/zimbra/procmail/
touch procmailrc
chown -R zimbra:zimbra .
vim procmailrc</pre>
<p>Add the following content to the file:</p>
<pre class="brush: plain; title: ; notranslate">
SHELL = /bin/sh
PATH=$HOME/bin:/usr/bin:/bin:.
MAILDIR=/opt/zimbra/procmail/ # You better make sure it exists
DEFAULT=$MAILDIR
LOGFILE=.procmaillog
LOCKFILE=.procmaillock
VERBOSE=yes

:0
* !To:.*test-example\.com.*
* ! ^Content-Type:.*text/plain.*
{
:0B
* ^(Content-(Type|Disposition):.*|[ ]*(file)?)name=(&quot;[^&quot;]*|[^]*)\..*
/dev/null
}</pre>
<div class="woo-sc-box info   ">You can add your own procmail recipe in the procmailrc file depending upon what you want procmail to do. In this case we are discarding outgoing mail with attachment destined for users outside our domain.</div>
<ul>
<li>Restart Postfix.</li>
</ul>
<pre class="brush: bash; title: ; notranslate">
zmmtactl stop
zmmtactl start</pre>
<p>Thanks to the <a href="http://www.zimbra.com/forums/administrators/47711-zimbra-procmail.html" target="_blank">Zimbra forum entry</a> and Zimbra Wiki on <a href="http://wiki.zimbra.com/index.php?title=Configuring_Postfix_to_work_with_piped_scripts" target="_blank">Configuring Postfix to work with piped scripts</a> from where I adapted my installation and hence wrote this guide.</p>
<h2>Further Reading</h2><ul><li><a href="http://linuxnet.ca/postfix/dedicated_transport.html" title="Postfix Dedicated Transport Howto" rel="nofollow">Postfix Dedicated Transport Howto</a> <img src="http://asingh.com.np/wp-content/plugins/netblog/images/external-link-ltr-icon.png" /></li><li><a href="http://wiki.zimbra.com/index.php?title=Configuring_Postfix_to_work_with_piped_scripts" title="Configuring Postfix to work with piped scripts - Zimbra :: Wiki" rel="nofollow">Configuring Postfix to work with piped scripts - Zimbra :: Wiki</a> <img src="http://asingh.com.np/wp-content/plugins/netblog/images/external-link-ltr-icon.png" /></li><li><a href="http://www.postfix.org/transport.5.html" title="Postfix manual - transport(5)" rel="nofollow">Postfix manual - transport(5)</a> <img src="http://asingh.com.np/wp-content/plugins/netblog/images/external-link-ltr-icon.png" /></li><li><a href="http://www.zimbra.com/forums/administrators/47711-zimbra-procmail.html" title="Zimbra and procmail - Zimbra :: Forums" rel="nofollow">Zimbra and procmail - Zimbra :: Forums</a> <img src="http://asingh.com.np/wp-content/plugins/netblog/images/external-link-ltr-icon.png" /></li></ul>]]></content:encoded>
			<wfw:commentRss>http://asingh.com.np/blog/how-to-use-procmail-with-zcs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing Zimbra Collaboration Server (ZCS) on CentOS</title>
		<link>http://asingh.com.np/blog/installing-zimbra-collaboration-server-zcs-on-centos/</link>
		<comments>http://asingh.com.np/blog/installing-zimbra-collaboration-server-zcs-on-centos/#comments</comments>
		<pubDate>Tue, 18 Oct 2011 08:02:12 +0000</pubDate>
		<dc:creator>Abhishek Singh</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Guides]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[Mail Server]]></category>
		<category><![CDATA[Planet Fedora]]></category>
		<category><![CDATA[Zimbra]]></category>

		<guid isPermaLink="false">http://asingh.com.np/?p=438</guid>
		<description><![CDATA[This guide will take you through installing Zimbra Collaboration Server (ZCS) which is an integrated bundle of Mail Server, web-documents, and other collaboration services enriched with easy web-administration interfaces. This makes ZCS a good choice for those who do not want to install and configure all the tools and service needed to support the features [...]]]></description>
				<content:encoded><![CDATA[<div class="woo-sc-box note   ">This guide has been tested on the following settings:</p>
<p>CentOS Version: <strong>6.0 x86_64</strong><br />
ZCS Version:<strong> 7.1.3 GA 3664 for RHEL 6 x86_64</strong> <strong>Open Source</strong> (Release 7.1.3_GA_3346.RHEL6_64_20110928134428)</div>
<p>This guide will take you through installing <a title="Zimbra Collaboration Server" href="http://www.zimbra.com/products/zimbra-open-source.html" target="_blank">Zimbra Collaboration Server</a> (ZCS) which is an integrated bundle of Mail Server, web-documents, and other collaboration services enriched with easy web-administration interfaces. This makes ZCS a good choice for those who do not want to install and configure all the tools and service needed to support the features required for email, and web administration + web-mail interface is quite a time and effort saving feature of ZCS.</p>
<p>This guide makes a few assumptions about the prerequisites that have already been made/configured/handled:</p>
<ul>
<li>The server will handle email for the domain <strong>test-example.com</strong>.</li>
<li>The server will be hosted on a machine named <strong>mail.test-example.com</strong>.</li>
<li>The DNS is properly set up for resolving the names, and as well as for the MX record for test-example.com.</li>
<li>The machine for mail server has access to the DNS server and can resolve names.</li>
<li>The installer for ZCS (RHEL 6) has been downloaded.</li>
<li>The mail server has access to the Internet (for installing/updating packages, as well as to contact external relay MTA)</li>
<li>sudo is configured for the user, or the commands are used as root user.</li>
</ul>
<h2>Pre-Installation Tweaks</h2>
<ul>
<li>Disable system installed postfix/sendmail as ZCS runs its own postfix. System-wide installed postfix/sendmail interferes with ZCS&#8217;s postfix.</li>
</ul>
<pre class="brush: bash; title: ; notranslate">
sudo service postfix stop
sudo chkconfig postfix off
sudo service sendmail stop
sudo chkconfig sendmail off</pre>
<ul>
<li>Install nc package</li>
</ul>
<pre class="brush: bash; title: ; notranslate">
sudo yum -y install nc</pre>
<ul>
<li>Disable SELinux (I&#8217;ve not yet found a way to use ZCS with SELinux on).</li>
</ul>
<pre class="brush: bash; title: ; notranslate">
vim /etc/sysconfig/selinux</pre>
<p>In the file, set:</p>
<pre class="brush: plain; title: ; notranslate">
SELINUX=disabled</pre>
<pre class="brush: bash; title: ; notranslate">
sudo setenforce 0</pre>
<ul>
<li>Allow a few ports for Zimbra beforehand (not required before installation, but makes no harm in pre-setting it)</li>
</ul>
<pre class="brush: bash; title: ; notranslate">
sudo iptables -I INPUT -p tcp --dport 443 -j ACCEPT #HTTPS
sudo iptables -I INPUT -p tcp --dport 3930 -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 110 -j ACCEPT #POP3
sudo iptables -I INPUT -p tcp --dport 143 -j ACCEPT #IMAP
sudo iptables -I INPUT -p tcp --dport 993 -j ACCEPT #IMAPS
sudo iptables -I INPUT -p tcp --dport 389 -j ACCEPT #LDAP
sudo iptables -I INPUT -p tcp --dport 995 -j ACCEPT #POP3S
sudo iptables -I INPUT -p tcp --dport 7025 -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 5800 -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 5900 -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 7071 -j ACCEPT #Port for ZCS Web Administration
sudo iptables -I INPUT -p tcp --dport 3894 -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 3895 -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 80 -j ACCEPT #HTTP (for webmail) </pre>
<ul>
<li>Fix the hosts file.</li>
</ul>
<pre class="brush: bash; title: ; notranslate">
vim /etc/hosts</pre>
<p>Put the name of the machine (i.e. mail.test-example.com) in the hosts file (assuming that the IP of the machine is 10.0.0.253):</p>
<pre class="brush: plain; title: ; notranslate">
10.0.0.253    mail.test-example.com mail</pre>
<p>The hosts file should look like this:</p>
<pre class="brush: plain; title: ; notranslate">
127.0.0.1    localhost localhost.localdomain localhost4 localhost4.localdomain4
::1          localhost localhost.localdomain localhost6 localhost6.localdomain6
10.0.0.253   mail.test-example.com mail</pre>
<h2>Install ZCS</h2>
<ul>
<li>Deflate the installation archive (in this case zcs-7.1.3_GA_3346.RHEL6_64.20110928134428.tgz file).</li>
</ul>
<pre class="brush: bash; title: ; notranslate">
tar -zxvf zcs-7.1.3_GA_3346.RHEL6_64.20110928134428.tgz</pre>
<ul>
<li>Start the installation:</li>
</ul>
<pre class="brush: bash; title: ; notranslate">
cd zcs-7.1.3_GA_3346.RHEL6_64.20110928134428
./install.sh --platform-override</pre>
<div class="woo-sc-box info   "><strong>&#8211;platform-override</strong> parameter is applied here because the base system configuration for the installer (i.e. RHEL6_x86_64) does not match with the target system (CentOS6 x86_64).</div>
<ul>
<li>You&#8217;ll be asked various questions during the installation, use the default or obvious answers.</li>
<li>Before completing the installation and writing configuration parameters to the configuration file, you&#8217;ll be prompted to review the settings or to fix some unset configuration. At this step, make sure you set the password for the admin user. It has a menu based approach. After reviewing/setting configuration, get out of the screen and save the configuration.</li>
<li>Let the installer do the rest of the configuration, at the end of which you will be notified of the completion of the installation.</li>
</ul>
<h2>Access Zimbra Collaboration Server</h2>
<p>The default location of ZCS installation is <strong>/opt/zimbra/</strong>, and the installer configures a init.d/service script through which you can stop, start, restart and check the status of ZCS. All zimbra components and daemons run as user <strong>zimbra</strong>. ZCS Administrative web-interface is available at 7071 port and the webmail runs at the default http port (i.e. port 80) of the machine. For this instance, the administrative interface would be available at <strong>http://mail.test-example.com:7071</strong> and the webmail would be available at <strong>http://mail.test-example.com</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://asingh.com.np/blog/installing-zimbra-collaboration-server-zcs-on-centos/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
