forwardemail / free-email-forwarding
Showing 1 of 1 files from the diff.

@@ -1555,20 +1555,29 @@
Loading
1555 1555
      if (addresses[i].includes(':')) {
1556 1556
        const addr = addresses[i].split(':');
1557 1557
1558 -
        if (addr.length !== 2 || !validator.isEmail(addr[1]))
1559 -
          throw new CustomError(
1560 -
            `${address} domain of ${domain} has an invalid "${this.config.recordPrefix}" TXT record due to an invalid email address of "${addresses[i]}"`
1561 -
          );
1562 -
1563 1558
        // addr[0] = hello (username)
1564 1559
        // addr[1] = niftylettuce@gmail.com (forwarding email)
1565 1560
        // check if we have a match (and if it is ignored)
1566 -
        if (addr[0].indexOf('!') === 0 && username === addr[0].slice(1)) {
1561 +
        if (
1562 +
          _.isString(addr[0]) &&
1563 +
          addr[0].indexOf('!') === 0 &&
1564 +
          username === addr[0].slice(1)
1565 +
        ) {
1567 1566
          ignored = true;
1568 1567
          break;
1569 1568
        }
1570 1569
1571 -
        if (username === addr[0]) forwardingAddresses.push(addr[1]);
1570 +
        if (
1571 +
          addr.length !== 2 ||
1572 +
          !_.isString(addr[1]) ||
1573 +
          !validator.isEmail(addr[1])
1574 +
        )
1575 +
          throw new CustomError(
1576 +
            `${address} domain of ${domain} has an invalid "${this.config.recordPrefix}" TXT record due to an invalid email address of "${addresses[i]}"`
1577 +
          );
1578 +
1579 +
        if (_.isString(addr[0]) && username === addr[0])
1580 +
          forwardingAddresses.push(addr[1]);
1572 1581
      } else if (validator.isFQDN(addresses[i])) {
1573 1582
        // allow domain alias forwarding
1574 1583
        // (e.. the record is just "b.com" if it's not a valid email)
Files Coverage
helpers 81.37%
index.js 42.16%
Project Totals (7 files) 48.49%
Notifications are pending CI completion. Waiting for GitHub's status webhook to queue notifications. Push notifications now.
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading