flashmob / go-guerrilla

Mini SMTP server written in golang
MIT License
2.79k stars 366 forks source link

Processor can't be used *only* for validation #148

Closed landons closed 5 years ago

landons commented 5 years ago

Hi there! Great stuff here--I'm really enjoying using this library.

It's easy to work around, but there appears to be an issue when you try to add a processor to the validate_process chain, without also adding it to save_process. Here's the relevant portion of my config file:

    "backend_config" :
        {
            "log_received_mails": true,
            "save_workers_size": 1,
            "save_process" : "EnmimeParser|ProtobufEncoder|KafkaProducer",
            "validate_process": "AliasValidator",
            "primary_mail_host" : "localhost",
            "gw_save_timeout" : "3s",
            "gw_val_rcpt_timeout": "1s",
            "alias_service": "localhost:50051",
            "alias_pool_min_size": 1,
            "alias_pool_max_size": 1
        },

I have a bunch of logging output in the AliasValidator processor, but it only fires if I have it in BOTH process chains. If I put in just validate_process (where it's really needed), the initializer runs, but the processor itself never fires. (Confirmed from the logs of both the processor and the external service it talks to.)

Is this a bug, or am I missing something?

Thanks!

flashmob commented 5 years ago

Thanks - looks like you've found a bug. A fix will be merged in today.