Page 1 of 1

[SOLVED] Procmail

Posted: Tue Mar 25, 2014 1:47 pm
by Jared Earle
How can I get Procmail working on Exim? I want to add a per-user procmailrc without breaking the way Exim works with Vesta.

Re: Procmail

Posted: Thu Apr 24, 2014 12:23 am
by Jared Earle
Update: I hammered out a config that works.

Router:

Code: Select all

procmail:
  driver = accept
  transport = procmail
  condition = ${if exists{${extract{5}{:}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}}/mail/${domain}/${local_part}/.procmailrc}}{yes}{no}}
  require_files = ${extract{5}{::}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}}/mail/${domain}/${local_part}/.procmailrc
Transport:

Code: Select all

procmail:
  driver = pipe
  command = "/usr/bin/procmail -m ${extract{5}{:}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}}/mail/${domain}/${local_part}/.procmailrc"
  return_path_add
  delivery_date_add
  envelope_to_add
  user = ${extract{2}{:}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}}
  group = mail
  initgroups
  return_output
If you put a .procmailrc file in /home/$user/mail/$domain/$mailuser (i.e. /home/jared/mail/mydomain.com/jared/.procmailrc) then Exim will notice it and route the mail through proemial accordingly.

I hope this helps anyone else that was struggling.