How to enable group email accounts

Hi all,
I have spent a while fiddling with (and breaking) my OSX Lion 10.7.4 Server install trying to get group emails working. I would just like to share how I did it.
Follow the below how to.
#!/bin/bash
# Group EMail Enabler v0.2
# Jeff Johnson <[email protected]>
# Tested with OS X Server 10.6 and 10.7
# Should also work with 10.5
# This script allows you to manage email groups using Work Group Manager.
# If you create an executive group in WGM, you then have a executive@ email address
# This is automatically maintained as you adjust the members
# The script searches your LDAP groups for the word 'mail' in the comment field
# You must add mail to the comment field for any group which should have an email address.
# The email address for that group will be the shortname of that group.
# If you miss this step (add 'mail' to the comment field), this script does nothing.
# Known issues
# 1. Only supports groups in LDAP, users can be in LDAP or Local
# 2. Does not support other groups within your email group (no nested groups)
# 3. Almost no error checking, so best to run it manually a few times to check results.
# Installation Instructions
# 1. Save this file as
#       /usr/sbin/group_email.sh
# 2. Then adjust permissions
#       sudo chmod +x /usr/sbin/group_email.sh
# 3. Modifiy alias_maps in /etc/postfix/main.cf
#    You need to add this line to what you already have
#        hash:/etc/postfix/group_aliases
#     Example, you have:
#        alias_maps = hash:/etc/aliases
#     Change to:
#        alias_maps = hash:/etc/aliases, hash:/etc/postfix/group_aliases
# 4. To run automatically every 5 minutes, I prefer a simple addition to /etc/crontab
#      you may need to create /etc/crontab if it doesn't exist
#      Add the following to /etc/crontab
#            */5 * * * * root /usr/sbin/group_email.sh >> /dev/null 2>&1
# If you followed these instructions, within 5 minutes you will see an alias file at
#  /etc/postfix/groupaliases
# you can inspect the file to confirm the results.
cd /etc/postfix
# clear current aliases
echo "" > group_aliases.tmp
# Get list of groups with 'mail' in the comment field
gr=`dscl /LDAPv3/127.0.0.1 -list /Groups Comment | grep mail | awk '{print $1}'`
for group in $gr
   do
      echo $group: `dscl /LDAPv3/127.0.0.1 -read /Groups/$group dsAttrTypeNative:memberUid | cut -d : -f 3 | grep -v "No such key"` >> group_aliases.tmp
   done
cmp -s group_aliases.tmp group_aliases > /dev/null
   if [ $? -eq 1 ]; then
      echo different
      cp group_aliases.tmp group_aliases
      /usr/sbin/postalias /etc/postfix/group_aliases
      /usr/bin/newaliases
   else
      echo same
   fi
exit
The only additional thing I had to do with Lion Server 10.7.4 was add hash:/etc/postfix/group_aliases to the alias_maps AND alias_database in /etc/postfix/main.cf then run "newaliases" and "postfix reload"
Hopefully this helps the next person to get it all running quicker than I did
Cheers
Ryan

Hi Ryan, yeah 10.7.4 Lion Server - mail is swtiched on although we haven'y migrated to it yet (i do have the accounts setup though)
Script:
#!/bin/bash
# Group EMail Enabler v0.2
# Jeff Johnson <[email protected]>
# Tested with OS X Server 10.6 and 10.7
# Should also work with 10.5
# This script allows you to manage email groups using Work Group Manager.
# If you create an executive group in WGM, you then have a executive@ email address
# This is automatically maintained as you adjust the members
# The script searches your LDAP groups for the word 'mail' in the comment field
# You must add mail to the comment field for any group which should have an email address.
# The email address for that group will be the shortname of that group.
# If you miss this step (add 'mail' to the comment field), this script does nothing.
# Known issues
# 1. Only supports groups in LDAP, users can be in LDAP or Local
# 2. Does not support other groups within your email group (no nested groups)
# 3. Almost no error checking, so best to run it manually a few times to check results.
# Installation Instructions
# 1. Save this file as
#       /usr/sbin/group_email.sh
# 2. Then adjust permissions
#       sudo chmod +x /usr/sbin/group_email.sh
# 3. Modifiy alias_maps in /etc/postfix/main.cf
#    You need to add this line to what you already have
#        hash:/etc/postfix/group_aliases
#     Example, you have:
#        alias_maps = hash:/etc/aliases
#     Change to:
#        alias_maps = hash:/etc/aliases, hash:/etc/postfix/group_aliases
# 4. To run automatically every 5 minutes, I prefer a simple addition to /etc/crontab
#      you may need to create /etc/crontab if it doesn't exist
#      Add the following to /etc/crontab
#                 */5 * * * * root /usr/sbin/group_email.sh >> /dev/null 2>&1
# If you followed these instructions, within 5 minutes you will see an alias file at
#  /etc/postfix/groupaliases
# you can inspect the file to confirm the results.
cd /etc/postfix
# clear current aliases
echo "" > group_aliases.tmp
# Get list of groups with 'mail' in the comment field
gr=`dscl /LDAPv3/127.0.0.1 -list /Groups Comment | grep mail | awk '{print $1}'`
for group in $gr
   do
      echo $group: `dscl /LDAPv3/127.0.0.1 -read /Groups/$group dsAttrTypeNative:memberUid | cut -d : -f 3 | grep -v "No such key"` >> group_aliases.tmp
   done
