To handle a "24/7" high-volume stream without the overhead of starting a new Python process for every single email, we will use an **Async Worker**. 

Instead of Postfix "piping" to a script (which starts/stops constantly), we will use **LMTP (Local Mail Transfer Protocol)**. This keeps your Python script running 24/7 as a service. Postfix talks to your script over a local socket, hands off the email data in RAM, and your script processes it instantly.

### 1. The 24/7 Async Worker (`mail_daemon.py`)
This uses the `aiosmtpd` library. It acts like a mini-mail server inside your VPS that only handles "receiving and processing" before dumping the data.

**Install requirement:** `pip install aiosmtpd`

```python
import asyncio
from aiosmtpd.controller import Controller
from email.parser import BytesParser
from email.policy import default

class HighSpeedHandler:
    async def handle_DATA(self, server, session, envelope):
        # 1. Get raw data from RAM (No disk write)
        raw_email = envelope.content
        
        # 2. Parse instantly
        msg = BytesParser(policy=default).parsebytes(raw_email)
        
        # 3. Extract your data
        subject = msg.get('Subject', '')
        sender = envelope.mail_from
        content = ""
        
        if msg.is_multipart():
            for part in msg.walk():
                if part.get_content_type() == "text/plain":
                    content = part.get_payload(decode=True).decode(errors='ignore')
                    break
        else:
            content = msg.get_content()

        # --- PROCESS REQ HERE ---
        # This is where you trigger your logic. 
        # Since it's async, it won't block the next email.
        print(f"[*] Processed: {subject} from {sender}")
        
        # 4. Return 'OK' - Email is now "deleted" as it was never saved to disk
        return '250 OK'

if __name__ == '__main__':
    # Listen on localhost port 8025
    handler = HighSpeedHandler()
    controller = Controller(handler, hostname='127.0.0.1', port=8025)
    
    print("24/7 Mail Processor Started on port 8025...")
    controller.start()
    
    try:
        asyncio.get_event_loop().run_forever()
    except KeyboardInterrupt:
        controller.stop()
```

---

### 2. Configure Postfix to Forward to your Script
You need to tell Postfix (the main server at `62.72.57.69`) to send everything for your address to that Python process.

1. Open your Postfix main config: `sudo nano /etc/postfix/main.cf`
2. Add or update the transport maps:
   ```text
   transport_maps = hash:/etc/postfix/transport
   ```
3. Open the transport file: `sudo nano /etc/postfix/transport`
4. Direct your specific email to the script:
   ```text
   Zreq@62.72.57.69  smtp:[127.0.0.1]:8025
   ```
5. Update and restart:
   ```bash
   sudo postmap /etc/postfix/transport
   sudo systemctl restart postfix
   ```

---

### Why this is the best setup for 24/7 high-volume:

* **Process Persistence:** The Python script stays in memory. It doesn't need to "log in" or "re-open" every time.
* **Zero Storage Latency:** Emails flow from the network → Postfix → Python RAM → Junk. They never touch the Hard Drive (`/var/mail` or `/var/spool`).
* **Asynchronous:** Because we use `asyncio`, your script can be parsing one email while it is already receiving the next 10.



### To make this truly "Production Grade":
Since you want this 24/7, you should run the Python script as a **Systemd Service**. This way, if the VPS reboots or the script crashes, it restarts automatically.

**Would you like the Systemd configuration file to ensure this script stays alive forever?**