Mail White and Black list

Discussion in 'Installation/Configuration' started by Anderson Silvestre, Apr 17, 2023.

  1. Anderson Silvestre

    Anderson Silvestre New Member

    Hi, guys. It's my first time in this forum.
    Here, where I work, we used Cpanel, but for some reasons, we have to change to ISP3 and configure many things. But one thing that I don't know how to do is configure the Mail Black and White list. I put some emails that were going to spam, but it didn't work and they keep going to spam.
    I put them in the 'Email > Spamlist - Whitelist', where I have to select a user and an email. So it looks like this:
    User: @mydomain.com.br - Email: @notspam.com.br - Priority: 5 Medium - Active: Yes
    I don't know where I can whitelist some email servers that I receive.
    I tried to look in the forum for a similar problem but to be honest I didn't understand how to make the lists work correctly.
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Note the ISPConfig panel has two whitelist/blaclist places in EMail tab, Spamfilter white/blacklist and Postfix white/blacklist.
    You should purchase ISPConfig manual, it exlains how those work.
     
  3. Anderson Silvestre

    Anderson Silvestre New Member

    Hi Taleman, I read the manual. And did like it said, I put the email in the 'Spamfilter - Whitelist' but it didn't work. I saw that has an option in 'Server Settings - Postfix Whitelist'. It works better than 'Spamfilter'?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    You can not whitelist complete servers, you can only whitelist domains or sender email addresses for specific recipients. I recommend that you check why the emails go to spam instead of whitelisting them. You can get details on why Rspamd marks a message as spam in rspamd GUI. Besides that, it might be that not Rspamd and dovecot are moving the emails into the spam folder as this can happen by your mail client as well.
     
  5. Anderson Silvestre

    Anderson Silvestre New Member

    Hi Till. I dont wanna whitelist all the servers, I want to whitelist some of them, but It didn't work. I tried in the 'Server Settings > Postfix Whitelist' in this config I look like this
    upload_2023-4-24_9-6-29.png
    And in the 'Spam Filter > Whitelist' it's like
    upload_2023-4-24_9-10-27.png

    But neither ways work. I think some of these options should work...
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Postfix whitelist works in conjunction with postfix blacklist, is not related to whitelist messages that get caught by the spam filter. So the whitelist you should use is the spam filter whitelist. Spamfilter whitelist works fine here on my systems, so you might want to follow the advice I posted in #4 to find out why it does not work on your system.
     
  7. recin

    recin Active Member

    I have 2 ispconfig servers under Ubuntu installed with autoinstaller and spamfilter lists never worked for me.
    What could I do to solve it?
     
  8. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    @till answered previously:
     
  9. Anderson Silvestre

    Anderson Silvestre New Member

    I'm not sure that I have Rspamd on my server. I didn't find any configuration about it, maybe it's because I'm a noob in Ispconfig.
    But how I can be sure that Rspamd is working on my server and if it isn't working, how can I configure the whitelist?
    Sorry if I'm repeating the same questions.
     
  10. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    system --> server config --> <servername> --> mail tab.
    if rspamd is installed on the server, about 1/3 of the way down that page will show you the rspamd url and password
     
    Anderson Silvestre likes this.
  11. Anderson Silvestre

    Anderson Silvestre New Member

    Thank You. I finally found the Rspamd. I'll try to make the white list work now. :)
     
  12. recin

    recin Active Member

    I send mail from [email protected] to [email protected] and get this rspamd header:
    Code:
    X-Spamd-Result: default: False [-7.01 / 15.00];
    	BAYES_HAM(-3.00)[100.00%];
    	NEURAL_HAM_LONG(-2.00)[-1.000];
    	NEURAL_HAM_SHORT(-1.00)[-1.000];
    	DMARC_POLICY_ALLOW(-0.50)[gmail.com,none];
    	R_DKIM_ALLOW(-0.20)[gmail.com:s=20221208];
    	R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17];
    	MIME_GOOD(-0.10)[multipart/alternative,text/plain];
    	MX_GOOD(-0.01)[];
    	RCVD_VIA_SMTP_AUTH(0.00)[];
    	RCVD_TLS_LAST(0.00)[];
    	FROM_HAS_DN(0.00)[];
    	TO_MATCH_ENVRCPT_ALL(0.00)[];
    	PREVIOUSLY_DELIVERED(0.00)[[email protected]];
    	ARC_NA(0.00)[];
    	RCPT_COUNT_ONE(0.00)[1];
    	DWL_DNSWL_NONE(0.00)[gmail.com:dkim];
    	ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US];
    	RCVD_IN_DNSWL_NONE(0.00)[209.85.128.42:from];
    	RCVD_COUNT_THREE(0.00)[3];
    	TO_DN_ALL(0.00)[];
    	ARC_SIGNED(0.00)[gigastur.net:s=default:i=1];
    	FREEMAIL_FROM(0.00)[gmail.com];
    	MID_RHS_MATCH_FROM(0.00)[];
    	DKIM_TRACE(0.00)[gmail.com:+];
    	FROM_EQ_ENVFROM(0.00)[];
    	RECEIVED_SPAMHAUS_PBL(0.00)[83.52.112.25:received];
    	FREEMAIL_ENVFROM(0.00)[gmail.com];
    	MIME_TRACE(0.00)[0:+,1:+,2:~];
    	RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.42:from]
    
    I add my mail to Spamfilter blacklist:
    User: [email protected]
    email: [email protected]
    priority: 10 highest

    Resend the same mail and it comes to the inbox with this rspamd header:
    Code:
    X-Spamd-Result: default: False [-4.01 / 0.10];
    	BAYES_HAM(-3.00)[100.00%];
    	DMARC_POLICY_ALLOW(-0.50)[gmail.com,none];
    	R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17];
    	R_DKIM_ALLOW(-0.20)[gmail.com:s=20221208];
    	MIME_GOOD(-0.10)[multipart/alternative,text/plain];
    	MX_GOOD(-0.01)[];
    	FROM_HAS_DN(0.00)[];
    	ARC_NA(0.00)[];
    	RCVD_VIA_SMTP_AUTH(0.00)[];
    	TO_MATCH_ENVRCPT_ALL(0.00)[];
    	RCVD_TLS_LAST(0.00)[];
    	DWL_DNSWL_NONE(0.00)[gmail.com:dkim];
    	RCPT_COUNT_ONE(0.00)[1];
    	PREVIOUSLY_DELIVERED(0.00)[[email protected]];
    	MID_RHS_MATCH_FROM(0.00)[];
    	ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US];
    	FREEMAIL_ENVFROM(0.00)[gmail.com];
    	RCVD_COUNT_THREE(0.00)[3];
    	ARC_SIGNED(0.00)[gigastur.net:s=default:i=1];
    	FREEMAIL_FROM(0.00)[gmail.com];
    	RCVD_IN_DNSWL_NONE(0.00)[209.85.221.53:from];
    	TO_DN_ALL(0.00)[];
    	RECEIVED_SPAMHAUS_PBL(0.00)[83.52.112.25:received];
    	DKIM_TRACE(0.00)[gmail.com:+];
    	MIME_TRACE(0.00)[0:+,1:+,2:~];
    	FROM_EQ_ENVFROM(0.00)[];
    	RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.221.53:from]
    
    Why is not working? I see that when I add the mail in ispconfig's spamfilter blacklist it creates the file spamfilter_wblist_48.conf under /etc/rspamd/local.d/users with this content:
    Code:
    spamfilter_wblist-48 {
            priority = 50;
            from = "[email protected]";
            rcpt = "[email protected]";
            apply {
                    R_DUMMY = 999.0;
                    actions {
                            reject = 0.2;
                            "add header" = 0.1;
                            greylist = 0.1;
                            "rewrite subject" = 0.1;
                    }
            }
    }
     
  13. Anderson Silvestre

    Anderson Silvestre New Member

    Hi, Finally I think I read enough to make my map configs. But my only question (I think that is the only one) is, do I have to restart the rspamd service when I create the multimap.conf? And do I have to restart the server every time I put a new domain in the whitelist.map?
    Sorry for this silly question, but I didn't find any place that give me this information. In the manual, it says that it reloads automatically when I use a map in https connection. But it doesn't say anything about the file on the same server.
    Thank you again.
     
  14. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Just restart rspamd, a whole server restart is not necessary.
     
  15. Anderson Silvestre

    Anderson Silvestre New Member

    Hi bro. Today I tried to make the files, so I made de conf file in /etc/rspamd/local.d/multimap.conf and inside of it I put the text:
    Code:
    # Whitelists maps
    whitelist_domain{
       type = "from";
       filter = "email:domain";
       map = "/etc/rspamd/local.d/whitelist_domain.map";
       action = "accept";
    }
    And made the map file in /etc/rspamd/local.d/whitelist_domain.map and put a domain inside like:
    Code:
    domain.com.br
    But when I tried to restart the rspamd service I get the error:
    Code:
    ● rspamd.service - rapid spam filtering system
         Loaded: loaded (/lib/systemd/system/rspamd.service; enabled; vendor preset: enabled)
         Active: failed (Result: exit-code) since Wed 2023-08-02 16:02:20 -03; 31s ago
           Docs: https://rspamd.com/doc/
        Process: 4027110 ExecStart=/usr/bin/rspamd -c /etc/rspamd/rspamd.conf -f (code=exited, status=1/FAILURE)
       Main PID: 4027110 (code=exited, status=1/FAILURE)
            CPU: 39ms
    ago 02 16:02:20 myserver systemd[1]: rspamd.service: Scheduled restart job, restart counter is at 5.
    ago 02 16:02:20 myserver systemd[1]: Stopped rapid spam filtering system.
    ago 02 16:02:20 myserver systemd[1]: rspamd.service: Start request repeated too quickly.
    ago 02 16:02:20 myserver systemd[1]: rspamd.service: Failed with result 'exit-code'.
    ago 02 16:02:20 myserver systemd[1]: Failed to start rapid spam filtering system.
    The files were with this permitions
    Code:
    -rw-r--r-- 1 root root     152 ago  2 15:38 multimap.conf
    -rw-r--r-- 1 root root       0 ago  2 15:38 whitelist_domain.map
    
    The service started again when I deleted the files multimap.conf and whitelist_domain.map. Did I make something wrong?
     
  16. pyte

    pyte Well-Known Member HowtoForge Supporter

    There should be a space between whitelist_domain and "{". Anyway check the log at /var/log/rpspamd/rspamd.log to see what causes the issue.
     
    Anderson Silvestre likes this.

Share This Page