Vacation message with exim

I don't really understand why people love so mush auto-responders, especially business people. These messages add a considerable amount of useless noise in our mailboxes. Even though I dislike those emails, it doesn't prevent companies or friends I am hosting on my servers to request them.

One of those companies is closing during the holidays. They wanted to have a vacation message sent whenever someone tried to contact them during this period.

They wanted to have a single vacation message for the entire company instead of asking each employee to set his or her own vacation message for each account.

Here is the solution I have used to do this.

Router

virtual_vacation:
  domains = +virt_domains
  driver = accept
  require_files = /space/hosting/${domain}/vacation.msg
  transport = virtual_vacation_trans
  condition =  ${if or { \
                {match {$h_precedence:} {(?i)junk|bulk|list}} \
                {eq {$sender_address} {}} \
                } {no} {yes}}
  # do not reply to errors or bounces or lists
  senders = ! ^.*-request@.*: ! ^bounce-.*@.*: ! ^.*-bounce@.*: ! ^owner-.*@.*:\
            ! ^postmaster@.*: ! ^webmaster@.*: ! ^listmaster@.*: ! ^mailer-daemon@.*:\
            ! ^root@.*: ! ^abuse@.*
  unseen
  no_verify

virtual_vacation:
domains = +virt_domains
driver = accept
require_files = /space/hosting/${domain}/vacation.msg
transport = virtual_vacation_trans
condition = ${if or { \
{match {$h_precedence:} {(?i)junk|bulk|list}} \
{eq {$sender_address} {}} \
} {no} {yes}}
# do not reply to errors or bounces or lists
senders = ! ^.*-request@.*: ! ^bounce-.*@.*: ! ^.*-bounce@.*: ! ^owner-.*@.*:\
! ^postmaster@.*: ! ^webmaster@.*: ! ^listmaster@.*: ! ^mailer-daemon@.*:\
! ^root@.*: ! ^abuse@.*
unseen
no_verify


The router checks if the file message.msg exists in the home for that domain.
The router also tries to determine if the mail is coming from a mailing list or if it was auto-generatd. We don't want to send the vacation message to these addresses.

Transport

virtual_vacation_trans:
  driver = autoreply
  to = ${sender_address}
  from = "do_not_reply@${domain}"
  file = /space/hosting/${domain}/vacation.msg
  once = /var/tmp/vacation_${domain}.db
  once_repeat = 7d
  subject = "Re: Away for holidays / En vacances - ${local_part}@${domain}"

virtual_vacation_trans:
driver = autoreply
to = ${sender_address}
from = "do_not_reply@${domain}"
file = /space/hosting/${domain}/vacation.msg
once = /var/tmp/vacation_${domain}.db
once_repeat = 7d
subject = "Re: Away for holidays / En vacances - ${local_part}@${domain}"


The transport is pretty straightforward. It sets the to, from, and subject as well as the content of the mail extracted from the file vacation.msg. The email addresses of the senders are kept into the file vacation${domain}.db, in order to send the vacation message only once a week. Determined by once_repeat = 7d.
 
Posted on Dec 24, 2008 by: Fred Cirera @ 15:58 Leave a comment Comments: 29

SpamAssassin Installed in 10 minutes.

10 minutes to install SpamAssassin on you FreeBSD box, and protect your small business, from spam.
 
Posted on Mar 23, 2008 by: Fred Cirera @ 09:33 Leave a comment Comments: 39

Blocking spammers

Few years back I have written a service call KasMail which provide free temporary email addresses. This service is mainly used by people who need to leave an email address suspicious sites who collect email addresses for spamming. To limit the span on this service I use several reputation blacklist. The most efficient, with very small amount of false positive and very reactive is called CBL.

 
Posted on Dec 24, 2007 by: Fred Cirera @ 19:33 Leave a comment Comments: 15