# Integrate Tomba Finder with MyBB

## Overview

The **MyBB Disposable Email Blocker** is an indispensable security tool that provides a superior line of defense for your forum registration process. This plugin enhances security and reliability by preventing users from registering with disposable, temporary, or invalid email addresses.

### Why Use This Plugin?

- 🛡️ **Enhanced Security**: Prevents spam registrations and fake accounts
- 📧 **Email Quality**: Ensures only legitimate email addresses are used
- 🚫 **Spam Reduction**: Significantly reduces spam and bot registrations
- **User Experience**: Provides real-time validation feedback
- 📊 **Data Integrity**: Maintains clean and reliable user database
- ⚡ **JavaScript-Based**: Fast, client-side validation with instant feedback

### Key Benefits

- **Real-time Validation**: Instant feedback during registration
- **Always Up-to-Date**: Daily updates of disposable email domains
- **Fully Customizable**: Custom error messages and settings
- **Lightweight**: JavaScript-based solution with minimal server load
- **User-Friendly**: Clear error messages guide users to valid emails
- **Comprehensive Protection**: Blocks disposable, invalid, and webmail addresses

## Features

### Core Protection Features

- **Invalid Email Detection**: Identifies malformed email addresses
- **Invalid Domain Detection**: Blocks emails from non-existent domains
- **Disposable Email Blocking**: Prevents temporary/throwaway email services
- **Webmail Blocking**: Optional blocking of free webmail providers
- **Real-time Validation**: Instant feedback during typing
- **Custom Error Messages**: Personalized validation messages

### 🔄 Advanced Features

- **Daily Domain Updates**: Automatically updated disposable email database
- **Pattern Recognition**: Advanced detection algorithms
- **Whitelist Support**: Allow specific domains despite general rules
- **Multiple Validation Levels**: Different strictness levels available
- **API Integration**: Powered by Tomba.io's email intelligence
- **Browser Compatibility**: Works across all modern browsers

### 📋 Supported Detection Types

| Detection Type        | Description                               | Customizable |
| --------------------- | ----------------------------------------- | ------------ |
| **Invalid Format**    | Malformed email addresses                 | Yes          |
| **Invalid Domains**   | Non-existent or invalid domains           | Yes          |
| **Disposable Emails** | Temporary/throwaway email services        | Yes          |
| **Webmail Services**  | Free email providers (Gmail, Yahoo, etc.) | Yes          |
| **Spam Domains**      | Known spam and abuse domains              | Yes          |

## Installation

### Prerequisites

- MyBB 1.8.x or higher
- Administrator access to your MyBB forum
- Web server with JavaScript support

### Step 1: Download the Plugin

