<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Comments on snippet: 'OSX Server - Group EMail Enabler v0.2'</title>
<link>http://snipplr.com</link>
<description>Snipplr comments feed'</description>
<language>en-us</language>
<pubDate>Wed, 19 Jun 2013 14:57:20 GMT</pubDate>
<item>
<title>iindie said on 1/7/11</title>
<link>http://snipplr.com/view/42328/osx-server--group-email-enabler-v02/</link>
<description><![CDATA[ hello everyone after some searching i got the script to work with SLS.
please feel free to re edit if you chose this script works with local nodes but i guess it should not be too much of a problem getting it back to full OD consistency.


#!/bin/bash

# Group Email Enabler is a simple script which fixes a shortcoming in OS X Server 10.6
# by allowing each WGM group to automatically become an email list for it's members.
#
# Jeff Johnson    jdj@mac.com
#

# To install
#  1. save this file as
#         /usr/sbin/group_email.sh
#  2. sudo chmod +x /usr/sbin/group_email.sh
#  3. touch /private/var/log/group_email.log
#  4. adjust /etc/postfix/main.cf, add the following to "alias_maps="
#         hash:/etc/postfix/group_aliases
#  5. add the following to /etc/crontab (you may need to create /etc/crontab)
#         */15 * * * * root /usr/sbin/group_email.sh >> /private/var/log/group_email.log

# To use
#  When the script runs, it searches for any WGM group in /LDAPv3/127.0.0.1 the word "mail"
#  within the comment field. Postfix aliases with group members are then created.
#
#  If you create a group called 'employees' and put all staff in that group, you will
#  then have an email setup of employees@domain.com
#
#  Be sure all mail groups contain at least one member

# Would like to add/modify
# 1. needs error trapping. a group without members returns an error.
# 2. support for non-local LDAP


# clear current aliases
echo "" > /etc/postfix/group_aliases

# Get list of groups with 'mail' in the comment field
gr=`dscl . -list /Groups Comment | grep mail | awk '{print $1}'`

for group in $gr
   do
      echo $group: `dscl . -read /Groups/$group 'GroupMembership' | cut -d : -f 2 | grep -v "No such key"` >> /etc/postfix/group_aliases
   done

/usr/sbin/postalias /etc/postfix/group_aliases
/usr/bin/newaliases
exit 0 ]]></description>
<pubDate>Fri, 07 Jan 2011 10:13:02 GMT</pubDate>
<guid>http://snipplr.com/view/42328/osx-server--group-email-enabler-v02/</guid>
</item>
<item>
<title>uptimejeff said on 10/21/10</title>
<link>http://snipplr.com/view/42328/osx-server--group-email-enabler-v02/</link>
<description><![CDATA[ Edited.... Thanks Boddie ]]></description>
<pubDate>Thu, 21 Oct 2010 11:47:31 GMT</pubDate>
<guid>http://snipplr.com/view/42328/osx-server--group-email-enabler-v02/</guid>
</item>
<item>
<title>Boddie said on 10/16/10</title>
<link>http://snipplr.com/view/42328/osx-server--group-email-enabler-v02/</link>
<description><![CDATA[ To work with mail anywhere in the Comment field Change line 38 to:

gr=`dscl /LDAPv3/127.0.0.1 -list /Groups Comment | grep mail | awk '{print $1}'`

Boddie ]]></description>
<pubDate>Sat, 16 Oct 2010 08:22:34 GMT</pubDate>
<guid>http://snipplr.com/view/42328/osx-server--group-email-enabler-v02/</guid>
</item>
</channel>
</rss>