+ case 'address':
+ case 'envelope':
+ if ($test['test'] == 'envelope') {
+ array_push($exts, 'envelope');
+ }
+
+ $tests[$i] .= ($test['not'] ? 'not ' : '');
+ $tests[$i] .= $test['test'];
+
+ if (!empty($test['part'])) {
+ $tests[$i] .= ' :' . $test['part'];
+ if ($test['part'] == 'user' || $test['part'] == 'detail') {
+ array_push($exts, 'subaddress');
+ }
+ }
+
+ $this->add_comparator($test, $tests[$i], $exts);
+
+ if (!empty($test['type'])) {
+ if ($test['type'] == 'regex') {
+ array_push($exts, 'regex');
+ }
+ $tests[$i] .= ' :' . $test['type'];
+ }
+
+ $tests[$i] .= ' ' . self::escape_string($test['arg1']);
+ $tests[$i] .= ' ' . self::escape_string($test['arg2']);
+ break;
+
+ case 'body':
+ array_push($exts, 'body');
+
+ $tests[$i] .= ($test['not'] ? 'not ' : '') . 'body';
+
+ $this->add_comparator($test, $tests[$i], $exts);
+
+ if (!empty($test['part'])) {
+ $tests[$i] .= ' :' . $test['part'];
+
+ if (!empty($test['content']) && $test['part'] == 'content') {
+ $tests[$i] .= ' ' . self::escape_string($test['content']);
+ }
+ }
+
+ if (!empty($test['type'])) {
+ if ($test['type'] == 'regex') {
+ array_push($exts, 'regex');
+ }
+ $tests[$i] .= ' :' . $test['type'];
+ }
+
+ $tests[$i] .= ' ' . self::escape_string($test['arg']);
+ break;
+ }
+ $i++;