This HowTo is from adapted from an e-mail exchange on the Sork mailing list. It is a discussion of setting up Sork's vacation module
for use with an ldap based system, using gnarwl as the server-side vacation program. The software used is:

MTA: postfix
vacation program: gnarwl
LDAP: openldap 2.2.13-4
Horde version: 3.1.3
vacation version: 3.0

(For those who don't want to use gnarwl, a "traditional" vacation program for ldap is available at

- sork's vacation may be replaced by Ingo in the future.
- freebsd user. Downloaded gnarwl package does not support openldap, build from port instead.

First, define a postfix transport map for your specific internal autoreply domain.
If your domain is "" and your autoreply domain is to be "", then you would add the following to

Next, create the database files from the above file. The following command should create the appropriate transport.db file:

postmap hash:transport

Next add the transport to the postfix file in the "TRANSPORT MAPS" section:

transport_maps = hash:/etc/postfix/transport

Now add a new service to the /etc/postfix/ file:

# gnarwl autoresponder
gnarwl    unix  -       n       n       -       -       pipe
  flags=F  user=gnarwl argv=/usr/bin/gnarwl -a ${user}@${nexthop} -s ${sender}

Create an LDAP vacation alias map called

server_host = ldap://
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,
bind = no

Of course, the above needs to reflect your ldap environment...

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

virtual_alias_maps =

after those changes, reload postfix:

postfix reload

Extend your LDAP with the vacation schema and setup a test account. An example ldif follows:

objectClass: top
objectClass: Vacation
accountActive: TRUE
[... other mail specific attributes ...]
vacationActive: TRUE
vacationInfo:: [vacation message has to be utf-8 encoded and also base64 if necessary]

After loading the above ldif, test your postfix alias vacation lookup map:

postmap -v -q

This should return the following if the vacation has been enabled, otherwise nothing.


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:

protocol 3
base ou=mail...
mta /usr/sbin/sendmail $sender
forceheader /var/lib/gnarwl/header-utf8.txt
loglevel 3

Create the file /var/lib/gnarwl/header-utf8.txt and add the content shown below:

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

Finally you will have to configure the sork vacation app with the ldap driver. This should be an easy task now ;)
Remember, that you have to configure/specify the vacation related attributes.