Code Duplication    Length = 7-8 lines in 2 locations

api/src/Mail.php 2 locations

@@ 1733-1740 (lines=8) @@
1730
					if (count($headerObject['TO'])>1)
1731
					{
1732
						$ki=0;
1733
						foreach($headerObject['TO'] as $k => $add)
1734
						{
1735
							if ($k==0) continue;
1736
							//error_log(__METHOD__.' ('.__LINE__.') '."-> $k:".array2string($add));
1737
							$retValue['header'][$sortOrder[$uid]]['additional_to_addresses'][$ki] = self::decode_header($add,true);
1738
							//error_log(__METHOD__.' ('.__LINE__.') '.array2string($retValue['header'][$sortOrder[$uid]]['additional_to_addresses'][$ki]));
1739
							$ki++;
1740
						}
1741
					}
1742
				}
1743
				if(is_array($headerObject['CC']) && count($headerObject['CC'])>0) {
@@ 1745-1751 (lines=7) @@
1742
				}
1743
				if(is_array($headerObject['CC']) && count($headerObject['CC'])>0) {
1744
					$ki=0;
1745
					foreach($headerObject['CC'] as $k => $add)
1746
					{
1747
						//error_log(__METHOD__.' ('.__LINE__.') '."-> $k:".array2string($add));
1748
						$retValue['header'][$sortOrder[$uid]]['cc_addresses'][$ki] = self::decode_header($add,true);
1749
						//error_log(__METHOD__.' ('.__LINE__.') '.array2string($retValue['header'][$sortOrder[$uid]]['additional_to_addresses'][$ki]));
1750
						$ki++;
1751
					}
1752
				}
1753
				//error_log(__METHOD__.' ('.__LINE__.') '.array2string($retValue['header'][$sortOrder[$uid]]));
1754