Hello, I set mail SPAM policy via API using mail_policy_set function. I check in ispc interface it is modified. But, I saw no running job in interface when pushing modification in API. So that I fear that modification is only in database but not implemented in server applications : amavisd and/or rspamd. I have servers with amavisd and one with rspamd Where can I check modification (directly in conf files) for amavisd and for rspamd in server ? Many thanks
So that, there is no server update to be done. I don't really understand how it works, but, I feel if policy database is updated, policy changes will be applied !
Not sure if it's implemented that way. Do you get a red dot when changing a policy in the UI? If yes, then there is indeed something wrong with the API function.
I face 2 situations. That is why I decide to open that thread : 1. I changed manually in UI, there is a red dot 2. I changed with API, there is NO red dot From the red dot apperaing with manual change, I understood that there is a change on server... And I was very surprised to see no red dot with API change... But now, my understanding is that API changes was OK.
As mentioned in post #4, if you get a red dot when doing the same thing in the UI that you do with the API, then there is an issue. Most likely the API has not implemented an automatic update of affected mail users and domains while the UI has this function built in.
I am surprised because this is this same API which is used in rouncube plugin isn't it ? I will cross check
This API is used by many software without issues like RoundCube or the Migration Tool, but not necessarily this specific function that you are using is used by all tools. The API has a lot of different function functions, as someone mentioned in a different thread today he counted more than 300 functions. This function probably even does work in the way that it changes the policy correctly, just its behavior does not match the one of the UI in the way that the UI might have been extended to alter also mailboxes while the API just updates the policy without enforcing an update on mailboxes.
I just had a look at the ISPConfig code and there is no function mail_policy_set in the ISPConfig remote API. Maybe it's a function you wrote yourself which is not part of ISPConfig? If you want to set a mail policy for a mailbox, then this is done by using the mail_user_update function.
My mistake, I used mail_user_update. I didn't create a function. I wanted to save few time by writing thread without crosschecking my code ! It was a very bad idea. I made several tests. I confirm than using API no red dot appears. Using UI, red dot appears. I compare code functions dns_rr_update and mail_policy_update. With dns_rr_update, there are systematically red dots (and DNS zone are updated by API changes) I see almost no difference step 1 : testing step2 : call updateQuery The only difference is test on $update_serial and call increase_serial. I don't see that as a major difference for my concern. I don't understand difference in behavior. I will test to send spams to my mail box to see if API settings are effective.
I modified with API function mail_policy_update, checked dbispconfig with phpmyadmin (without opening UI) and send a mail classified spam to that server. The new policy was applied. API function mail_policy_update modify mail policy (there is an automatic update of affected mail users and domains) ie the modification is applied on mails and domains even if no red dot appears in UI. I can't explain that, but, I made the test 3 times. I am sure of that result !