cmp -s group_aliases.tmp group_aliases > /dev/null
   if [ $? -eq 1 ]; then
      echo different
      cp group_aliases.tmp group_aliases
      /usr/sbin/postalias /etc/postfix/group_aliases
      /usr/bin/newaliases
   else
      echo same
   fi
exit
I've gone through it a few times and can't see any differences to the one you posted so am at a loss as to why its not working..
Thanks
Phil

Similar Messages

  • Create Group Email Account in OIM

    Hi,
    I have a requirement to create Group Email Account in AD from OIM. I am able to create Group Accounts in AD using the OOB Resource Object "AD Group". Though I am not sure how to mail enable the group Account from OIM. Please give me ur valuable suggestions.
    Regards,
    Srijan.

    What you basically need to do is to set the mailnickname attribute on the group object in AD.
    I don't think that you can get the 9.1 AD connector to do this but it is not that hard to create a custom connector to do this.
    If you don't have experience of JNDI I could change some code I built a while ago to do this. Contact me through LinkedIn if you are interested.
    Best regards
    /Martin

  • How to send group emails from ipad

    How to send group emails from ipad

    Thanks.  So matters haven't changed.  Ipad and iohone systems still not make use of the groups created in OSX Contacts, although one can "see" the groups synced through iCloud.  They just do not function as real distribution lists in Mail.
    With the Mailshot app, one creates Mailshot groups with Mailshot group name.  It's as smooth as a work around can get.
    Silly that Apple iOS folks never got around to connecting the contact groups now listed in iOS Contacts through iCloud syncing to also be fully functional in iOS Mail for the purpose of group emailing. 

  • HT5622 .mac mail - I still use my .mac email address to access itunes, icloud, etc. Every once in a while, apple sends me confirmation, reservation, etc. emails to the .mac address. Can someone tell me how to access that email account?

    .mac mail - I still use my .mac email address to access itunes, icloud, etc. Every once in a while, apple sends me confirmation, reservation, etc. emails to the .mac address. Can someone tell me how to access that email account?

    Hi pjerl,
    Depending on when you originally set up your Apple ID, you may have @mac.com, @me.com, and @icloud.com email addresses associated with your account, but all mail sent to those addresses should still come in to the same iCloud account (you can test this to make sure by sending yourself emails at those addresses). You may find the following articles helpful:
    iCloud: About your @icloud.com, @me.com, and @mac.com email addresses
    iCloud: Using your @icloud.com email address
    Regards,
    - Brenden

  • How to setup multiple email accounts on one apple device It syncs to the rest of my apple devices?

    I have a Macbook pro (10.8.2), iPad 4 (6.0.1), and iPhone 5 (6.0.1).
    I have multiple email accounts set up on my iPhone:
    3X Work
    1X personal
    1X School
    They use Gmail and Microsoft exchange.
    Is it possible to have all these accounts automatically created on my ipad and Macbook without typing in all info again?
    Heres a visual:
    I hope this makes it a little more clear.
    I'm sure in the time it took me to type this, I could've manually added all the accounts to the devices lol
    Oh, and iCloud > Mail is enabled on all devices.
    Thanks for any and all help!

    Your post is a bit open ended....
    First thing - You need to decide if you want to use virtual domains or not.
    If
         [email protected]
         [email protected]
         [email protected]
    all should be separate mailboxes, then you need virtual domains.
    If those 3 addresses can all go to the same mailbox, then you don't.
    If you don't need virtual domains, then don't use them... things are simpler without that feature.
    If thats the case, in the domain name field in Mail service, enter your primary domain.
    You'll then need to enter your other domains via command line.
    First, check your mail domain setting with:
    sudo serveradmin settings mail:postfix:mydomain
    Here is how you enter more than one domain:
    - Quit the Server app
    - Issue this with your domains between the quotes
    sudo serveradmin settings mail:postfix:mydomain = "domain1.com, domain2.com"
    - Restart postfix to activate your change
    sudo postfix reload
    If you open the Server app, you will notice both domains are now listed.

  • Built in Approval workflow can't send to AD univeral security mail enabled group (email recipient not valid)

    Background: SP2010 SP2 with March 2015 CU installed. Using the built-in Approval - SharePoint 2010 workflow on a library. The Approval workflow does send email to individual users when users are specified in the Approvers field instead of a group. We
    need to use a group. The workflow reports the error email recipients are not valid. I don't see anything in ULS logs. The Exchange server tracking logs do not show the emails to the AD group being processed (no evidence they are even received into Exchange,
    but all other mail from SharePoint goes through, including the workflow's email to the workflow initiator). I can send email to the AD group from Outlook and all group members get it.
    To send Approval workflow email to a mail enabled AD Universal Security group, what
    exactly are the requirements?
    Q1. Does the SharePoint\system account (aka web app pool account) *absolutely* need to have a mailbox?
    If so, I need some clarification. I saw
    http://www.spdev.info/2012/11/using-security-groups-with-workflows.html which was offered as a solution in another post. It says "To allow SharePoint to email the mail enabled security group you need to either create a mailbox for the SharePoint service
    account, or attach the email address provided in the Outbound Email Settings as an additional email alias for a mailbox." Then it says you need to do *both* - create a mailbox for service account *and* add the outbound email settings address as an alias
    in the *service account's* mailbox settings. Well, we can't do the latter. We are using a dedicated AD account with a mailbox for SharePoint mail settings purposes, and no two mailboxes can have the same alias.
    I tried adding the AD account specified in the Reply From: outbound email settings (Reply To: is set to a distribution list) to the AD group's "Message Delivery Restrictions" and UNchecking Require that all senders are authenticated (even
    though the AD account does authenticate). I tried allowing All Senders and UNchecking Require authentication (though that leaves email address open to spammers), but neither worked.
    Q2. Does the AD mail enabled group need to be synchronized via User Profile Sync?
    We currently only sync users. I do see the AD groups (we use AD groups into SharePoint groups security model) in SharePoint's People and Groups, and the mail address for the mail enabled group is *not* present in the properties. Is it a requirement to sync
    the AD groups so that the email address shows in the AD group's properties in SharePoint?
    The AD group is in a SharePoint group with Approve permissions. The individual AD group members are also in another AD group in a SharePoint group with Contribute permissions. I even placed myself in the AD group to test whether permissions issues; I am
    farm admin. All SharePoint groups are set to allow Everyone to read the group's members.
    This is driving me crazy.
    Thanks,
    Joan

    Hello Victoria,
    Thank you. I have an update. I got the workflow working. Turned out to be two separate unrelated issues:
    (1) invalid email address for recipient was because the email address of AD group was not present in SharePoint's properties for group. Also why nothing appeared in Exchange Server tracking logs; the email was never sent from SharePoint. Once this was remedied
    (explained below), the Task Assigned email was sent out to the AD group.
    (2) the Task Assigned email was rejected by Exchange for reason 550 5.7.1 RESOLVER.RST.AuthRequired. The Exchange tracking logs clearly showed this. Setting the AD group's properties Mail Flow Settings, Message Delivery Restrictions to "Only senders
    in the following list: <the domain account of the email address specified in SharePoint outgoing email Reply From setting>" and UNchecking "Require that all senders are authenticated" allowed the Task Assigned email to go through.
    Answer to Q1: It is not required for System account (aka web app pool account) to have a mailbox when the SharePoint outgoing mail settings Reply From email address is of a domain account of the domain SharePoint is in. That is our scenario, as I noted we
    use a domain service account dedicated for SharePoint mail. I can't speak to other scenarios. The Reply To: does not have to be the same email address; we use a distribution list. And, ever paranoid about spamming because of unchecking require autenticated
    senders, I verified that my own account could not send email to the group (Outlook provides message "You do not have permission to send to: <GroupName>").
    Answer to Q2: I did not have to sync groups via User Profile Service. What I did do, however, was remove the AD group from SharePoint, People and Groups, Groups list, and readd it. (Note: what I *literally* did was was remove the SharePoint group from all
    permissions, remove the AD group from the SharePoint group, then remove the AD group from the Groups list, readd the AD group into the SharePoint group, and reassign permissions to the SharePoint group - Read to top-level site, Read to subsite (has unique
    permissions), and Read, Approve to the subsite library with the workflow. In order to start clean. When I readded the AD group to the SharePoint group, it came in with an email address; email address now shows in the group's SharePoint properties. I noticed
    that the format was GroupName instead of Domain\GroupName. (I had originally created the AD group as a Global Security group, added it to a SharePoint group, *then* (after I found out about that requirement when first troubleshooting workflow) converted it
    to Universal and mail enabled it.
    I suppose, would syncing groups would fix this issue of SharePoint not updating AD group changes?
    Additional note: I first gave the AD group Read to the library directly instead of giving Read to the SharePoint group, tried the workflow, and the email was sent. I then removed the AD group's direct permissions to the library and added the SharePoint group
    to the library and that also worked. So I was able to use the AD group in SharePoint group (I had read in one post that would not work).
    Thanks,
    Joan

  • How can I confirm email accounts have transferred

    Following receipt of the email about closure of the btinternet email acocunts for non-customers, I have returned to BT and my new broadband service was activated on 3 September.  I immediately tried to link my  BT Yahoo primary and sub account email addresses to the new broadband account.  However, I have a number of concerns.
    Not all sub-accounts recieved the closure email (the primary one did and some of the sub-accounts).  I have tried to link all the accounts that received the email and did recived some confirmations that this had been registered.  I tried web-chat to confirm that the accounts were linked and to find out what to do about the ones that did not receved the email.  However, I was left with no confidence that this has actually taken place as the person I was chatting with didn't seem to have much of a clue about what was going on.
    The thing that really worries me is nothing seems to have changed.  On the BT Yahoo account details for the old primary address it shows 'BT Yahoo! Pay-as-you-go' as my Product (and not Broadband).  On the BT Yahoo account details for the new primary address that I created for the new braodband service, there are no sub-accounts listed.
    These email addresses (and the emails they contain) are very important to me.  So much so that I was motivated to go through the hassle of changing my broadband provider.  Is there any way to get some assurance that the email addresses are linked correctly?
    Solved!
    Go to Solution.

    Hi all,
    This maight help on how to check if your sub accounts are linked to your Primary BT email account and to see what product/service you are on.
    If you login to this website here: https://bt.edit.client.yahoo.com/accounts? with your Sub accounts email address and password.
    Once your in you will see a "Accounts" under the Account Information section. Here you should then be able to see the current sub accounts email address and if it is linked to your Primary BT email address then it will also display the Primary BT email address.
    It will also tell you what service/product you are on.
    See an example of the website below: https://bt.edit.client.yahoo.com/accounts?
    Cheers
    jac_95 | BT.com Help Site | BT Service Status
    Someone Solved Your Question?
    Please let other members know by clicking on ’Mark as Accepted Solution’
    Try a Search
    See if someone in the community had the same problem and how they got it resolved.

  • How to Sync Multiple email Account with iCloud

    I have many email account over a local internet service provider and different hosting companie.
    Is it possible to sync all my account over my MacBook, iMac, iPhone using icloud?
    How can I do this?
    Can you help?
    Thank you,
    BigBlaze

    According the this: http://www.apple.com/mobileme/transition.html, "After moving to iCloud, family member accounts are no longer linked to the master account."  You can share an iCloud calendar (see http://support.apple.com/kb/PH2690), but I don't think you will be able to share iCloud contacts unless you are signed into the same iCloud account on both phones.

  • How do I change email account on iTunes set up. I don't have access to  hotmail account  used to set up (got jacked and it's to big of a pia to mess with ). I have had an iPhone for several years

    I'm unable to access the email account attached to my apple account and used to set up ITunes (hotmail account was jacked). How do I change the email account if I can't access the old one?

    Hi,
    Try heading here. Click "Manage your account", login and change your primary email address. You'll then be sent a confirmation email to your new primary address that will ask you to verify it as your own. Click the link, log in, and you're done.
    I hope you find this useful,
    Jonathan

  • How to organize/configure email accounts on iMac

    I'm a brand new Mac user, and I really would appreciate some opinions on how to efficiently organize/configure my email accounts.
    -previously on Windows XP at home and work, I had an 'office email' address and and a family email address at home that I could access from both computers Iie: all mail went to both locations off the server). Now, I have the iMac at home with a subscription to MobileMe (which I also find a little confusing), the office laptop on Windows and I will have an iPhone in about a week.
    My thinking is that I would like to be able to access both work and home emails on the iPhone, and now keep the home and work computers separate. Will this create too much redundancy on the iPhone? I'm just now sure how to best set this up, so I'm wondering what you other users out there do. Also not sure if MobileMe would be useful or best suited for this.
    Thank you,
    Rom

    Since you already have Mobile Me, you can keep all your mail "there" (in the "cloud" as they say -out there on Apple's servers) and access it from any of your devices / computers, or any web browser on any computer at any time.
    You don't need to "keep" your mail in any once place. Let Apple handle that, you can send & receive from your iMac, your iPhone, wherever. All your devices / computers will "sync up" with Apple's Mobile Me servers and keep everything up to date for you.
    Also, if you have exiting accounts that you don't want to stop using, you can use Mail on your iMac and Mail on the iPhone to send & receive from any POP or IMAP mail account (I suggest IMAP -it's the kind that syncs mail where POP just downloads copies to whatever computer you happen to be on). You just need the appropriate server / login information.
    For example, I have 4 email accounts for various reasons. 2 Gmail, 1 Mobile Me, and 1 on a domain name I bought (myname.com). ALL that mail is accessible on my iMac, my MacBook and my iPhone at any time.

  • How to delete an email account from mail

    I just purchased a macbook and was setting it up for the first time. I clicked on the mail icon (postage stamp) and added an email but have decided I do not want to use the mail option right now. How do i delete the email account and set the mail program back to its original settings.

    Open up Mail, hit Command, and the Comma, and then go to accounts, select your account you want to delete and hit the minus symbol!

  • How to delete an email account in N97mini?

    Hi there,
    I'm trying to delete one of my email aacounts from my phone N97MINI as I don't use that particular address anymore. But how can I remove one of my email accounts in my N97 Mini phone?
    Apparently, it is not the same way as a N97 phone:
    From the Email launcher screen on your device, select the Settings icon.
    Scroll to the account you want to remove.
    Select Options-Remove mailbox.
    Select Yes.
    This does not work with a N97 mini as I can't select a Settings Icon from the Email launcher...

    . Menu
    2. Messaging
    3. Options
    4. Settings
    5. Email
    6.Mailboxes
    7. Select the one that you want to delete
    8. Options
    9 Delete
    If  i have helped at all a click on the white star below would be nice thanks.
    Now using the Lumia 1520

  • How to create an email account??

    Hi,
    How to create a new email account by using Java program.
    I'm able to send and receive the mails to and from an
    existing account by using JavaMail.
    But I dont know how to create an account.
    Please help me...
    thanks in advance

    hi,
    I also have the same problem.
    I m very confused about how to create mail accounts.
    My mail server is using linux.
    Can u plz help/guide/suggest me on "how can i add facility of new mail account creation like yahoo mail / hotmail....??? "
    -- what programming language/scripting language i should use which is secure also.
    Plz help me.
    Any type of help will be greatly useful to me.
    Thnk u very much.

  • How To Enable Group Layout When Creating Chart in Crystal Reports XI

    Hi
    I Created a chart, and i placed the same on Report Header, when i want to change the layout Option As Group, it is disabled, how to enable the Group Layout Option.

    Hello
    You should have your group already created and your summary. you place your graph outside the group (RH or RF)
    Luc

  • How to access another email account

    how do i assess a second email account?

    go to settings and then mails calenders you might find there and option add it

Maybe you are looking for

  • DVD not longer being recognized on iMac with Lion

    Looking for help / ideas.  I don't do this often, but placed a DVD in mac to watch a movie and it's not being recognized. 

  • Outlook integration problem

    hello,      I had configured the outlook properly , but  it does not able to send the main in my configred mail id & within the outlook.          some times it is work properlly after new installation of outlook addon  but when  i am change  the user

  • G41m p28 Sleep without fan ?

    I can't get my PC to sleep under Win7; the fan stays on. The manual says: if the mainboard has a System Hardware Monitor chipset on-board, you must use a specially designed fan with speed sensor to take advantage of the CPu fan control. I've checked

  • MZCommerce.purchasableAssetTooBigForDownload_message

    Getting 'MZCommerce.purchasableAssetTooBigForDownload_message'-popup (instead of "spoken words") when app is too big for 3G download. Haven't seen it before, maybe a new/regression bug in iOS 6.1?

  • Community toolbar error?

    So basically after upgrading to Yosemite this error keeps popping up "We're sorry, but the Safari browser version you are currently using does not support the community toolbar." I've already gotten rid of the conduit folders before I upgrade so why