title: Display distribution list with aliases
body: <p>I want to make .csv file with distribution lists (and aliases) and its members. My input looks like below</p>
  <pre><code># distributionList zimbradladmins@example.com memberCount=0
  zimbraMailAlias: zimbradladmins@example.com
  zimbraMailAlias: admins@example.com
  
  # distributionList monitoring@example.com memberCount=3
  zimbraMailAlias: monitoring@example.com
  zimbraMailAlias: monitor@example.com
  zimbraMailAlias: monit@example.com
  zimbraMailForwardingAddress: Eatable@example.com
  zimbraMailForwardingAddress: Boorish@example.com
  zimbraMailForwardingAddress: Flawless@example.com
  
  # distributionList all@example.com memberCount=10
  zimbraMailAlias: all@example.com
  zimbraMailAlias: everyone@example.com
  zimbraMailForwardingAddress: Legal@example.com
  zimbraMailForwardingAddress: Joyous@example.com
  zimbraMailForwardingAddress: helpdesk@special.example.com
  zimbraMailForwardingAddress: Crazy@example.com
  zimbraMailForwardingAddress: Successful@example.com
  zimbraMailForwardingAddress: operator@special.example.com
  zimbraMailForwardingAddress: pawelm@example.com
  zimbraMailForwardingAddress: tomaszb@example.com
  zimbraMailForwardingAddress: wojciech@example.com
  zimbraMailForwardingAddress: wojtekb@example.com
  </code></pre>
  <p>My awk code looks like below</p>
  <pre><code>BEGIN              { FS=&quot;:? &quot; ; print &quot;distributionList,member&quot; }
  /memberCount=0/    { print $3,&quot;&quot; }
  /^# distributionList / { alias = $3 }
  $1==&quot;zimbraMailForwardingAddress&quot; { print(alias,$2 ) }
  {OFS=&quot;,&quot;}
  </code></pre>
  <p>And my output:</p>
  <pre><code>distributionList,member
  zimbradladmins@example.com 
  monitoring@example.com,Eatable@example.com
  monitoring@example.com,Boorish@example.com
  monitoring@example.com,Flawless@example.com
  all@example.com,Legal@example.com
  all@example.com,Joyous@example.com
  all@example.com,helpdesk@special.example.com
  all@example.com,Crazy@example.com
  all@example.com,Successful@example.com
  all@example.com,operator@special.example.com
  all@example.com,pawelm@example.com
  all@example.com,tomaszb@example.com
  all@example.com,wojciech@example.com
  all@example.com,wojtekb@example.com
  </code></pre>
  <p>As you can see I display only distribution group names (zimbradladmins@example.com, monitoring@example.com and all@example.com) and its members. I want to display all zimbraMailAlias for each distribution list and its members.
  Final output for above data should be (if no members then display nothing after comma):</p>
  <pre><code>zimbradladmins@example.com,
  admins@example.com,
  monitoring@example.com,Eatable@example.com
  monitoring@example.com,Boorish@example.com
  monitoring@example.com,Flawless@example.com
  monitor@example.com,Eatable@example.com
  monitor@example.com,Boorish@example.com
  monitor@example.com,Flawless@example.com
  monit@example.com,Eatable@example.com
  monit@example.com,Boorish@example.com
  monit@example.com,Flawless@example.com
  all@example.com,Legal@example.com
  all@example.com,Joyous@example.com
  all@example.com,helpdesk@special.example.com
  all@example.com,Crazy@example.com
  all@example.com,Successful@example.com
  all@example.com,operator@special.example.com
  all@example.com,pawelm@example.com
  all@example.com,tomaszb@example.com
  all@example.com,wojciech@example.com
  all@example.com,wojtek@example.com
  everyone@example.com,Legal@example.com
  everyone@example.com,Joyous@example.com
  everyone@example.com,helpdesk@special.example.com
  everyone@example.com,Crazy@example.com
  everyone@example.com,Successful@example.com
  everyone@example.com,operator@special.example.com
  everyone@example.com,pawelm@example.com
  everyone@example.com,tomaszb@example.com
  everyone@example.com,wojciech@example.com
  everyone@example.com,wojtek@example.com
  </code></pre>
  <p>Any help would be appreciated :)</p>