How ISPConfig manage SPF/DMARC for incoming mails ?

Discussion in 'Installation/Configuration' started by francoisPE, Jan 7, 2022.

  1. francoisPE

    francoisPE Active Member HowtoForge Supporter

    Hello,
    I have ISPConfig 3.2.7p1 configured with email domains and email boxes.
    I wonder how my server is dealing incoming mails regarding SPF directives and DMARC directives ?
    Does it consider SPF record when receiving a mail and reject if violated ?
    How does it consider DMARC directives ? Does it send a mail like [email protected] ?
     
  2. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    I don't remember, are you using amavis or rspamd?
     
  3. francoisPE

    francoisPE Active Member HowtoForge Supporter

    I set up amavis (with ubuntu 20.04)
    I ve just checked ubuntu setup tutorial : it is implementing amavis not rspamd : dont know why ?
     
    Last edited: Jan 8, 2022
  4. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

  5. francoisPE

    francoisPE Active Member HowtoForge Supporter

    Very nice.
    I have my conf (multi server) in production... is there a tuto to move to rspamd ?
     
  6. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

  7. francoisPE

    francoisPE Active Member HowtoForge Supporter

    Very easy, i'll do that. Thanks.
    If i come back to my initial question,
    I understand from your explaination that rspamd is managing spf and dmarc including sending emails 'noreplydmarc'
     
  8. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    With rspamd, spf/dkim/dmarc is checked and used to score mail by default, it does not reject, even when the domain policy explicitly calls for it. The default scores are in the 1.5-3 range, not terribly high; you will have to manually change the score or force an action based on the relevant symbols if you want to do differently. Rspamd can send dmarc reports, you have to manually configure it to do so. Be sure to send from a noreply type sender address which discards mail, as it will get lots of bounced mail back (I've not tried to determine what percent of domains have misconfigured dmarc reporting, but it's more than just a few).
     
  9. francoisPE

    francoisPE Active Member HowtoForge Supporter

    I imagine that these settings
    - Spam score / force action
    - send dmarc report
    are accessible in web gui ?

    For 'noreply', is that in ispconfig ?
     
  10. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    I don't know, I've only configured it via config files.

    You can add a mail route in ispconfig for the email address you want and set it to 'discard:' as the transport.
     
  11. francoisPE

    francoisPE Active Member HowtoForge Supporter

    Is there a tuto you would recommend me ?
     
  12. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    ahrasis and Taleman like this.
  13. francoisPE

    francoisPE Active Member HowtoForge Supporter

    Thanks a lot, I'll do that :):):)
     
  14. francoisPE

    francoisPE Active Member HowtoForge Supporter

  15. francoisPE

    francoisPE Active Member HowtoForge Supporter

    I set that
    Code:
    echo 'db = "1";' >> /etc/rspamd/local.d/redis.conf
    
     
  16. francoisPE

    francoisPE Active Member HowtoForge Supporter

    Hello,
    I am back again.
    I am setting DMARC rules using https://rspamd.com/doc/modules/dmarc.html as you recommend.
    In following code,
    Code:
    dmarc {
        # If Redis server is not configured below, settings from redis {} will be used
        #servers = "127.0.0.1:6379"; # Servers to use for reads and writes (can be a list)
        # Alternatively set read_servers / write_servers to split reads and writes
        # To set custom prefix for redis keys:
        #key_prefix = "dmarc_";
        # Actions to enforce based on DMARC disposition (empty by default)
        actions = {
            quarantine = "add_header";
            reject = "reject";
        }
            # Ignore "pct" setting for some domains
            # no_sampling_domains = "/etc/rspamd/dmarc_no_sampling.domains";
    }
    
    My question is: should I setup a different redis conf. from the 2 setup for ispconfig.
    upload_2022-7-12_19-24-20.png
    Should I set a key_prefix ?
    I would say no, but, prefer ask
     
  17. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    I would just leave the defaults unless you have a reason to change them. Eg. I created a second redis instance for holding bayes, and the reason was so I could set a memory limit on that growth, while allowing all other keys to use an unspecified amount of memory. I can't think of any practial reason to change the redis prefix for dmarc in my current use of rspamd.
     
  18. francoisPE

    francoisPE Active Member HowtoForge Supporter

    After few try, it seems that works...
    Still Dmarc report to test after few days of received mail !
    Just a remark, i set
    Code:
    echo 'db = "1";' >> /etc/rspamd/override.d/redis.conf
    instead of
    Code:
    echo 'db = "1";' >> /etc/rspamd/local.d/redis.conf
    to avoid being overridden by ispconfig updates !
     
  19. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    override.d files completely replace the local.d files, which is where ISPConfig writes settings, so you just broke ISPConfig's ability to configure rspamd's use of redis. If you want to change that in a more supported fashion you would copy /usr/local/ispconfig/server/conf/rspamd_redis.conf.master to the conf-custom/ directory and make your changes there.
     
    till likes this.
  20. francoisPE

    francoisPE Active Member HowtoForge Supporter

    Thank you very much
     

Share This Page