\documentclass{article}
\usepackage{ulem}
\usepackage{graphicx}
\usepackage{hyperref}
\pagestyle{headings}
\begin{document}
This <a href="https://wiki.horde.org/HowTo">HowTo</a> is from adapted from an e-mail exchange on the Sork mailing list.  It is a discussion of setting up Sork's vacation module<br />
for use with an ldap based system, using gnarwl as the server-side vacation program.  The software used is:

MTA:                        postfix<br />
vacation program: gnarwl<br />
LDAP:                      openldap 2.2.13-4<br />
Horde version:       3.1.3<br />
vacation version:   3.0

(For those who don't want to use gnarwl, a "traditional" vacation program for ldap is available at <a href="http://www.etc.msys.ch/sources/ldapvacation/\">http://www.etc.msys.ch/sources/ldapvacation/\textbackslash\{\}</a>).

Note

\begin{itemize}
\item sork's vacation may be replaced by Ingo in the future.


\item freebsd user. Downloaded gnarwl package does not support openldap, build from port instead.


\end{itemize}
First, define a postfix transport map for your specific internal autoreply domain.<br />
If your domain is "example.com" and your autoreply domain is to be "autoreply.example.com", then you would add the following to<br />
/etc/postfix/transport:

<pre><code>
autoreply.example.com    gnarwl:example.com
</code></pre>
Next, create the database files from the above file.  The following command should create the appropriate transport.db file:

<pre><code>
postmap hash:transport
</code></pre>
Next add the transport to the postfix main.cf file in the "TRANSPORT MAPS" section:

<pre><code>
<snip>
\# TRANSPORT MAPS
\#
transport\_maps = hash:/etc/postfix/transport
</snip>
</code></pre>
Now add a new service to the /etc/postfix/master.cf file:

<pre><code>
</snip>
\# gnarwl autoresponder
gnarwl    unix  -       n       n       -       -       pipe
  flags=F  user=gnarwl argv=/usr/bin/gnarwl -a \$\{user\}@\$\{nexthop\} -s \$\{sender\}
</snip>
</code></pre>
Create an LDAP vacation alias map called ldap-virtual\_alias\_maps-vacation.cf:

<pre><code>
<snip>
server\_host = ldap://ldap.example.com
version = 3
server\_port = 389
search\_base = ou=mail,...
query\_filter = (\&(objectClass=MailAccount)(objectClass=Vacation)(mail=\%s)(accountActive=TRUE)(vacationActive=TRUE))
result\_attribute = mail
result\_filter = \%s,\%u@autoreply.example.com
bind = no
</snip>
</code></pre>
Of course, the above needs to reflect your ldap environment...

Append the alias map to LDAP's main.cf file (make sure it's the first map listed):

<pre><code>
<snip>
virtual\_alias\_maps =
ldap:/etc/postfix/ldap-virtual\_alias\_maps-vacation.cf,
ldap:/etc/postfix/ldap-virtual\_alias\_maps.cf
</snip>
</code></pre>
after those changes, reload postfix:

<pre><code>
postfix reload
</code></pre>
Extend your LDAP with the vacation schema and setup a test account. An example ldif follows:

<pre><code>
<snip>
dn:mail=vacationtest@example.com,...
objectClass: top
objectClass: Vacation
mail: vacationtest@example.com
accountActive: TRUE
[... other mail specific attributes ...]
vacationActive: TRUE
vacationInfo:: [vacation message has to be utf-8 encoded and also base64 if necessary]
</snip>
</code></pre>
After loading the above ldif, test your postfix alias vacation lookup map:

<pre><code>
postmap -v -q vacationtest@example.com
ldap:/etc/postfix/ldap-virtual\_alias\_maps-vacation.cf
</code></pre>
This should return the following if the vacation has been enabled, otherwise nothing.

<pre><code>
<snip>
vacationtest@example.com,vacationtest@autoreply.example.com
</snip>
</code></pre>
If this works so far, configure gnawrl to suit your needs (only the ldap part and the header config is included):

Edit gnarwl.cfg and change the following lines:

<pre><code>
<snip>
server ldap.example.com
protocol 3
base ou=mail...
queryfilter
(\&(objectClass=MailAccount)(objectClass=Vacation)(mail=\$recepient)(accountActive=TRUE)(vacationActive=TRUE))
mta /usr/sbin/sendmail \$sender
charset
forceheader /var/lib/gnarwl/header-utf8.txt
loglevel 3
</snip>
</code></pre>
Create the file /var/lib/gnarwl/header-utf8.txt and add the content shown below:

<pre><code>
<snip>
From: \$fullname <\$recepient>
To: \$sender
X-mailer: GNARWL
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Subject: Re: \$subject
</snip>
</code></pre>
Finally you will have to configure the sork vacation app with the ldap driver. This should be an easy task now ;)<br />
Remember, that you have to configure/specify the vacation related attributes.

\end{document}