1. **Download** the latest release from [GitHub](https://github.com/tomba-io/mybb-disposable-email-blocker)
2. **Extract** the downloaded ZIP file
3. **Locate** the `inc` folder in the extracted files

### Step 2: Upload Files

1. **Connect** to your server via FTP or file manager
2. **Navigate** to your MyBB forum root directory
3. **Upload** the contents of the `inc` folder to your forum's `inc` folder
4. **Ensure** all files are properly uploaded and permissions are correct

### Step 3: Activate the Plugin

1. **Log in** to your MyBB Admin Control Panel (ACP)
2. **Navigate** to `Configuration` → `Plugins`
3. **Find** "Disposable Email Blocker" in the inactive plugins list
4. **Click** "Activate" to enable the plugin
5. **Verify** the plugin appears in the active plugins list

### File Structure After Installation

```
inc/
├── plugins/
│   └── disposable_email_blocker.php
├── languages/
│   └── english/
│       └── disposable_email_blocker.lang.php
└── jscripts/
    └── disposable-email-blocker.min.js
```

## Configuration

### Access Plugin Settings

1. **Navigate** to MyBB Admin Control Panel
2. **Go to** `Configuration` → `Settings`
3. **Find** "Disposable Email Blocker" settings group
4. **Configure** options according to your needs

### Available Settings

#### General Settings

| Setting             | Description                   | Default   | Options              |
| ------------------- | ----------------------------- | --------- | -------------------- |
| **Enable Plugin**   | Enable/disable the blocker    | Enabled   | On/Off               |
| **Validation Mode** | When to validate emails       | Real-time | Real-time, On Submit |
| **API Endpoint**    | Custom API URL for validation | Tomba.io  | Custom URL           |
| **Debug Mode**      | Show debug information        | Disabled  | On/Off               |

#### Disposable Email Settings

| Setting                | Description                     | Default                             |
| ---------------------- | ------------------------------- | ----------------------------------- |
| **Block Disposable**   | Block disposable email services | Enabled                             |
| **Disposable Message** | Custom error message            | "Disposable emails are not allowed" |
| **Update Frequency**   | How often to update domain list | Daily                               |
| **Custom Domains**     | Additional domains to block     | Empty                               |

#### Webmail Settings

| Setting             | Description                | Default                          |
| ------------------- | -------------------------- | -------------------------------- |
| **Block Webmail**   | Block webmail providers    | Disabled                         |
| **Webmail Message** | Warning/error message      | "Professional email recommended" |
| **Webmail Action**  | Block or warn              | Warn                             |
| **Allowed Webmail** | Whitelist specific webmail | Empty                            |

#### Error Display Settings

| Setting            | Description                    | Default     |
| ------------------ | ------------------------------ | ----------- |
| **Error Style**    | CSS styling for error messages | Red text    |
| **Error Position** | Where to show errors           | Below field |
| **Animation**      | Error message animation        | Fade in     |
| **Icon Display**   | Show warning/error icons       | Enabled     |

### Sample Configuration

```php
// Example settings in MyBB ACP
'disposable_email_blocker_enabled' => '1',
'disposable_email_blocker_block_webmail' => '0',
'disposable_email_blocker_disposable_message' => 'Disposable emails are not allowed. Please use a permanent email address.',
'disposable_email_blocker_webmail_message' => 'Warning: Professional email addresses are recommended for better account security.',
'disposable_email_blocker_debug' => '0'
```

## Usage

### For Forum Administrators

#### Basic Setup

1. **Install and activate** the plugin
2. **Configure settings** in the ACP
3. **Test registration** with disposable emails
4. **Monitor** registration attempts and spam reduction
5. **Adjust settings** based on your community needs

#### Advanced Configuration

```javascript
// Custom JavaScript configuration (optional)
<script>
const disposableBlockerConfig = {
    apiUrl: 'https://api.tomba.io/v1/disposable',
    disposable: {
        message: 'Please use a permanent email address for registration.'
    },
    webmail: {
        message: 'Consider using a professional email for better account security.',
        block: false  // Just warn, don't block
    },
    emailError: {
        className: 'custom-error-style',
        style: 'color: #ff0000; font-weight: bold;'
    }
};
</script>
```

### For Users (Registration Experience)

#### Valid Email Registration

```
User enters: john.doe@company.com
Result: Email accepted, registration proceeds
```

#### Disposable Email Attempt

```
User enters: temp123@10minutemail.com
❌ Result: Error message appears
"Disposable emails are not allowed. Please use a permanent email address."
```

#### Webmail Warning (If Configured)

```
User enters: john.doe@gmail.com
⚠️ Result: Warning message (registration still allowed)
"Professional email addresses are recommended for better account security."
```

## Technical Details

### How It Works

1. **JavaScript Integration**: Plugin integrates with MyBB registration forms
2. **Real-time Validation**: Validates emails as users type
3. **API Communication**: Checks emails against Tomba.io database
4. **Domain Database**: Maintains updated list of disposable domains
5. **Client-side Processing**: Fast validation without server round-trips
6. **Fallback Protection**: Server-side validation as backup

### Validation Process

```mermaid
graph TD
    A[User Types Email] --> B[JavaScript Validation]
    B --> C{Email Format Valid?}
    C -->|No| D[Show Format Error]
    C -->|Yes| E[Check Domain]
    E --> F{Domain Valid?}
    F -->|No| G[Show Domain Error]
    F -->|Yes| H[Check Disposable]
    H --> I{Is Disposable?}
    I -->|Yes| J[Show Disposable Error]
    I -->|No| K[Check Webmail]
    K --> L{Is Webmail?}
    L -->|Yes & Blocked| M[Show Webmail Error]
    L -->|Yes & Warning| N[Show Warning]
    L -->|No| O[Email Approved]
```

### JavaScript API

The plugin provides a JavaScript API for advanced customization:

```javascript
// Initialize with custom settings
new Disposable.Blocker({
    disposable: {
        message: "Custom disposable email error message",
    },
    webmail: {
        message: "Custom webmail warning message",
        block: false,
    },
});

// Event listeners
disposableBlocker.on("invalid", function (email, reason) {
    console.log("Invalid email:", email, "Reason:", reason);
});

disposableBlocker.on("valid", function (email) {
    console.log("Valid email:", email);
});
```

## Troubleshooting

### Common Issues

#### Issue: False Positives (Valid Emails Blocked)

**Symptoms:**

- Legitimate emails being rejected
- Users can't register with business emails
- Over-aggressive blocking

**Solutions:**

1. **Adjust settings** - reduce strictness level
2. **Add to whitelist** - allow specific domains
3. **Check domain status** - verify domain isn't miscategorized
4. **Update plugin** - ensure latest domain database

#### Issue: Disposable Emails Still Getting Through

**Symptoms:**

- Spam registrations continuing
- Known disposable domains not blocked
- Plugin seems ineffective

**Solutions:**

1. **Update domain database** - ensure latest disposable domain list
2. **Check plugin settings** - verify disposable blocking is enabled
3. **Monitor new domains** - add newly discovered disposable services
4. **Enable server-side validation** - add backup validation

#### Issue: Performance Problems

**Symptoms:**

- Slow page loading
- Registration form lag
- High server load

**Solutions:**

1. **Enable caching** - cache domain lookups locally
2. **Optimize settings** - reduce API calls frequency
3. **Use CDN** - load JavaScript from CDN
4. **Check server resources** - ensure adequate server capacity

### Debug Mode

Enable debug mode to troubleshoot issues:

1. **Access** plugin settings in ACP
2. **Enable** debug mode
3. **Check** browser console for detailed logs
4. **Review** validation process step-by-step

```javascript
// Debug output example
Disposable Blocker Debug:
- Email: test@10minutemail.com
- Domain: 10minutemail.com
- Type: disposable
- Action: block
- Message: Disposable emails are not allowed
```

### Log File Analysis

Check MyBB error logs for plugin-related issues:

```bash
# Common log locations
tail -f /path/to/mybb/inc/logs/error.log
tail -f /var/log/apache2/error.log
tail -f /var/log/nginx/error.log
```

## Support

### Getting Help

#### Documentation & Resources

- 📚 [Plugin Documentation](https://github.com/tomba-io/mybb-disposable-email-blocker/wiki)
- 🔧 [MyBB Community Forums](https://community.mybb.com/)
- 🌐 [Tomba.io API Documentation](https://docs.tomba.io/)
- 💡 [MyBB Plugin Development Guide](https://docs.mybb.com/1.8/development/)

#### Support Channels

- 🐛 **Bug Reports**: [GitHub Issues](https://github.com/tomba-io/mybb-disposable-email-blocker/issues)
- 💬 **Feature Requests**: [GitHub Discussions](https://github.com/tomba-io/mybb-disposable-email-blocker/discussions)
- 📧 **Email Support**: [support@tomba.io](mailto:support@tomba.io)
- 🏛️ **MyBB Community**: [MyBB Forum Thread](https://community.mybb.com/mods.php?action=view&pid=1571)

### Frequently Asked Questions

#### Q: Is this plugin free?

**A:** Yes, the Disposable Email Blocker plugin is completely free to use.

#### Q: Does it work with custom MyBB themes?

**A:** Yes, the plugin is designed to work with all MyBB themes. The JavaScript integrates automatically with registration forms.

#### Q: Can I customize the error messages?

**A:** Yes, all error messages are fully customizable through the plugin settings in your MyBB Admin Control Panel.

#### Q: How often is the disposable domain list updated?

**A:** The domain database is updated daily to include new disposable email services and remove inactive ones.

#### Q: Can I block specific domains manually?

**A:** Yes, you can add custom domains to the blocklist through the plugin settings.

#### Q: Does it affect forum performance?

**A:** No, the plugin uses client-side JavaScript validation, which doesn't impact server performance.

#### Q: Can users bypass the validation?

**A:** The plugin includes both client-side and server-side validation to prevent bypassing.
