[Dovecot] [solved] lda: vacation auto-reply for a virtual address

martin f krafft madduck at madduck.net
Thu Aug 9 19:03:02 EEST 2007


also sprach martin f krafft <madduck at madduck.net> [2007.08.09.1319 +0200]:
> So yes, if I find a suitable virtual delivery agent or a way to pass
> the maildir location from postfix to e.g. procmail, I'll have it
> solved. But right now it does not look like it's possible.

I can report success. This solution requires me to take the
performance hit due to procmail, but it also gives me a lot of
flexibility. I might replace the procmailrc with a POSIX shell
script if it's less resource-hungry that way.

/etc/postfix/master.cf:
  vprocmail   unix  -       n       n       -       5       pipe
    flags=DRhu user=vmail:vmail argv=/usr/bin/procmail -a ${recipient}

/etc/postfix/main.cf
  virtual_transport = vprocmail
  virtual_mailbox_maps = pgsql:$conf_dir/pgsql_virtual_mailbox_maps
  virtual_mailbox_base = /srv/vmail   # (== ~vmail)
  virtual_minimum_uid = 60000         # (== vmail)
  virtual_uid_maps = static:60000
  virtual_gid_maps = static:60000
  vprocmail_destination_concurrency_limit = 5
  vprocmail_destination_recipient_limit = 1

cat ~vmail/.procmailrc
  BIFF=no
  COMSAT=no

  NICE='nice -20'

  RECIPIENT="$1"

  MAILBOX="`$NICE /usr/sbin/postmap -q $RECIPIENT pgsql:/etc/postfix/conf/pgsql_vi
  HOME="$HOME/$MAILBOX"
  ORGMAIL="$HOME/.maildir/"

  # http://bugs.debian.org/387883 requires us to create the directory
  # as the vmail user because otherwise it will be owned by root
  # (which is how spamd does it)
  MKDIR=`$NICE install -d "$HOME"/.spamassassin`

  UMASK=0007
  # and we might just as well create a .procmailrc which is writeable by the
  # group so that ACLs work
  RC=`touch "$HOME"/.procmailrc`

  :0 fw
  |$NICE /usr/bin/spamc -x -u "$RECIPIENT"

  INCLUDERC="$HOME/.procmailrc"

  :0
  |$NICE /usr/lib/dovecot/deliver -d "$RECIPIENT"

Cheers,

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net at madduck
 
chaos reigns within.
reflect, repent, reboot.
order shall return.
 
spamtraps: madduck.bogus at madduck.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature (see http://martin-krafft.net/gpg/)
Url : http://dovecot.org/pipermail/dovecot/attachments/20070809/e44451f6/attachment.bin 


More information about the dovecot mailing list