msimerson / mail-dmarc

Mail::DMARC, a complete DMARC implementation in Perl
Other
33 stars 23 forks source link

sender: set options when creating new sender object #239

Closed Davis-A closed 2 months ago

Davis-A commented 2 months ago

When using the sender from perl directly, there was no way to set the options without twiddling with the sender objects internals which is always a cursed thing to do.

Allow explicit setting of those options when creating the object.

marcbradshaw commented 2 months ago

I think it would be worth adding the remaining 4 options so they can all. be set using args.

    smarthost => undef,
    transports_method => undef,
    transports_object => undef,
    dkim_key => undef,
Davis-A commented 2 months ago

I think it would be worth adding the remaining 4 options so they can all. be set using args.

Okie dokie.

Just an FYI, I deliberately only allowed setting the subset of keys that can be set via CLI (hence also why the naming of the arg doesn't match the internal key, i matched the cli options).

    GetOptions (
        'verbose+'   => \$self->{verbose},
        'delay=i'    => \$self->{send_delay},
        'batch=i'    => \$self->{batch_size},
        'timeout=i'  => \$self->{alarm_at},
        'syslog+'    => \$self->{syslog},
    );