Author Topic: Getting mlmmj (mailing list manager) to work with Zentyal  (Read 2390 times)

nontrivial

  • Zen Warrior
  • ***
  • Posts: 181
  • Karma: +16/-0
    • View Profile
Getting mlmmj (mailing list manager) to work with Zentyal
« on: May 03, 2013, 04:25:15 pm »
Howdy folks,

I looked at a few mail list managers and finally settled on mlmmj because it seems to work best with Zentyal. Basically it's a four step process (note, the script would need to be changed if you use zarafa):

 * sudo apt-get install mlmmj
 * Add to /etc/crontab: 0 */2 * * * root "find /var/spool/mlmmj -mindepth 1 -maxdepth 1 -type d -exec /usr/bin/mlmmj-maintd -F -d {} \;"
 * Save script below as executable /etc/zentyal/hooks/mail.postsetconf
 * sudo service zentyal mail restart

The script is:
#!/usr/bin/perl -w
use strict;

# Rewrites postfix config files to support mlmmj after zentyal resets

my $Main = '/etc/postfix/main.cf';
my $Master = '/etc/postfix/master.cf';

my @Lines;
open(FILE, "<", $Master);
@Lines = <FILE>;
close(FILE);

for my $Line (@Lines) {
  if ($Line =~ /mlmmj/i) {
    print("File already processed!\n");
    exit(0);
  }
}

open(FILE, ">", $Master);
for my $Line (@Lines) {
  if ($Line =~ /smtp\-amavis/i) {
    print(FILE "mlmmj   unix  -       n       n       -       -       " .
      "pipe     flags=ORhu user=list argv=/usr/bin/mlmmj-recieve -F -L " .
      "/var/spool/mlmmj/\${nexthop}\n");
  }
  print(FILE $Line);
}
close(FILE);

@Lines = ();
open(FILE, "<", $Main);
@Lines = <FILE>;
close(FILE);

open(FILE, ">", $Main);
for my $Line (@Lines) {
  if ($Line =~ /^virtual_alias_maps/i) {
    print(FILE "virtual_alias_maps = ldap:valiases, " .
      "hash:/var/spool/mlmmj/virtual\n");
    print(FILE "mlmmj_destination_recipient_limit = 1\n");
    print(FILE "transport_maps = hash:/var/spool/mlmmj/transport\n");
  } else  { print(FILE $Line); }
}
close(FILE);


christian

  • Guest
Re: Getting mlmmj (mailing list manager) to work with Zentyal
« Reply #1 on: May 03, 2013, 04:54:13 pm »
It looks like contribution rather than support related question   ;)
Anyway, thanks.
FYI, I'm using mailman installed on Zentyal server. It works well too but I'm very prone to understand, as you looked at different solutions, why "mlmmj seems to work best with Zentyal".

This may trigger some changes here if there is significant advantage  :)