D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
usr
/
local
/
psa
/
admin
/
cp
/
public
/
javascript
/
views
/
server
/
Filename :
mail.js
back
Copy
(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/server/mail"],{1411:(e,t,i)=>{"use strict";i.r(t),i.d(t,{SORT_ASC:()=>c,SORT_DESC:()=>m,default:()=>x});var s=i(285),n=i(596),a=i.n(n),o=i(286),l=i(89);const r=l.Locale.getTranslate("components.list"),d=l.Locale.getSection("components.list"),c="ASC",m="DESC",u="all",p={set(e,t){localStorage.setItem(e,JSON.stringify(t))},get(e){const t=localStorage.getItem(e);return JSON.parse(t)}},g=e=>`list-sort_${e}`,h=e=>`list-page_${e}`,b=({id:e,data:t,columns:i,itemsPerPage:n=25,itemsPerPageOptions:a=[10,25,100,u],sortColumn:l,sortDirection:m=c,searchField:b,locale:x={},emptyView:v,emptyFilteredView:S,toolbar:j,selection:y=[],onSelectionChange:f,searchBarInputProps:k,rowKey:T="key",useStorage:F=!0,...R})=>{const{sortColumn:P,sortDirection:M,setSortState:L}=((e,{sortColumn:t,sortDirection:i})=>{const[{sortColumn:n,sortDirection:a},o]=(0,s.useState)({sortColumn:p.get(g(e))?.sortColumn??t,sortDirection:p.get(g(e))?.sortDirection??i});return{sortColumn:n,sortDirection:a,setSortState:t=>{o((e=>({...e,...t}))),p.set(g(e),{...p.get(g(e)),...t})}}})(e,{sortColumn:l??i.find((({sortable:e})=>e))?.key,sortDirection:m}),{page:E,itemsPerPage:w,searchPattern:C,setPageState:I}=((e,{itemsPerPage:t},i=!0)=>{const n=i?{page:p.get(h(e))?.page,itemsPerPage:p.get(h(e))?.itemsPerPage,searchPattern:p.get(h(e))?.searchPattern}:{},[{page:a,itemsPerPage:o,searchPattern:l},r]=(0,s.useState)({page:n.page??1,itemsPerPage:n.itemsPerPage??t,searchPattern:n.searchPattern??""});return{page:a,itemsPerPage:o,searchPattern:l,setPageState:t=>{r((e=>({...e,...t}))),i&&p.set(h(e),{...p.get(h(e)),...t})}}})(e,{itemsPerPage:a.includes(n)?n:a[0]},F),D=(0,s.useMemo)((()=>C?S??(0,s.jsx)(o.ListEmptyView,{reason:"filtered",title:(0,s.jsx)(r,{content:"emptyViewFilteredTitle"}),description:(0,s.jsx)(r,{content:"emptyViewFilteredDescription"}),"data-testid":"list-empty-view-filtered"}):v??(0,s.jsx)(o.ListEmptyView,{title:(0,s.jsx)(r,{content:"emptyViewTitle"})})),[C,v,S]),N=(0,s.useMemo)((()=>i.map((({sortDataField:e,...t})=>t))),[i]),A=(0,s.useMemo)((()=>b&&C?t.filter((e=>(Array.isArray(b)?b:[b]).some((t=>e[t]&&String(e[t]).toLowerCase().includes(C.toLowerCase()))))):t),[t,C,b]),V=(0,s.useMemo)((()=>{if(!P)return A;const e=i.find((({key:e})=>e===P))?.sortDataField??P,t=i.find((({key:e})=>e===P))?.sort??((t,i)=>t[e]<i[e]?-1:t[e]>i[e]?1:0);return[...A].sort(((e,i)=>c===M?t(e,i):t(i,e)))}),[A,P,M,i]),q=(0,s.useMemo)((()=>{if(w===u)return V;const e=w*(E-1),t=e+w;return V.slice(e,t)}),[E,V,w]),O=(0,s.useCallback)((e=>{I({searchPattern:e}),e!==C&&I({page:1})}),[C]),B=(0,s.useCallback)((e=>{I({itemsPerPage:e});(e===u?1:Math.ceil(A.length/e))<E&&I({page:1})}),[A.length,E]);return(0,s.useEffect)((()=>{if("function"==typeof f&&y.length){const e=A.map((e=>{return t=e,"function"==typeof(i=T)?i(t):t[i];var t,i})).filter((e=>y.includes(e)));f(e)}}),[A]),(0,s.jsx)(o.List,{pagination:(0,s.jsx)(o.Pagination,{current:E,total:w===u?1:Math.ceil(A.length/w),onSelect:e=>I({page:e}),itemsPerPage:w,itemsPerPageOptions:a,onItemsPerPageChange:B}),toolbar:(j||b)&&(0,s.jsxs)(o.Toolbar,{children:[j,b&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.ToolbarExpander,{}),(0,s.jsx)(o.ToolbarGroup,{title:"",children:(0,s.jsx)(o.SearchBar,{inputProps:{placeholder:d.lmsg("searchPlaceholder"),"data-testid":"list-searchbar",value:C,...k??{}},onTyping:O})})]})]}),totalRows:A.length,sortColumn:P,sortDirection:M,onSortChange:L,columns:N,data:q,filtered:!!C,locale:{totalRows:({totalRows:e})=>d.formatMessage("recordsTotal",{total:e}),...x},emptyView:D,onSelectionChange:f,selection:y,rowKey:T,...R})};b.propTypes={id:a().string.isRequired,data:a().array.isRequired,columns:a().array.isRequired,itemsPerPage:a().number,itemsPerPageOptions:a().array,sortColumn:a().string,sortDirection:a().string,searchField:a().oneOfType([a().string,a().arrayOf(a().string.isRequired)]),locale:a().object,emptyView:a().node,emptyFilteredView:a().node,toolbar:a().node,onSelectionChange:a().func,selection:a().array,rowKey:a().oneOfType([a().string,a().func]),searchBarInputProps:a().object,useStorage:a().bool};const x=b},2412:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>b,getTimestampFromDateSelector:()=>x});var s=i(286),n=i(596),a=i(89),o=i(285);const l=a.Locale.getSection("smb.components.months"),r=(e,t)=>new Date(e,t,0).getDate(),d=(e,t,i)=>Math.min(e,r(i,t)),c=e=>/^\d+$/.test(e),m=new Date,u=m.getDate(),p=m.getMonth()+1,g=m.getFullYear(),h=({years:e,...t})=>(0,o.jsx)(s.FormField,{...t,children:({getId:t,getValue:i,getName:n,setValue:a,isDisabled:m})=>{const{day:h,month:b,year:x}=i(),v=()=>{if(!h||!b||!x){const e=b||p,t=x||g;a({day:d(h||u,e,t),month:e,year:t})}};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s.Input,{id:`${t()}Day`,name:`${n()}[day]`,value:h,onChange:({target:{value:e}})=>{""===e?a({day:e,month:b,year:x}):c(e)&&e>0&&e<=r(x,b)&&a({day:Number(e),month:b,year:x})},onBlur:v,disabled:m(),size:"sm"})," - ",(0,o.jsxs)(s.Select,{id:`${t()}Month`,name:`${n()}[month]`,value:b,onChange:e=>a({day:d(h,e,x),month:e,year:x}),disabled:m(),size:"sm",children:[(0,o.jsx)(s.SelectOption,{value:1,children:l.lmsg("1")}),(0,o.jsx)(s.SelectOption,{value:2,children:l.lmsg("2")}),(0,o.jsx)(s.SelectOption,{value:3,children:l.lmsg("3")}),(0,o.jsx)(s.SelectOption,{value:4,children:l.lmsg("4")}),(0,o.jsx)(s.SelectOption,{value:5,children:l.lmsg("5")}),(0,o.jsx)(s.SelectOption,{value:6,children:l.lmsg("6")}),(0,o.jsx)(s.SelectOption,{value:7,children:l.lmsg("7")}),(0,o.jsx)(s.SelectOption,{value:8,children:l.lmsg("8")}),(0,o.jsx)(s.SelectOption,{value:9,children:l.lmsg("9")}),(0,o.jsx)(s.SelectOption,{value:10,children:l.lmsg("10")}),(0,o.jsx)(s.SelectOption,{value:11,children:l.lmsg("11")}),(0,o.jsx)(s.SelectOption,{value:12,children:l.lmsg("12")})]})," - ",e?(0,o.jsx)(s.Select,{id:`${t()}Year`,name:`${n()}[year]`,value:x,onChange:e=>a({day:d(h,b,e),month:b,year:e}),disabled:m(),size:"sm",children:e.map((e=>(0,o.jsx)(s.SelectOption,{value:e,children:String(e)},e)))}):(0,o.jsx)(s.Input,{id:`${t()}Year`,name:`${n()}[year]`,value:x,onChange:({target:{value:e}})=>{""===e?a({day:h,month:b,year:e}):c(e)&&e>0&&e<=2100&&a({day:d(h,b,e),month:b,year:Number(e)})},onBlur:v,disabled:m(),size:"sm"})]})}});h.propTypes={years:n.PropTypes.arrayOf(n.PropTypes.number)};const b=h,x=({day:e,month:t,year:i})=>{const s=new Date;return s.setDate(e),s.setMonth(t-1),s.setFullYear(i),s.getTime()}},2429:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>g});var s=i(596),n=i(286),a=i(89),o=i(285),l=i(1120),r=i(628),d=i(536);const c=a.Locale.getTranslate("admin.components.forms.server-mail-black-list"),m=a.Locale.getTranslate("components.buttons"),u=l.gql` mutation AddBlackListedDomain($input: AddBlackListedDomainInput!) { addBlackListedDomain(input: $input) { errors } } `,p=({isWindows:e=!1,isOpen:t=!1,onClose:s})=>{const[a,l]=(0,o.useState)(null),[p,g]=(0,o.useState)(null),[h,b]=(0,o.useState)({});(0,o.useEffect)((()=>{l({name:[""],action:e?"DELETE":null}),g(null),b({})}),[t,e]);const[x]=(0,r.useMutation)(u,{refetchQueries:[{query:i(1249)}],awaitRefetchQueries:!0});return(0,o.jsxs)(n.Drawer,{"data-type":"add-black-listed-domain",title:(0,o.jsx)(c,{content:"title"}),isOpen:t,onClose:s,size:"sm",form:{state:p,errors:h,applyButton:!1,onSubmit:async({name:e,action:t})=>{g("submit"),b({});const{data:{addBlackListedDomain:{errors:i}}}=await x({variables:{input:{name:e.map((e=>(e??"").trim())),action:t}}});g(null),i?b({name:i}):((0,d.addToast)({intent:"success",message:(0,o.jsx)(c,{content:"success"})}),s())},values:a,submitButton:{id:"btn-ok",name:"ok",children:(0,o.jsx)(m,{content:"save"})},cancelButton:{id:"btn-cancel",name:"cancel",children:(0,o.jsx)(m,{content:"cancel"}),onClick:s}},children:[(0,o.jsx)(n.FormFieldText,{label:(0,o.jsx)(c,{content:e?"emailAddress":"domainName"}),description:e&&(0,o.jsx)(c,{content:"emailAddressHint"}),name:"name",size:"md",multi:!0,required:!0}),e&&(0,o.jsx)(n.FormFieldRadioButtons,{label:(0,o.jsx)(c,{content:"action"}),name:"action",options:[{value:"DELETE",label:(0,o.jsx)(c,{content:"actionDelete"})},{value:"SPAM",label:(0,o.jsx)(c,{content:"actionSpam"})}]})]})};p.propTypes={isWindows:s.PropTypes.bool,isOpen:s.PropTypes.bool,onClose:s.PropTypes.func.isRequired};const g=p},2432:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>g});var s=i(596),n=i(286),a=i(89),o=i(285),l=i(1120),r=i(628),d=i(536);const c=a.Locale.getTranslate("admin.components.forms.server-mail-white-list"),m=a.Locale.getTranslate("components.buttons"),u=l.gql` mutation AddWhiteListedNetwork($input: AddWhiteListedNetworkInput!) { addWhiteListedNetwork(input: $input) { errors } } `,p=({isWindows:e=!1,mailServer:{isSmtpWhiteListSupported:t,isSmtpWhiteListWithWildcardSupported:s,isSmtpWhiteListWithCIDRSupported:a},isOpen:l=!1,onClose:p})=>{const[g,h]=(0,o.useState)(null),[b,x]=(0,o.useState)(null),[v,S]=(0,o.useState)({});(0,o.useEffect)((()=>{h({name:[""]}),x(null),S({})}),[l,e]);const[j]=(0,r.useMutation)(u,{refetchQueries:[{query:i(1250)}],awaitRefetchQueries:!0});return(0,o.jsxs)(n.Drawer,{"data-type":"add-white-listed-network",title:(0,o.jsx)(c,{content:"title"}),isOpen:l,onClose:p,size:"sm",form:{state:b,errors:v,applyButton:!1,onSubmit:async({name:e})=>{x("submit"),S({});const{data:{addWhiteListedNetwork:{errors:t}}}=await j({variables:{input:{name:e.map((e=>(e??"").trim()))}}});x(null),t?S({name:t}):((0,d.addToast)({intent:"success",message:(0,o.jsx)(c,{content:"success"})}),p())},values:g,submitButton:{id:"btn-ok",name:"ok",children:(0,o.jsx)(m,{content:"save"})},cancelButton:{id:"btn-cancel",name:"cancel",children:(0,o.jsx)(m,{content:"cancel"}),onClick:p}},children:[e&&(0,o.jsxs)("p",{children:[(0,o.jsx)(c,{content:"descEmailAddress"}),t&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("br",{}),(0,o.jsx)(c,{content:"descIpAddress"})]})]}),(0,o.jsx)(n.FormFieldText,{label:(0,o.jsx)(c,{content:e?t?"emailAddressOrIp":"emailAddress":"ipAddress"}),description:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(c,{content:e?"emailAddressHint":"ipAddressHint"}),e&&t&&s&&(0,o.jsxs)(o.Fragment,{children:[" ",(0,o.jsx)(c,{content:"wildcardPattern"})]}),e&&t&&a&&(0,o.jsxs)(o.Fragment,{children:[" ",(0,o.jsx)(c,{content:"cidrPattern"})]})]}),name:"name",size:"md",multi:!0,required:!0})]})};p.propTypes={isWindows:s.PropTypes.bool,mailServer:s.PropTypes.shape({isSmtpWhiteListSupported:s.PropTypes.bool.isRequired,isSmtpWhiteListWithWildcardSupported:s.PropTypes.bool.isRequired,isSmtpWhiteListWithCIDRSupported:s.PropTypes.bool.isRequired}).isRequired,isOpen:s.PropTypes.bool,onClose:s.PropTypes.func.isRequired};const g=p},2434:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>v});var s=i(286),n=i(1289),a=i(285),o=i(89),l=i(646),r=i(596),d=i.n(r),c=i(1120),m=i(628),u=i(580),p=i(536);const g=o.Locale.getTranslate("admin.components.forms.server-mail-antivirus"),h=o.Locale.getTranslate("components.buttons"),b=c.gql` mutation UpdateServerMailAntivirus($input: UpdateServerMailAntivirusInput!) { updateServerMailAntivirus(input: $input) { query { serverMail { antivirus { key name isActive } antivirusPolicy { policy isAppliedToIncoming isAppliedToOutgoing } } } } } `,x=({serverMail:{antivirus:e,antivirusPolicy:t}})=>{const i=(0,u.useNavigate)(),[o]=(0,m.useMutation)(b),r=(0,s.useTranslate)("admin.components.forms.server-mail-antivirus"),d="/admin/server/tools",[c,x]=(0,a.useState)({});(0,a.useEffect)((()=>{x({antivirus:0===e.length?null:e.find((({isActive:e})=>e))?.key??"",policy:t?.policy,isAppliedToIncoming:t?.isAppliedToIncoming,isAppliedToOutgoing:t?.isAppliedToOutgoing})}),[e,t]);return(0,a.jsxs)(n.default,{id:"server-mail-antivirus",mutation:o,values:c,onFieldChange:(e,t)=>x((i=>(0,s.setIn)(i,e,t))),submitButton:{id:"buttonid-ok",name:"ok",children:(0,a.jsx)(h,{content:"save"})},applyButton:{id:"buttonid-apply",name:"apply",children:(0,a.jsx)(h,{content:"apply"})},cancelButton:{id:"buttonid-cancel",name:"cancel",children:(0,a.jsx)(h,{content:"cancel"}),component:l.default,to:d},onSuccess:(e,t)=>{(0,p.addToast)({intent:"success",message:(0,a.jsx)(g,{content:"success"})}),t?i(window.location.pathname,{replace:!0}):i(d)},children:[1===e.length&&(0,a.jsx)(s.FormField,{label:(0,a.jsx)(g,{content:"used"}),children:e[0].name}),e.length>1&&(0,a.jsx)(s.FormFieldRadioButtons,{label:(0,a.jsx)(g,{content:"used"}),name:"antivirus",options:e.map((({key:e,name:t})=>({value:e,label:t})))}),t&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(s.FormFieldSelect,{label:(0,a.jsx)(g,{content:"policy"}),name:"policy",children:[(0,a.jsx)("option",{value:"any",children:r("policyAny")}),(0,a.jsx)("option",{value:"from",children:r("policyFrom")}),(0,a.jsx)("option",{value:"to",children:r("policyTo")}),(0,a.jsx)("option",{value:"",children:r("policyOff")})]}),(0,a.jsxs)(s.FormField,{label:(0,a.jsx)(g,{content:"allowPersonalSettings"}),description:(0,a.jsx)(g,{content:"allowPersonalSettingsDesc"}),children:[(0,a.jsx)(s.FormFieldCheckbox,{label:(0,a.jsx)(g,{content:"incoming"}),name:"isAppliedToIncoming",disabled:null===(0,s.getIn)(c,"isAppliedToIncoming")}),(0,a.jsx)(s.FormFieldCheckbox,{label:(0,a.jsx)(g,{content:"outgoing"}),name:"isAppliedToOutgoing",disabled:null===(0,s.getIn)(c,"isAppliedToOutgoing")})]})]})]})};x.propTypes={serverMail:d().shape({antivirus:d().array.isRequired,antivirusPolicy:d().shape({policy:d().string.isRequired,isAppliedToIncoming:d().bool,isAppliedToOutgoing:d().bool})}).isRequired};const v=x},2424:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>c});var s=i(286),n=i(89),a=i(596),o=i.n(a),l=i(285);const r=n.Locale.getTranslate("admin.components.forms.server-mail-settings.auto-reply-headers"),d=({isMailUiDisabled:e=!1})=>(0,l.jsxs)(s.Section,{title:(0,l.jsx)(r,{content:"title"}),children:[(0,l.jsx)("p",{children:(0,l.jsx)(r,{content:"description"})}),(0,l.jsx)(s.FormField,{label:(0,l.jsx)(r,{content:"extra"}),name:"settings[autoReplyHeaders]",multi:{max:10},className:"server-mail-settings-form-field-multi",disabled:e,children:({getValue:t,setValue:i,getName:n})=>{const{name:a,value:o}=t({name:"",value:""});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Input,{name:`${n()}[name]`,size:"lg",value:a,onChange:({target:e})=>i({name:e.value,value:o}),maxLength:"75",disabled:e})," : ",(0,l.jsx)(s.Input,{name:`${n()}[value]`,value:o,onChange:({target:e})=>i({name:a,value:e.value}),maxLength:"75",disabled:e})]})}})]});d.propTypes={isMailUiDisabled:o().bool};const c=d},2418:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>c});var s=i(286),n=i(89),a=i(596),o=i.n(a),l=i(285);const r=n.Locale.getTranslate("admin.components.forms.server-mail-settings.autodiscover"),d=({isMailUiDisabled:e=!1,values:t,isEnabled:i=!1,customServer:n,isDnsEnabled:a=!0})=>(0,l.jsxs)(s.Section,{title:(0,l.jsx)(r,{content:"title"}),children:[(0,l.jsx)("p",{children:(0,l.jsx)(r,{content:"description",params:{link:(0,l.jsx)(s.Link,{href:"https://support.plesk.com/hc/en-us/articles/12387742719639",target:"_blank",children:(0,l.jsx)(r,{content:"link"})})}})}),(0,l.jsx)(s.FormFieldCheckbox,{label:(0,l.jsx)(r,{content:"enabled"}),name:"autodiscover[isEnabled]",description:(0,l.jsx)(r,{content:"enabledHint"}),disabled:e}),(0,l.jsx)(s.FormFieldText,{label:(0,l.jsx)(r,{content:"customServer"}),name:"autodiscover[customServer]",description:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r,{component:"div",content:"customServerHint"}),(0,l.jsx)(r,{component:"div",content:"customServerCertHint"})]}),size:"xl",disabled:e||!(0,s.getIn)(t,"autodiscover[isEnabled]")}),a&&(0,l.jsx)(s.FormFieldCheckbox,{label:(0,l.jsx)(r,{content:"reconfigureDns"}),name:"autodiscover[reconfigureDns]",description:(0,l.jsx)(r,{content:"reconfigureDnsHint"}),disabled:e||!((0,s.getIn)(t,"autodiscover[isEnabled]")&&((0,s.getIn)(t,"autodiscover[isEnabled]")!==i||(0,s.getIn)(t,"autodiscover[customServer]")!==n))})]});d.propTypes={isMailUiDisabled:o().bool,values:o().object.isRequired,isEnabled:o().bool,customServer:o().string.isRequired,isDnsEnabled:o().bool};const c=d},2417:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>c});var s=i(286),n=i(89),a=i(596),o=i.n(a),l=i(285);const r=n.Locale.getTranslate("admin.components.forms.server-mail-settings.general"),d=({isMailUiDisabled:e=!1,values:t,mailServerName:i,imapServerName:n,isWindows:a=!1,ipAddresses:o,isMaxLetterSizeChangeable:d=!1,isMessageSubmissionDedicatedIPSupported:c=!1,isMessageSubmissionAllIPSupported:m=!1,handleFieldChange:u})=>{const p=(0,s.useTranslate)("admin.components.forms.server-mail-settings.general"),g=a?"/cp/server/components/default/mailserver":"/admin/update/add-components",h=o.filter((({isIPv6:e})=>!e)),b=o.filter((({isIPv6:e})=>e));return(0,l.jsxs)(s.Section,{title:(0,l.jsx)(r,{content:"title"}),children:[(0,l.jsx)(s.FormFieldCheckbox,{label:(0,l.jsx)(r,{content:"mailUiEnabled"}),name:"settings[isMailUiEnabled]"}),(0,l.jsx)(s.FormField,{label:(0,l.jsx)(r,{content:"serverName"}),description:(0,l.jsx)(r,{content:"changeServerHint",params:{serverChangeLink:(0,l.jsx)(s.Link,{href:g,target:"_blank",children:(0,l.jsx)(r,{content:"changeServerName"})})}}),children:i}),n&&n!==i&&(0,l.jsx)(s.FormField,{label:(0,l.jsx)(r,{content:"imapServerName"}),description:(0,l.jsx)(r,{content:"changeServerHint",params:{serverChangeLink:(0,l.jsx)(s.Link,{href:g,target:"_blank",children:(0,l.jsx)(r,{content:"changeImapServerName"})})}}),children:n}),null!==(0,s.getIn)(t,"settings[maxMessageSize]")&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.FormFieldCheckbox,{name:"settings[maxMessageSizeEnabled]",label:(0,l.jsx)(r,{content:"maxMessageSize"}),disabled:e||!d}),(0,s.getIn)(t,"settings[maxMessageSizeEnabled]")&&(0,l.jsx)(s.FormField,{label:null,name:"settings[maxMessageSize]",description:(0,l.jsx)(r,{content:"maxMessageSizeHint",params:{kbLink:(0,l.jsx)(s.Link,{href:"https://support.plesk.com/hc/en-us/articles/12377276881559",target:"_blank",children:(0,l.jsx)(r,{content:"maxMessageSizeHintLink"})})}}),children:({getValue:t,setValue:i,getName:n})=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Input,{name:n(),size:8,value:t(),onChange:e=>i(e.target.value),maxLength:"7",disabled:e||!d})," ",(0,l.jsx)(r,{content:"kbytes"})]})})]}),null!==(0,s.getIn)(t,"settings[maxConnections]")&&(0,l.jsx)(s.FormField,{name:"settings[maxConnections]",label:(0,l.jsx)(r,{content:"maxConnections"}),description:(0,l.jsx)(r,{content:`maxConnectionsHint${n}`}),children:({getValue:t,setValue:i,getName:n})=>(0,l.jsx)(s.Input,{name:n(),size:8,value:t(),onChange:e=>i(e.target.value),maxLength:"10",disabled:e})}),null!==(0,s.getIn)(t,"settings[maxConnectionsPerIp]")&&(0,l.jsx)(s.FormField,{name:"settings[maxConnectionsPerIp]",label:(0,l.jsx)(r,{content:`maxConnectionsPerIp${n}`}),description:(0,l.jsx)(r,{content:`maxConnectionsPerIpHint${n}`}),children:({getValue:t,setValue:i,getName:n})=>(0,l.jsx)(s.Input,{name:n(),size:8,value:t(),onChange:e=>i(e.target.value),maxLength:"10",disabled:e})}),null!==(0,s.getIn)(t,"settings[outgoingEmailMode]")&&(0,l.jsx)(s.FormFieldRadioButtons,{label:(0,l.jsx)(r,{content:"outgoingEmailMode"}),name:"settings[outgoingEmailMode]",disabled:e,options:[{value:"domain-ip",label:(0,l.jsx)(r,{content:"outgoingEmailModeDomainIp"})},{value:"domain-name",label:(0,l.jsx)(r,{content:"outgoingEmailModeDomainName"})},{value:"explicit-ip",label:(0,l.jsx)(r,{content:"outgoingEmailModeExplicitIp"}),indentFields:[h.length&&(0,l.jsxs)("div",{style:{marginBlockStart:"8px"},children:[(0,l.jsx)(r,{content:"outgoingEmailModeExplicitIpV4"})," ",(0,l.jsxs)(s.Select,{name:"settings[outgoingEmailModeIpV4]",id:"settings-outgoingEmailModeIpV4",size:"sm",value:(0,s.getIn)(t,"settings[outgoingEmailModeIpV4]"),onChange:e=>u("settings[outgoingEmailModeIpV4]",e),disabled:e||"explicit-ip"!==(0,s.getIn)(t,"settings[outgoingEmailMode]"),children:[(0,l.jsx)(s.SelectOption,{value:"",children:p("outgoingEmailModeExplicitIpNone")}),h.map((({ipAddress:e})=>(0,l.jsx)(s.SelectOption,{value:e,children:e},e)))]})]}),b.length&&(0,l.jsxs)("div",{style:{marginBlockStart:"8px"},children:[(0,l.jsx)(r,{content:"outgoingEmailModeExplicitIpV6"})," ",(0,l.jsxs)(s.Select,{name:"settings[outgoingEmailModeIpV6]",id:"settings-outgoingEmailModeIpV6",size:"sm",value:(0,s.getIn)(t,"settings[outgoingEmailModeIpV6]"),onChange:e=>u("settings[outgoingEmailModeIpV6]",e),disabled:e||"explicit-ip"!==(0,s.getIn)(t,"settings[outgoingEmailMode]"),children:[(0,l.jsx)(s.SelectOption,{value:"",children:p("outgoingEmailModeExplicitIpNone")}),b.map((({ipAddress:e})=>(0,l.jsx)(s.SelectOption,{value:e,children:e},e)))]})]})].filter(Boolean)}]}),null!==(0,s.getIn)(t,"settings[isMessageSubmissionEnabled]")&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.FormFieldCheckbox,{label:(0,l.jsx)(r,{content:c?"messageSubmission":"messageSubmissionOnAllIp"}),name:"settings[isMessageSubmissionEnabled]",disabled:e}),(0,s.getIn)(t,"settings[isMessageSubmissionEnabled]")&&c&&(0,l.jsxs)(s.Section,{collapsible:!0,children:[(0,l.jsx)(r,{content:"messageSubmissionBindTo"})," ",(0,l.jsxs)(s.Select,{name:"settings[messageSubmissionIp]",value:(0,s.getIn)(t,"settings[messageSubmissionIp]"),disabled:e,onChange:e=>u("settings[messageSubmissionIp]",e),children:[m&&(0,l.jsx)(s.SelectOption,{value:"",children:p("messageSubmissionAllIpAddresses")}),o.map((({ipAddress:e})=>(0,l.jsx)(s.SelectOption,{value:e,children:e},e)))]})]})]}),null!==(0,s.getIn)(t,"settings[isEmailSubaddressingEnabled]")&&(0,l.jsx)(s.FormFieldCheckbox,{label:(0,l.jsx)(r,{content:"subaddressing"}),name:"settings[isEmailSubaddressingEnabled]",description:(0,l.jsx)(r,{content:"subaddressingHint",params:{verpStyleLink:(0,l.jsx)(s.Link,{href:"https://en.wikipedia.org/wiki/Variable_envelope_return_path",target:"_blank",children:(0,l.jsx)(r,{content:"verpStyleLink"})})}}),disabled:e}),null!==(0,s.getIn)(t,"settings[isMboxQuotaWarningEnabled]")&&(0,l.jsx)(s.FormFieldCheckbox,{label:(0,l.jsx)(r,{content:"mboxQuotaWarning"}),name:"settings[isMboxQuotaWarningEnabled]",description:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r,{content:"mboxQuotaWarningHint"}),(0,l.jsx)("br",{}),(0,l.jsx)(s.Link,{href:"/admin/mail-settings/customize-mailbox-quota-warning",children:(0,l.jsx)(r,{content:"mboxQuotaWarningChange"})})]}),disabled:e}),null!==(0,s.getIn)(t,"settings[isFixSenderEnabled]")&&(0,l.jsx)(s.FormFieldCheckbox,{label:(0,l.jsx)(r,{content:"fixSender"}),name:"settings[isFixSenderEnabled]",description:(0,l.jsx)(r,{content:"fixSenderHint"}),disabled:e})]})};d.propTypes={isMailUiDisabled:o().bool,values:o().object.isRequired,mailServerName:o().string.isRequired,imapServerName:o().string.isRequired,isWindows:o().bool,ipAddresses:o().array.isRequired,isMaxLetterSizeChangeable:o().bool,isMessageSubmissionDedicatedIPSupported:o().bool,isMessageSubmissionAllIPSupported:o().bool,handleFieldChange:o().func.isRequired};const c=d},2422:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>c});var s=i(286),n=i(89),a=i(596),o=i.n(a),l=i(285);const r=n.Locale.getTranslate("admin.components.forms.server-mail-settings.mailman"),d=({isMailUiDisabled:e=!1,hasLocalhostRelayingAddressesIpV4:t=!1,hasLocalhostRelayingAddressesIpV6:i=!1})=>(0,l.jsxs)(s.Section,{title:(0,l.jsx)(r,{content:"title"}),children:[!t&&!i&&(0,l.jsx)(s.StatusMessage,{intent:"warning",children:(0,l.jsx)(r,{content:"noLocalhost"})}),!t&&i&&(0,l.jsx)(s.StatusMessage,{intent:"warning",children:(0,l.jsx)(r,{content:"noLocalhostIpv4"})}),t&&!i&&(0,l.jsx)(s.StatusMessage,{intent:"warning",children:(0,l.jsx)(r,{content:"noLocalhostIpv6"})}),(0,l.jsx)(s.FormFieldCheckbox,{label:(0,l.jsx)(r,{content:"secureLinks"}),name:"settings[isListSecureLinksEnabled]",description:(0,l.jsx)(r,{content:"secureLinksHint"}),disabled:e})]});d.propTypes={isMailUiDisabled:o().bool,hasLocalhostRelayingAddressesIpV4:o().bool,hasLocalhostRelayingAddressesIpV6:o().bool};const c=d},2421:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>c});var s=i(286),n=i(89),a=i(285),o=i(596),l=i.n(o);const r=n.Locale.getTranslate("admin.components.forms.server-mail-settings.outgoing"),d=({value:e,name:t,isUnlimited:i,warnings:n=[],isDisabled:o=!1})=>{const[l,d]=(0,a.useState)("");return(0,a.useEffect)((()=>{d(i(e)?"":e)}),[e,i]),(0,a.jsx)(s.FormField,{label:(0,a.jsx)(r,{content:t}),name:`outgoingMessages[${t}]`,children:({getValue:e,setValue:c})=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"server-mail-settings-form-field-complex",style:{gap:8},children:[(0,a.jsx)(s.Input,{name:`outgoingMessages[${t}]`,size:8,value:l,onChange:e=>{c(e.target.value),d(e.target.value)},maxLength:"9",disabled:o||i(e())}),(0,a.jsx)(s.Checkbox,{name:`outgoingMessages[${t}Unlimited]`,checked:i(e()),onChange:e=>c(e?-1:l),disabled:o,children:(0,a.jsx)(r,{content:"unlimited"})})]}),n.map((e=>(0,a.jsx)(s.Status,{intent:"warning",children:e},e)))]})})};d.propTypes={value:l().number.isRequired,name:l().string.isRequired,isUnlimited:l().func.isRequired,warnings:l().array,isDisabled:l().bool};const c=d},2420:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>m});var s=i(286),n=i(89),a=i(285),o=i(2421),l=i(596),r=i.n(l);const d=n.Locale.getTranslate("admin.components.forms.server-mail-settings.outgoing"),c=({isMailUiDisabled:e=!1,values:t,allowedReportPeriods:i,allowedNotificationPeriods:n})=>{const l=(0,s.useTranslate)("admin.components.forms.server-mail-settings.outgoing"),r=!e&&(0,s.getIn)(t,"outgoingMessages[isEnabled]"),[c,m]=(0,a.useState)([]),[u,p]=(0,a.useState)([]),g=(0,s.getIn)(t,"outgoingMessages[mailboxLimit]"),h=(0,s.getIn)(t,"outgoingMessages[domainLimit]"),b=(0,s.getIn)(t,"outgoingMessages[subscriptionLimit]"),x=(0,a.useCallback)((e=>-1===e),[]);return(0,a.useEffect)((()=>{const e=e=>x(e)?(0,a.jsx)(d,{content:"unlimited"}):+e,t=e=>null!==e&&""!==e,i=[],s=[];r&&(t(g)&&t(h)&&!x(h)&&(+g>+h||x(g))&&i.push((0,a.jsx)(d,{content:"mailboxLimitExceedsDomainLimit",params:{value:e(g),highLevelLimitValue:e(h)}})),t(g)&&t(b)&&!x(b)&&(+g>+b||x(g))&&i.push((0,a.jsx)(d,{content:"mailboxLimitExceedsSubscriptionLimit",params:{value:e(g),highLevelLimitValue:e(b)}})),t(h)&&t(b)&&!x(b)&&(+h>+b||x(h))&&s.push((0,a.jsx)(d,{content:"domainLimitExceedsSubscriptionLimit",params:{value:e(h),highLevelLimitValue:e(b)}}))),m(i),p(s)}),[r,g,h,b,x]),(0,a.jsxs)(s.Section,{title:(0,a.jsx)(d,{content:"title"}),children:[r&&0!==((0,s.getIn)(t,"relay[noRelayNetworks]")??[]).length&&(0,a.jsx)(s.StatusMessage,{intent:"warning",children:(0,a.jsx)(d,{content:"whiteListNotEmpty"})}),r&&"open"===(0,s.getIn)(t,"relay[type]")&&(0,a.jsx)(s.StatusMessage,{intent:"warning",children:(0,a.jsx)(d,{content:"relayIsOpen"})}),(0,a.jsx)("p",{children:(0,a.jsx)(d,{content:"description",params:{link:(0,a.jsx)(s.Link,{href:"/smb/help/redirect/controller-name/mail-settings/action-name/outgoing-messages",target:"_blank",children:(0,a.jsx)(d,{content:"learnMore"})})}})}),(0,a.jsx)(s.FormFieldCheckbox,{label:(0,a.jsx)(d,{content:"enabled"}),name:"outgoingMessages[isEnabled]",disabled:e}),null!==(0,s.getIn)(t,"outgoingMessages[isCountRecipientsEnabled]")&&(0,a.jsx)(s.FormFieldCheckbox,{label:(0,a.jsx)(d,{content:"countRecipients"}),name:"outgoingMessages[isCountRecipientsEnabled]",description:(0,a.jsx)(d,{content:"countRecipientsHint"}),disabled:!r}),null!==g&&(0,a.jsx)(o.default,{value:g,name:"mailboxLimit",isUnlimited:x,warnings:c,isDisabled:!r}),null!==h&&(0,a.jsx)(o.default,{value:h,name:"domainLimit",isUnlimited:x,warnings:u,isDisabled:!r}),null!==b&&(0,a.jsx)(o.default,{value:b,name:"subscriptionLimit",isUnlimited:x,isDisabled:!r}),null!==(0,s.getIn)(t,"outgoingMessages[isSendmailEnabled]")&&(0,a.jsx)(s.FormFieldCheckbox,{label:(0,a.jsx)(d,{content:"sendmail"}),name:"outgoingMessages[isSendmailEnabled]",description:(0,a.jsx)(d,{content:"sendmailHint"}),disabled:!r}),(0,a.jsx)(s.FormFieldSelect,{label:(0,a.jsx)(d,{content:"reportPeriod"}),name:"outgoingMessages[reportPeriod]",description:(0,a.jsx)(d,{content:"reportPeriodHint"}),size:"sm",disabled:!r,children:i.map((e=>(0,a.jsx)("option",{value:e,children:l(`period${e}`)},e)))}),(0,a.jsx)(s.FormFieldSelect,{label:(0,a.jsx)(d,{content:"notificationPeriod"}),name:"outgoingMessages[notificationPeriod]",description:(0,a.jsx)(d,{content:"notificationPeriodHint"}),size:"sm",disabled:!r,children:n.map((e=>(0,a.jsx)("option",{value:e,children:l(`period${e}`)},e)))})]})};c.propTypes={isMailUiDisabled:r().bool,values:r().object.isRequired,allowedReportPeriods:r().array.isRequired,allowedNotificationPeriods:r().array.isRequired};const m=c},2425:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>c});var s=i(286),n=i(89),a=i(596),o=i.n(a),l=i(285);const r=n.Locale.getTranslate("admin.components.forms.server-mail-settings.pop3-names"),d=({isMailUiDisabled:e=!1})=>(0,l.jsx)(s.Section,{title:(0,l.jsx)(r,{content:"title"}),children:(0,l.jsx)(s.FormFieldRadioButtons,{label:null,name:"settings[isShortPop3NameEnabled]",disabled:e,options:[{value:"true",label:(0,l.jsx)(r,{content:"enabled"})},{value:"false",label:(0,l.jsx)(r,{content:"disabled"})}]})});d.propTypes={isMailUiDisabled:o().bool};const c=d},2419:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>c});var s=i(286),n=i(89),a=i(596),o=i.n(a),l=i(285);const r=n.Locale.getTranslate("admin.components.forms.server-mail-settings.relay"),d=({isMailUiDisabled:e=!1,values:t,isOpenRelayAllowed:i=!1,isWindows:n=!1,isRelayLockTimeSupported:a=!1,isRelayTypeOpenSupported:o=!1,isRelayTypeClosedSupported:d=!1,isRelayTypeAuthSupported:c=!1,isRelayTypeAuthPop3Supported:m=!1,isRelayTypeAuthSmtpSupported:u=!1,isRelayTypeAuthBothSupported:p=!1,handleFieldChange:g})=>{const h=(e,t)=>p&&e&&t||m&&e&&!t||u&&!e&&t;return(0,l.jsxs)(s.Section,{title:(0,l.jsx)(r,{content:"title"}),children:[(0,l.jsx)(s.FormFieldRadioButtons,{label:(0,l.jsx)(r,{content:"type"}),name:"relay[type]",disabled:e,description:"open"===(0,s.getIn)(t,"relay[type]")&&(0,l.jsxs)(s.Status,{intent:"danger",children:[(0,l.jsx)(r,{content:"openSpamWarning"}),(0,l.jsx)("br",{}),(0,l.jsx)(r,{content:"openSpamChange"})]}),options:[i&&{value:"open",label:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r,{content:"open"}),!o&&(0,l.jsxs)(l.Fragment,{children:[" ","(",(0,l.jsx)(r,{content:"notSupported"}),")"]})]}),disabled:!o},{value:"closed",label:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r,{content:"closed"}),!d&&(0,l.jsxs)(l.Fragment,{children:[" ","(",(0,l.jsx)(r,{content:"notSupported"}),")"]})]}),disabled:!d,description:n&&(0,l.jsx)(r,{content:"change",params:{changeLink:(0,l.jsx)(s.Link,{href:"/admin/mail-gate",children:(0,l.jsx)(r,{content:"changeLink"})})}})},{value:"auth",label:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r,{content:"auth"}),!c&&(0,l.jsxs)(l.Fragment,{children:[" ","(",(0,l.jsx)(r,{content:"notSupported"}),")"]})]}),disabled:!c,indentFields:[(0,l.jsx)(s.FormField,{label:null,style:{marginBlockEnd:0},children:(0,l.jsxs)("div",{className:"server-mail-settings-form-field-complex",children:[(0,l.jsx)(s.Checkbox,{name:"relay[isPopAuthEnabled]",checked:(0,s.getIn)(t,"relay[isPopAuthEnabled]"),onChange:e=>{const i=(0,s.getIn)(t,"relay[isSmtpAuthEnabled]");if(!h(e,i))return i||e||!h(e,!0)?void g("relay[isPopAuthEnabled]",!e):(g("relay[isSmtpAuthEnabled]",!0),void g("relay[isPopAuthEnabled]",e));g("relay[isPopAuthEnabled]",e)},disabled:e||"auth"!==(0,s.getIn)(t,"relay[type]")||!(m||p),children:(0,l.jsx)(r,{content:"pop3"})}),(0,l.jsx)(r,{content:"lockTime"}),(0,l.jsx)(s.Input,{name:"relay[lockTime]",size:"sm",value:(0,s.getIn)(t,"relay[lockTime]"),onChange:e=>g("relay[lockTime]",e.target.value),maxLength:"5",disabled:e||"auth"!==(0,s.getIn)(t,"relay[type]")||!(0,s.getIn)(t,"relay[isPopAuthEnabled]")||!a||!(m||p)}),(0,l.jsx)(r,{content:"min"})]})},"popAuth"),(0,l.jsx)(s.FormFieldCheckbox,{label:(0,l.jsx)(r,{content:"smtp"}),name:"relay[isSmtpAuthEnabled]",onChange:e=>{const i=(0,s.getIn)(t,"relay[isPopAuthEnabled]");if(!h(i,e))return i||e||!h(!0,e)?void g("relay[isSmtpAuthEnabled]",!e):(g("relay[isPopAuthEnabled]",!0),void g("relay[isSmtpAuthEnabled]",e));g("relay[isSmtpAuthEnabled]",e)},disabled:e||!(u||p)},"smtp")]}].filter(Boolean)}),n&&t?.relay?.noRelayNetworks&&(0,l.jsx)(s.FormFieldText,{label:(0,l.jsx)(r,{content:"noRelayNetworks"}),name:"relay[noRelayNetworks]",multi:!0,size:"xl",description:(0,l.jsx)(r,{content:"noRelayNetworksHint"}),disabled:e})]})};d.propTypes={isMailUiDisabled:o().bool,values:o().object.isRequired,isOpenRelayAllowed:o().bool,isWindows:o().bool,isRelayLockTimeSupported:o().bool,isRelayTypeOpenSupported:o().bool,isRelayTypeClosedSupported:o().bool,isRelayTypeAuthSupported:o().bool,isRelayTypeAuthPop3Supported:o().bool,isRelayTypeAuthSmtpSupported:o().bool,isRelayTypeAuthBothSupported:o().bool,handleFieldChange:o().func.isRequired};const c=d},2423:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>c});var s=i(286),n=i(89),a=i(596),o=i.n(a),l=i(285);const r=n.Locale.getTranslate("admin.components.forms.server-mail-settings.spam-filter"),d=({isMailUiDisabled:e=!1,values:t,isRBLInstalled:i=!1})=>{const n=(0,s.useTranslate)("admin.components.forms.server-mail-settings.spam-filter"),a=null!==(0,s.getIn)(t,"spamFilter[isDmarcEnabled]"),o=null!==(0,s.getIn)(t,"spamFilter[isSigningOutgoingMailEnabled]"),d=null!==(0,s.getIn)(t,"spamFilter[isSpfEnabled]");return(0,l.jsxs)(l.Fragment,{children:[a&&(0,l.jsx)(s.Section,{title:(0,l.jsx)(r,{content:"dmarc"}),children:(0,l.jsx)(s.FormFieldCheckbox,{label:(0,l.jsx)(r,{content:"dmarcEnabled"}),name:"spamFilter[isDmarcEnabled]",description:o&&d&&(0,l.jsx)(r,{content:"dmarcHint"}),disabled:e||!1===(0,s.getIn)(t,"spamFilter[isVerifyingIncomingMailEnabled]")||!1===(0,s.getIn)(t,"spamFilter[isSpfEnabled]")})}),o&&(0,l.jsxs)(s.Section,{title:(0,l.jsx)(r,{content:"dkim"}),children:[(0,l.jsx)(s.FormFieldCheckbox,{label:(0,l.jsx)(r,{content:"singOutgoing"}),name:"spamFilter[isSigningOutgoingMailEnabled]",disabled:e}),a&&(0,l.jsx)(s.FormFieldCheckbox,{label:(0,l.jsx)(r,{content:"verifyIncoming"}),name:"spamFilter[isVerifyingIncomingMailEnabled]",description:(0,l.jsx)(r,{content:"verifyIncomingHint"}),disabled:e||(0,s.getIn)(t,"spamFilter[isDmarcEnabled]")})]}),d&&(0,l.jsxs)(s.Section,{title:(0,l.jsx)(r,{content:"spf"}),children:[(0,l.jsx)(s.FormFieldCheckbox,{label:(0,l.jsx)(r,{content:"spfEnabled"}),name:"spamFilter[isSpfEnabled]",description:a&&(0,l.jsx)(r,{content:"spfEnabledHint"}),disabled:e||(0,s.getIn)(t,"spamFilter[isDmarcEnabled]")}),(0,l.jsx)(s.FormFieldCheckbox,{label:(0,l.jsx)(r,{content:"ignoreErrors"}),name:"spamFilter[isErrorIgnored]",description:(0,l.jsx)(r,{content:"ignoreErrorsHint"}),disabled:e||!(0,s.getIn)(t,"spamFilter[isSpfEnabled]")||+(0,s.getIn)(t,"spamFilter[behavior]")<=2}),(0,l.jsxs)(s.FormFieldSelect,{label:(0,l.jsx)(r,{content:"behavior"}),name:"spamFilter[behavior]",description:(0,l.jsx)(r,{content:"behaviorHint"}),disabled:e||!(0,s.getIn)(t,"spamFilter[isSpfEnabled]"),children:[(0,l.jsx)("option",{value:"1",children:n("behaviorCreateHeadersNoBlock")}),(0,l.jsx)("option",{value:"2",children:n("behaviorUseTmpErrors")}),(0,l.jsx)("option",{value:"3",children:n("behaviorRejectIfFail")}),(0,l.jsx)("option",{value:"4",children:n("behaviorRejectIfSoftfail")}),(0,l.jsx)("option",{value:"5",children:n("behaviorRejectIfNeutral")}),(0,l.jsx)("option",{value:"6",children:n("behaviorRejectIfNoPass")})]}),(0,l.jsx)(s.FormField,{label:(0,l.jsx)(r,{content:"localRules"}),name:"spamFilter[localRules]",children:({getValue:i,setValue:n,getName:a})=>(0,l.jsx)(s.Input,{name:a(),size:50,value:i(),onChange:e=>n(e.target.value),maxLength:"255",disabled:e||!(0,s.getIn)(t,"spamFilter[isSpfEnabled]")})}),(0,l.jsx)(s.FormField,{label:(0,l.jsx)(r,{content:"guessRules"}),name:"spamFilter[guessRules]",children:({getValue:i,setValue:n,getName:a})=>(0,l.jsx)(s.Input,{name:a(),size:50,value:i(),onChange:e=>n(e.target.value),maxLength:"255",disabled:e||!(0,s.getIn)(t,"spamFilter[isSpfEnabled]")})}),(0,l.jsx)(s.FormField,{label:(0,l.jsx)(r,{content:"explanationText"}),name:"spamFilter[explanationText]",children:({getValue:i,setValue:n,getName:a})=>(0,l.jsx)(s.Input,{name:a(),size:50,value:i(),onChange:e=>n(e.target.value),maxLength:"255",disabled:e||!(0,s.getIn)(t,"spamFilter[isSpfEnabled]")})})]}),null!==(0,s.getIn)(t,"spamFilter[isRblEnabled]")&&(0,l.jsxs)(s.Section,{title:(0,l.jsx)(r,{content:"rbl"}),children:[(0,l.jsx)(s.FormFieldCheckbox,{label:(0,l.jsx)(r,{content:"rblEnabled"}),name:"spamFilter[isRblEnabled]",disabled:e||!i}),(0,l.jsx)(s.FormFieldText,{label:(0,l.jsx)(r,{content:"rblServer"}),name:"spamFilter[rblServer]",size:"xl",description:(0,l.jsx)(r,{content:"rblServerHint"}),disabled:e||!i||!(0,s.getIn)(t,"spamFilter[isRblEnabled]")})]})]})};d.propTypes={isMailUiDisabled:o().bool,values:o().object.isRequired,isRBLInstalled:o().bool};const c=d},2416:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>M});var s=i(285),n=i(580),a=i(286),o=i(1289),l=i(2417),r=i(2418),d=i(2419),c=i(2420),m=i(2422),u=i(2423),p=i(2424),g=i(2425),h=i(596),b=i.n(h),x=i(1120),v=i(628),S=i(536),j=i(646),y=i(89);const f=y.Locale.getTranslate("admin.components.forms.server-mail-settings"),k=y.Locale.getTranslate("components.buttons"),T=x.gql` mutation UpdateServerMail($input: UpdateServerMailInput!) { updateServerMail(input: $input) { warnings } } `,F=e=>null===e?null:`${e}`,R=e=>null===e||""===`${e}`.trim()?null:+e,P=({serverMail:{isMailUiEnabled:e,settings:t,autodiscover:h,relay:b,outgoingMessages:x,spamFilter:y},os:{isWindows:P},capability:{mailServer:{isMaxLetterSizeChangeable:M,isMessageSubmissionDedicatedIPSupported:L,isMessageSubmissionAllIPSupported:E,isRelayLockTimeSupported:w,isRelayTypeOpenSupported:C,isRelayTypeClosedSupported:I,isRelayTypeAuthSupported:D,isRelayTypeAuthPop3Supported:N,isRelayTypeAuthSmtpSupported:A,isRelayTypeAuthBothSupported:V},packages:{isRBLInstalled:q}},server:{ipAddresses:{nodes:O}}})=>{const B=(0,n.useNavigate)(),[H]=(0,v.useMutation)(T,{refetchQueries:[{query:i(1247)}],awaitRefetchQueries:!0}),W="/admin/server/tools",[U,$]=(0,s.useState)({});(0,s.useEffect)((()=>{const{mailServerName:i,imapServerName:s,outgoingEmailModeIps:n,hasLocalhostRelayingAddressesIpV4:a,hasLocalhostRelayingAddressesIpV6:o,...l}=t||{},{isDnsEnabled:r,...d}=h||{},{isOpenRelayAllowed:c,...m}=b||{},{allowedReportPeriods:u,allowedNotificationPeriods:p,...g}=x||{};$({settings:t?{...l,isMailUiEnabled:e,maxMessageSizeEnabled:!!t.maxMessageSize,maxMessageSize:null===t.maxMessageSize?null:Math.max(Math.ceil(t.maxMessageSize/1024),0),messageSubmissionIp:L?t.messageSubmissionIp?.ipAddress??"":null,outgoingEmailModeIpV4:n?.find((({isIPv6:e})=>!e))?.ipAddress??"",outgoingEmailModeIpV6:n?.find((({isIPv6:e})=>e))?.ipAddress??"",isShortPop3NameEnabled:F(t.isShortPop3NameEnabled)}:null,autodiscover:h?d:null,relay:b?m:null,outgoingMessages:x?g:null,spamFilter:y?{...y,behavior:F(y.behavior)}:null})}),[e,t,h,b,x,y,L]);const z=(0,s.useCallback)(((e,t)=>$((i=>(0,a.setIn)(i,e,t)))),[]),_=t?!1===(0,a.getIn)(U,"settings[isMailUiEnabled]"):!e;return(0,s.jsxs)(o.default,{id:"main-settings-content",mutation:H,values:U,onFieldChange:z,submitButton:{id:"buttonid-ok",name:"ok",children:(0,s.jsx)(k,{content:"save"})},applyButton:{id:"buttonid-apply",name:"apply",children:(0,s.jsx)(k,{content:"apply"})},cancelButton:{id:"buttonid-cancel",name:"cancel",children:(0,s.jsx)(k,{content:"cancel"}),component:j.default,to:W},onSubmit:e=>Object.entries(e).reduce(((e,[t,i])=>{if(null!==i&&"object"==typeof i){const{__typename:s,...n}=i;switch(t){case"settings":{const{maxMessageSizeEnabled:t,...i}=n;return{...e,settings:{...i,maxMessageSize:t?R(n.maxMessageSize):0,maxConnections:R(n.maxConnections),maxConnectionsPerIp:R(n.maxConnectionsPerIp),isShortPop3NameEnabled:null===n.isShortPop3NameEnabled?null:"true"===n.isShortPop3NameEnabled,autoReplyHeaders:null===n.autoReplyHeaders?null:n.autoReplyHeaders.map((e=>{if(!e)return null;const{name:t,value:i}=e;return{name:t,value:i}}))}}}case"relay":return{...e,relay:{...n,lockTime:R(n.lockTime)}};case"outgoingMessages":return{...e,outgoingMessages:{...n,mailboxLimit:""===n.mailboxLimit?null:R(n.mailboxLimit),domainLimit:""===n.domainLimit?null:R(n.domainLimit),subscriptionLimit:""===n.subscriptionLimit?null:R(n.subscriptionLimit)}};case"spamFilter":return{...e,spamFilter:{...n,behavior:null===n.behavior?null:+n.behavior}}}return{...e,[t]:n}}return{...e,[t]:i}}),{}),onSuccess:({updateServerMail:{warnings:e}},t)=>{e.forEach((e=>(0,S.addToast)({intent:"warning",message:e}))),(0,S.addToast)({intent:"success",message:(0,s.jsx)(f,{content:"success"})}),t?B(window.location.pathname,{replace:!0}):B(W)},children:[t&&(0,s.jsx)(l.default,{...t,isMailUiDisabled:_,values:U,isWindows:P,ipAddresses:O,isMaxLetterSizeChangeable:M,isMessageSubmissionDedicatedIPSupported:L,isMessageSubmissionAllIPSupported:E,handleFieldChange:z}),h&&(0,s.jsx)(r.default,{...h,isMailUiDisabled:_,values:U}),b&&(0,s.jsx)(d.default,{...b,isMailUiDisabled:_,values:U,isWindows:P,isRelayLockTimeSupported:w,isRelayTypeOpenSupported:C,isRelayTypeClosedSupported:I,isRelayTypeAuthSupported:D,isRelayTypeAuthPop3Supported:N,isRelayTypeAuthSmtpSupported:A,isRelayTypeAuthBothSupported:V,handleFieldChange:z}),x&&(0,s.jsx)(c.default,{...x,isMailUiDisabled:_,values:U}),null!==(t?.isListSecureLinksEnabled??null)&&(0,s.jsx)(m.default,{...t,isMailUiDisabled:_}),y&&(0,s.jsx)(u.default,{isMailUiDisabled:_,values:U,isRBLInstalled:q}),null!==(t?.autoReplyHeaders??null)&&(0,s.jsx)(p.default,{isMailUiDisabled:_}),null!==(t?.isShortPop3NameEnabled??null)&&(0,s.jsx)(g.default,{isMailUiDisabled:_})]})};P.propTypes={serverMail:b().shape({isMailUiEnabled:b().bool.isRequired,settings:b().object,autodiscover:b().object,relay:b().object,outgoingMessages:b().object,spamFilter:b().object}).isRequired,os:b().shape({isWindows:b().bool.isRequired}).isRequired,capability:b().shape({mailServer:b().object.isRequired,packages:b().object.isRequired}).isRequired,server:b().shape({ipAddresses:b().shape({nodes:b().array.isRequired}).isRequired}).isRequired};const M=P},2449:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>j});var s=i(1289),n=i(2450),a=i(2451),o=i(596),l=i.n(o),r=i(285),d=i(89),c=i(1120),m=i(628),u=i(286),p=i(646),g=i(536),h=i(580);const b=c.gql` mutation UpdateSmarthost($input: UpdateSmarthostInput!) { updateSmarthost(input: $input) { success message } } `,x=d.Locale.getTranslate("admin.components.forms.server-mail-smarthost"),v=d.Locale.getTranslate("components.buttons"),S=({serverMail:{smarthost:{smarthostEncryptionOptions:e,isServerEnabled:t,host:o,port:l,isAuthenticationRequired:d,username:c,encryption:S}},os:{isWindows:j}})=>{const y=(0,h.useNavigate)(),[f,{loading:k}]=(0,m.useMutation)(b,{refetchQueries:[{query:i(1254)}],awaitRefetchQueries:!0}),[T,F]=(0,r.useState)({}),[R,P]=(0,r.useState)({}),M="/admin/server/tools";return(0,r.useEffect)((()=>{F({settings:{isServerEnabled:t},configuration:{host:o,port:l.toString(),username:c,isAuthenticationRequired:d,password:"",encryption:S}})}),[t,o,l,d,c,S]),(0,r.jsxs)(s.default,{id:"smarthost-form",mutation:f,values:T,errors:R,onFieldChange:(e,t)=>{F((i=>(0,u.setIn)(i,e,t)))},onSuccess:(e,t)=>{(0,g.addToast)({intent:"success",message:(0,r.jsx)(x,{content:"success"})}),t||y(M)},submitButton:{id:"buttonid-ok",name:"ok",children:(0,r.jsx)(v,{content:"save"}),disabled:k},applyButton:{id:"buttonid-apply",name:"apply",children:(0,r.jsx)(v,{content:"apply"}),disabled:k},cancelButton:{id:"buttonid-cancel",name:"cancel",children:(0,r.jsx)(v,{content:"cancel"}),component:p.default,to:M,disabled:k},children:[(0,r.jsx)(n.default,{disabled:k}),(0,r.jsx)(a.default,{encryptionOptions:e,isWindows:j,isAuthenticationRequired:(0,u.getIn)(T,"configuration[isAuthenticationRequired]"),onDryRun:async()=>{try{P({});const{data:{updateSmarthost:{success:e,message:t}}}=await f({variables:{input:{...T,checkConnection:!0}},refetchQueries:[]});(0,g.addToast)({intent:e?"success":"danger",message:e?(0,r.jsx)(x,{content:"configuration.checkConnection.success"}):t})}catch(e){const{graphQLErrors:t}=e;if("validate"===t[0]?.extensions?.category){const e=t[0].extensions.messages;P(e)}else(0,g.addToast)({intent:"danger",message:t[0].extensions?.debugMessage||t[0].message})}},disabled:k||!(0,u.getIn)(T,"settings[isServerEnabled]")})]})};S.propTypes={serverMail:l().shape({smarthost:l().shape({smarthostEncryptionOptions:l().array.isRequired,isServerEnabled:l().bool.isRequired,host:l().string.isRequired,port:l().number.isRequired,isAuthenticationRequired:l().bool.isRequired,username:l().string.isRequired,encryption:l().string}).isRequired}).isRequired,os:l().shape({isWindows:l().bool.isRequired}).isRequired};const j=S},2451:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>c});var s=i(89),n=i(286),a=i(596),o=i.n(a),l=i(285);const r=s.Locale.getTranslate("admin.components.forms.server-mail-smarthost.configuration"),d=({encryptionOptions:e,isWindows:t,isAuthenticationRequired:i,onDryRun:s,disabled:a})=>{const o=t?"Windows":"Unix",[d,c]=(0,l.useState)(!1),m=async()=>{c(!0),await s(),c(!1)};return(0,l.jsxs)(n.Section,{title:(0,l.jsx)(r,{content:"title"}),children:[(0,l.jsx)(n.FormField,{name:"configuration[host]",label:(0,l.jsx)(r,{content:"hostnameOrIP"}),required:!0,description:t?"":(0,l.jsx)(r,{content:"hostnameOrIP.unixHint"}),children:({getValue:e,setValue:t,getName:i})=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.Input,{name:i(),id:"configuration-host",size:45,value:e(),onChange:e=>t(e.target.value),disabled:a})," ",(0,l.jsx)(n.Button,{size:"md",state:d?"loading":null,id:"checkConnection",onClick:m,disabled:a,children:(0,l.jsx)(r,{content:"checkConnection"})})]})}),(0,l.jsx)(n.FormFieldText,{name:"configuration[port]",label:(0,l.jsx)(r,{content:"port"}),inputProps:{size:5},required:!0,disabled:a}),(0,l.jsx)(n.FormFieldCheckbox,{name:"configuration[isAuthenticationRequired]",label:(0,l.jsx)(r,{content:"authRequired"}),disabled:a}),(0,l.jsxs)(n.Section,{collapsible:!0,children:[(0,l.jsx)(n.FormFieldText,{name:"configuration[username]",label:(0,l.jsx)(r,{content:"username"}),size:"md",disabled:!i||a}),(0,l.jsx)(n.FormFieldPassword,{name:"configuration[password]",label:(0,l.jsx)(r,{content:"password"}),size:"md",hideGenerateButton:!0,hidePasswordMeter:!0,disabled:!i||a})]}),e.length>0&&(0,l.jsx)(n.FormFieldRadioButtons,{name:"configuration[encryption]",label:(0,l.jsx)(r,{content:"encryption"}),options:e.map((e=>({value:e,label:(0,l.jsx)(r,{content:`encryption.${o}.${e}`})}))),disabled:a})]})};d.propTypes={encryptionOptions:o().array.isRequired,isWindows:o().bool.isRequired,isAuthenticationRequired:o().bool.isRequired,onDryRun:o().func.isRequired,disabled:o().bool.isRequired};const c=d},2450:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>c});var s=i(89),n=i(286),a=i(596),o=i.n(a),l=i(285);const r=s.Locale.getTranslate("admin.components.forms.server-mail-smarthost.settings"),d=({disabled:e})=>(0,l.jsxs)(n.Section,{title:(0,l.jsx)(r,{content:"title"}),children:[(0,l.jsx)(n.StatusMessage,{intent:"warning",children:(0,l.jsx)(r,{content:"note",params:{title:(0,l.jsx)("b",{children:(0,l.jsx)(r,{content:"noteTitle"})}),link:(0,l.jsx)("a",{href:"https://docs.plesk.com/en-US/obsidian/administrator-guide/mail/configuring-a-smarthost-or-relayhost.80030",children:(0,l.jsx)(r,{content:"noteLinkTitle"})})}})}),(0,l.jsx)(n.FormFieldCheckbox,{label:(0,l.jsx)(r,{content:"useSmarthost"}),name:"settings[isServerEnabled]",disabled:e})]});d.propTypes={disabled:o().bool.isRequired};const c=d},2448:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>s.default});var s=i(2449)},2436:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>v});var s=i(285),n=i(580),a=i(1120),o=i(628),l=i(286),r=i(596),d=i.n(r),c=i(89),m=i(1289),u=i(646),p=i(536);const g=c.Locale.getTranslate("admin.components.forms.server-mail-spam-filter"),h=c.Locale.getTranslate("components.buttons"),b=a.gql` mutation UpdateSpamAssassin($input: UpdateSpamAssassinInput!) { updateSpamAssassin(input: $input) { result } } `,x=({serverMail:{spamAssassin:{settings:{isEnabled:e,isUserSettingsEnabled:t,isUserSettingsAllowed:a,requiredHits:r,maxMailLimit:d,maxThreadsLimit:c,tag:x,alarmMessage:v,languages:S,locales:j,isGreylistingProtectionEnabled:y,maxChildren:f,maxChildrenLimit:k}}},capability:{mailServer:{isUserSettingsSupported:T}},os:{isWindows:F}})=>{const R=(0,n.useNavigate)(),P="/admin/server/tools",[M]=(0,o.useMutation)(b,{refetchQueries:[{query:i(1252)}],awaitRefetchQueries:!0}),[L,E]=(0,s.useState)({}),[w,C]=(0,s.useState)(""),I=F&&(!T||!a),D=!F;(0,s.useEffect)((()=>{E({isEnabled:e,isUserSettingsEnabled:t,isGreylistingProtectionEnabled:y,maxChildren:f,requiredHits:null===r?null:`${r}`,maxMailLimit:null===d?null:`${d}`,maxThreadsLimit:c,alarmMessage:v,tag:x,languages:S.filter((({isTrusted:e})=>e)).map((({key:e})=>e)),locales:j.filter((({isTrusted:e})=>e)).map((({key:e})=>e))})}),[e,t,y,f,r,d,c,x,v,S,j]);const N=null!==L.isEnabled;(0,s.useEffect)((()=>{C(d??"")}),[d]);let A=null;return I?A=(0,s.jsx)(g,{content:"isUserSettingsEnabledHint"}):D&&!N&&(A=(0,s.jsx)(g,{content:"notInstalled"})),(0,s.jsxs)(m.default,{id:"server-mail-spam-assassin",mutation:M,values:L,onFieldChange:(e,t)=>E((i=>(0,l.setIn)(i,e,t))),submitButton:{id:"buttonid-ok",name:"ok",children:(0,s.jsx)(h,{content:"save"})},applyButton:{id:"buttonid-apply",name:"apply",children:(0,s.jsx)(h,{content:"apply"})},cancelButton:{id:"buttonid-cancel",name:"cancel",children:(0,s.jsx)(h,{content:"cancel"}),component:u.default,to:P},onSuccess:(e,t)=>{(0,p.addToast)({intent:"success",message:(0,s.jsx)(g,{content:"success"})}),t?R(window.location.pathname,{replace:!0}):R(P)},children:[(0,s.jsxs)(l.Section,{title:(0,s.jsx)(g,{content:"general"}),children:[(0,s.jsx)(l.FormFieldCheckbox,{label:(0,s.jsx)(g,{content:"isEnabled"}),name:"isEnabled",disabled:!N,description:D&&!N?(0,s.jsx)(g,{content:"notInstalled"}):""}),D&&(0,s.jsx)(l.FormFieldCheckbox,{label:(0,s.jsx)(g,{content:"greylistingSpamProtection"}),name:"isGreylistingProtectionEnabled"}),(0,s.jsx)(l.FormFieldCheckbox,{label:(0,s.jsx)(g,{content:"isUserSettingsEnabled"}),name:"isUserSettingsEnabled",disabled:I||!N,description:A})]}),N&&(0,s.jsxs)(l.Section,{title:(0,s.jsx)(g,{content:"settings"}),children:[D&&(0,s.jsx)(l.FormField,{label:(0,s.jsx)(g,{content:"maxChildrenTitle"}),description:(0,s.jsx)(g,{content:"maxChildrenDescription"}),name:"maxChildren",children:({getValue:e,setValue:t,getName:i,isDisabled:n})=>(0,s.jsx)(l.InputNumber,{name:i(),value:e(),onChange:t,min:1,max:k,disabled:n(),"data-cy-limit":k})}),(0,s.jsx)(l.FormField,{label:(0,s.jsx)(g,{content:"requiredHitsTitle"}),description:(0,s.jsx)(g,{content:"requiredHitsDescription"}),name:"requiredHits",required:!0,children:({getValue:e,setValue:t,getName:i,isDisabled:n})=>(0,s.jsx)(l.Input,{name:i(),value:e()??"",onChange:e=>t(e.target.value),size:"sm",maxLength:"4",disabled:n()})}),F&&(0,s.jsx)(l.FormField,{label:(0,s.jsx)(g,{content:"maxMailLimit"}),name:"maxMailLimit",children:({getValue:e,setValue:t,getName:i,isDisabled:n})=>(0,s.jsxs)("div",{className:"server-mail-spam-filter-form-field-complex",children:[(0,s.jsx)(l.Checkbox,{name:`${i()}Enabled`,checked:null!==e(),onChange:e=>t(e?w:null),disabled:n(),children:(0,s.jsx)(g,{content:"maxMailLimitText"})}),(0,s.jsx)(l.Input,{name:i(),value:w,onChange:e=>{C(e.target.value),t(e.target.value)},size:10,maxLength:"9",disabled:null===e()||n()}),(0,s.jsx)(g,{content:"kbytes"})]})}),null!==c&&(0,s.jsx)(l.FormField,{label:(0,s.jsx)(g,{content:"maxThreadsLimit"}),name:"maxThreadsLimit",children:({getValue:e,setValue:t,getName:i,isDisabled:n})=>(0,s.jsx)(l.InputNumber,{name:i(),value:e(),onChange:t,min:1,max:32,disabled:n()})}),(0,s.jsx)(l.FormFieldText,{label:(0,s.jsx)(g,{content:"tagTitle"}),description:(0,s.jsx)(g,{content:"tagDescription"}),name:"tag",size:"xl",inputProps:{maxLength:"50"}}),F&&null!==v&&(0,s.jsx)(l.FormFieldText,{label:(0,s.jsx)(g,{content:"alarmMessage"}),name:"alarmMessage",multiline:!0,size:"xl"})]}),F&&(0,s.jsx)(l.FormField,{label:(0,s.jsx)(g,{content:"languages"}),name:"languages",children:({getValue:e,setValue:t,getName:i,isDisabled:n})=>(0,s.jsx)(l.Select,{name:i(),multiple:!0,searchable:!0,value:e(),onChange:t,size:"xl",disabled:n(),children:S.map((({key:e,name:t})=>(0,s.jsx)(l.SelectOption,{value:e,children:t},e)))})}),F&&(0,s.jsx)(l.FormField,{label:(0,s.jsx)(g,{content:"locales"}),name:"locales",children:({getValue:e,setValue:t,getName:i,isDisabled:n})=>(0,s.jsx)(l.Select,{name:i(),multiple:!0,searchable:!0,value:e(),onChange:t,size:"xl",disabled:n(),children:j.map((({key:e,name:t})=>(0,s.jsx)(l.SelectOption,{value:e,children:t},e)))})})]})};x.propTypes={serverMail:d().shape({spamAssassin:d().shape({settings:d().shape({isEnabled:d().bool.isRequired,isUserSettingsEnabled:d().bool.isRequired,isUserSettingsAllowed:d().bool.isRequired,requiredHits:d().number.isRequired,maxMailLimit:d().number,maxThreadsLimit:d().number,maxChildren:d().number,maxChildrenLimit:d().number,tag:d().string.isRequired,alarmMessage:d().string,languages:d().array.isRequired,locales:d().array.isRequired,isGreylistingProtectionEnabled:d().bool})}).isRequired}).isRequired,capability:d().shape({mailServer:d().shape({isUserSettingsSupported:d().bool.isRequired}).isRequired,packages:d().shape({isSpamAssassinInstalled:d().bool.isRequired}).isRequired}).isRequired,os:d().shape({isWindows:d().bool}).isRequired};const v=x},2428:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>b});var s=i(596),n=i(286),a=i(89),o=i(1411),l=i(285),r=i(1120),d=i(628),c=i(536);const m=a.Locale.getTranslate("admin.components.lists.servermailblacklist"),u=a.Locale.getTranslate("components.buttons"),p=a.Locale.getSection("admin.components.lists.servermailblacklist"),g=r.gql` mutation DeleteBlackListedDomain($ids: [ID!]!) { deleteBlackListedDomain(input: { ids: $ids }) { ids } } `,h=({blackList:e,showDisabledWarning:t=!1,isWindows:s=!1,onAddDomain:a})=>{const[r,h]=(0,l.useState)([]),[b,x]=(0,l.useState)([]),v=(0,l.useMemo)((()=>e.filter((({id:e})=>r.includes(e)))),[e,r]),[S]=(0,d.useMutation)(g,{refetchQueries:[{query:i(1249)}],awaitRefetchQueries:!0});return(0,l.jsxs)(l.Fragment,{children:[t&&(0,l.jsx)(n.StatusMessage,{intent:"warning",children:(0,l.jsx)(m,{content:"spamAssassinDisabled"})}),(0,l.jsx)(o.default,{id:"server-mail-black-list",toolbar:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.ToolbarGroup,{title:p.lmsg("groupAdd"),children:(0,l.jsx)(n.Button,{id:"addBlackListedDomain",intent:"primary",icon:"plus",tooltip:(0,l.jsx)(m,{content:"buttonAddHint"}),"aria-label":p.lmsg("buttonAddHint"),onClick:a})}),(0,l.jsx)(n.ToolbarGroup,{title:p.lmsg("groupActions"),children:(0,l.jsx)(n.ListOperation,{critical:!0,noSelectionText:(0,l.jsx)(m,{content:"removeEmptySelection"}),confirmationText:p.formatMessage("removeConfirmation",{name:(0,l.jsx)("b",{children:v[0]?.name}),count:v.length}),actionButtonText:(0,l.jsx)(u,{content:"yesRemove"}),cancelButtonText:(0,l.jsx)(u,{content:"cancel"}),children:(0,l.jsx)(n.Button,{id:"removeBlackListedDomain",onClick:async()=>{x(r);try{const{data:{deleteBlackListedDomain:{ids:e}}}=await S({variables:{ids:r}});e.length>0&&(0,c.addToast)({intent:"success",message:(0,l.jsx)(m,{content:"removeSuccess"})})}catch({graphQLErrors:e}){e.forEach((({message:e,debugMessage:t})=>{(0,c.addToast)({intent:"danger",message:t||e})}))}finally{h([]),x([])}},children:(0,l.jsx)(m,{content:"buttonRemove"})})})})]}),columns:[{key:"name",title:(0,l.jsx)(m,{content:"entries"}),type:"title",sortable:!0},s&&{key:"action",title:(0,l.jsx)(m,{content:"action"}),sortable:!0,render:({action:e})=>p.lmsg(`${e.toLowerCase()}Action`)}].filter(Boolean),rowKey:"id",data:e,searchField:"name",selection:r,onSelectionChange:e=>h(e),loadingRows:b,emptyView:(0,l.jsx)(n.ListEmptyView,{actions:(0,l.jsx)(n.Button,{id:"addBlackListedDomain",intent:"primary",tooltip:(0,l.jsx)(m,{content:"buttonAddHint"}),onClick:a,children:(0,l.jsx)(m,{content:"buttonAdd"})})})})]})};h.propTypes={blackList:s.PropTypes.array.isRequired,showDisabledWarning:s.PropTypes.bool,isWindows:s.PropTypes.bool,onAddDomain:s.PropTypes.func.isRequired};const b=h},2431:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>b});var s=i(596),n=i(286),a=i(89),o=i(1411),l=i(285),r=i(1120),d=i(628),c=i(536);const m=a.Locale.getTranslate("admin.components.lists.servermailwhitelist"),u=a.Locale.getTranslate("components.buttons"),p=a.Locale.getSection("admin.components.lists.servermailwhitelist"),g=r.gql` mutation DeleteWhiteListedNetwork($ids: [ID!]!) { deleteWhiteListedNetwork(input: { ids: $ids }) { ids } } `,h=({whiteList:e,outgoingMessages:t,relay:s,isWindows:a=!1,onAddNetwork:r})=>{const[h,b]=(0,l.useState)([]),[x,v]=(0,l.useState)([]),S=(0,l.useMemo)((()=>e.filter((({id:e})=>h.includes(e)))),[e,h]),j=(0,l.useMemo)((()=>S.filter((({name:e})=>{if(a)return!1;const[t,i]=e.split("/");return"127"===t.substring(0,3)&&+i>=8})).map((({name:e})=>e))),[S,a]),[y]=(0,d.useMutation)(g,{refetchQueries:[{query:i(1250)}],awaitRefetchQueries:!0});return(0,l.jsxs)(l.Fragment,{children:[t?.isEnabled&&0!==(s?.noRelayNetworks??[]).length&&(0,l.jsx)(n.StatusMessage,{intent:"warning",children:(0,l.jsx)(m,{content:"whiteListNotEmpty"})}),(0,l.jsx)(o.default,{id:"server-mail-white-list",toolbar:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.ToolbarGroup,{title:p.lmsg("groupAdd"),children:(0,l.jsx)(n.Button,{id:"addWhiteListedNetwork",intent:"primary",icon:"plus",tooltip:(0,l.jsx)(m,{content:"buttonAddHint"}),"aria-label":p.lmsg("buttonAddHint"),onClick:r})}),(0,l.jsx)(n.ToolbarGroup,{title:p.lmsg("groupActions"),children:(0,l.jsx)(n.ListOperation,{critical:!0,noSelectionText:(0,l.jsx)(m,{content:"removeEmptySelection"}),confirmationText:(0,l.jsxs)(l.Fragment,{children:[j.length?(0,l.jsx)(n.StatusMessage,{intent:"warning",children:p.formatMessage(1===S.length?"webmailAffectedSingle":"webmailAffected",{count:j.length,list:j.join(", ")})}):null,p.formatMessage("removeConfirmation",{name:(0,l.jsx)("b",{children:S[0]?.name}),count:S.length})]}),actionButtonText:(0,l.jsx)(u,{content:"yesRemove"}),cancelButtonText:(0,l.jsx)(u,{content:"cancel"}),children:(0,l.jsx)(n.Button,{id:"removeWhiteListedNetwork",onClick:async()=>{v(h);try{const{data:{deleteWhiteListedNetwork:{ids:e}}}=await y({variables:{ids:h}});e.length>0&&(0,c.addToast)({intent:"success",message:(0,l.jsx)(m,{content:"removeSuccess"})})}catch({graphQLErrors:e}){e.forEach((({message:e,debugMessage:t})=>{(0,c.addToast)({intent:"danger",message:t||e})}))}finally{b([]),v([])}},children:(0,l.jsx)(m,{content:"buttonRemove"})})})})]}),columns:[{key:"name",title:(0,l.jsx)(m,{content:"entries"}),type:"title",sortable:!0}],rowKey:"id",data:e,searchField:"name",selection:h,onSelectionChange:e=>b(e),loadingRows:x,emptyView:(0,l.jsx)(n.ListEmptyView,{actions:(0,l.jsx)(n.Button,{id:"addWhiteListedNetwork",intent:"primary",tooltip:(0,l.jsx)(m,{content:"buttonAddHint"}),onClick:r,children:(0,l.jsx)(m,{content:"buttonAdd"})})})})]})};h.propTypes={whiteList:s.PropTypes.array.isRequired,outgoingMessages:s.PropTypes.shape({isEnabled:s.PropTypes.bool}),relay:s.PropTypes.shape({noRelayNetworks:s.PropTypes.array}),isWindows:s.PropTypes.bool,onAddNetwork:s.PropTypes.func.isRequired};const b=h},2433:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>g});var s=i(285),n=i(89),a=i(286),o=i(335),l=i(603),r=i(2434),d=i(2426),c=i(586),m=i(1251),u=i.n(m);const p=(0,s.lazy)((()=>Promise.all([i.e("vendors"),i.e("components/common/ServerMailAntivirusPromo")]).then(i.bind(i,3065)))),g=(0,l.withPageLayout)((0,d.withServerMailTabs)((()=>{const{data:e}=(0,c.useQuery)(u()),{serverMail:t}=e;return t.antivirus.length<=1&&!t.antivirusPolicy?(0,s.jsx)(s.Suspense,{fallback:(0,s.jsx)(a.Skeleton,{height:100}),children:(0,s.jsx)(p,{})}):(0,s.jsx)(r.default,{...e})})),(()=>{const{showFrames:e,pageHeader:t,pageSidebar:i}=(0,o.default)();return{showFrames:e,pageHeader:{...t,helpMenu:{...t.helpMenu,helpContext:"mail_antivirus"}},pageSidebar:i,pageContentHeader:{breadcrumbs:[i.isPowerUserPanel?null:{title:n.Locale.getSection("components.pages.home").lmsg("title"),href:"/admin/home"},{title:n.Locale.getSection("admin.controllers.server.tools").lmsg("title"),href:"/admin/server/tools"},{title:n.Locale.getSection("admin.controllers.mail-settings.index").lmsg("title"),href:"/cp/server/mail"},{title:n.Locale.getSection("components.pages.server-mail-antivirus").lmsg("title"),href:"/cp/server/mail/antivirus"}].filter(Boolean),tabs:[],tabsHasRootPage:!0}}}))},2427:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>p});var s=i(285),n=i(89),a=i(335),o=i(603),l=i(2428),r=i(2429),d=i(2426),c=i(586),m=i(1249),u=i.n(m);const p=(0,o.withPageLayout)((0,d.withServerMailTabs)((()=>{const[e,t]=(0,s.useState)(!1),{data:{serverMail:{blackList:i,spamAssassin:{settings:n}},os:{isWindows:a}}}=(0,c.useQuery)(u());return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.default,{isWindows:a,isOpen:e,onClose:()=>t(!1)}),(0,s.jsx)(l.default,{isWindows:a,blackList:i,showDisabledWarning:a&&n&&!n.isEnabled,onAddDomain:()=>t(!0)})]})})),(()=>{const{showFrames:e,pageHeader:t,pageSidebar:i}=(0,a.default)();return{showFrames:e,pageHeader:{...t,helpMenu:{...t.helpMenu,helpContext:"mail_blocked_domains"}},pageSidebar:i,pageContentHeader:{breadcrumbs:[i.isPowerUserPanel?null:{title:n.Locale.getSection("components.pages.home").lmsg("title"),href:"/admin/home"},{title:n.Locale.getSection("admin.controllers.server.tools").lmsg("title"),href:"/admin/server/tools"},{title:n.Locale.getSection("admin.controllers.mail-settings.index").lmsg("title"),href:"/cp/server/mail"},{title:n.Locale.getSection("components.pages.server-mail-black-list").lmsg("title"),href:"/cp/server/mail/black-list"}].filter(Boolean),tabs:[],tabsHasRootPage:!0}}}))},2415:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>u});var s=i(89),n=i(335),a=i(603),o=i(2416),l=i(2426),r=i(586),d=i(1247),c=i.n(d),m=i(285);const u=(0,a.withPageLayout)((0,l.withServerMailTabs)((()=>{const{data:e}=(0,r.useQuery)(c());return(0,m.jsx)(o.default,{...e})})),(()=>{const{showFrames:e,pageHeader:t,pageSidebar:i}=(0,n.default)();return{showFrames:e,pageHeader:{...t,helpMenu:{...t.helpMenu,helpContext:"mail"}},pageSidebar:i,pageContentHeader:{breadcrumbs:[i.isPowerUserPanel?null:{title:s.Locale.getSection("components.pages.home").lmsg("title"),href:"/admin/home"},{title:s.Locale.getSection("admin.controllers.server.tools").lmsg("title"),href:"/admin/server/tools"},{title:s.Locale.getSection("admin.controllers.mail-settings.index").lmsg("title"),href:"/cp/server/mail"},{title:s.Locale.getSection("components.pages.server-mail-settings").lmsg("title"),url:"/cp/server/mail/settings"}].filter(Boolean),tabs:[],tabsHasRootPage:!0}}}))},2447:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>u});var s=i(89),n=i(335),a=i(603),o=i(2426),l=i(2448),r=i(586),d=i(1254),c=i.n(d),m=i(285);const u=(0,a.withPageLayout)((0,o.withServerMailTabs)((()=>{const{data:e}=(0,r.useQuery)(c());return(0,m.jsx)(l.default,{...e})})),(()=>{const{showFrames:e,pageHeader:t,pageSidebar:i}=(0,n.default)();return{showFrames:e,pageHeader:{...t,helpMenu:{...t.helpMenu,helpContext:"mail_smarthost"}},pageSidebar:i,pageContentHeader:{breadcrumbs:[i.isPowerUserPanel?null:{title:s.Locale.getSection("components.pages.home").lmsg("title"),href:"/admin/home"},{title:s.Locale.getSection("admin.controllers.server.tools").lmsg("title"),href:"/admin/server/tools"},{title:s.Locale.getSection("admin.controllers.mail-settings.index").lmsg("title"),href:"/cp/server/mail"},{title:s.Locale.getSection("components.pages.server-mail-smarthost").lmsg("title"),href:"/cp/server/mail/smarthost"}].filter(Boolean),tabs:[],tabsHasRootPage:!0}}}))},2435:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>u});var s=i(89),n=i(335),a=i(603),o=i(2436),l=i(2426),r=i(586),d=i(1252),c=i.n(d),m=i(285);const u=(0,a.withPageLayout)((0,l.withServerMailTabs)((()=>{const{data:e}=(0,r.useQuery)(c());return(0,m.jsx)(o.default,{...e})})),(()=>{const{showFrames:e,pageHeader:t,pageSidebar:i}=(0,n.default)();return{showFrames:e,pageHeader:{...t,helpMenu:{...t.helpMenu,helpContext:"spamassassin"}},pageSidebar:i,pageContentHeader:{breadcrumbs:[i.isPowerUserPanel?null:{title:s.Locale.getSection("components.pages.home").lmsg("title"),href:"/admin/home"},{title:s.Locale.getSection("admin.controllers.server.tools").lmsg("title"),href:"/admin/server/tools"},{title:s.Locale.getSection("admin.controllers.mail-settings.index").lmsg("title"),href:"/cp/server/mail"},{title:s.Locale.getSection("components.pages.server-mail-spam-filter").lmsg("title"),href:"/cp/server/mail/spam-filter"}].filter(Boolean),tabs:[],tabsHasRootPage:!0}}}))},2438:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ServerMailStatisticsPage:()=>p,default:()=>g});var s=i(285),n=i(579),a=i(603),o=i(335),l=i(89),r=i(2426),d=(i(2439),i(2440)),c=i(2442),m=i(2443),u=i(2445);const p=()=>{const[e,t]=(0,s.useState)((()=>(0,c.getDatesFromPeriod)(c.PERIOD_KEYS.TODAY))),[i,a]=(0,s.useState)(c.PERIOD_KEYS.TODAY),[o,l]=(0,n.useSearchParams)(),r=o.get("statisticsType")??c.STATISTIC_TYPE_KEYS.SPAM,p=e=>{o.set("statisticsType",e),l(o)};return(0,s.jsxs)(s.Fragment,{children:[r===c.STATISTIC_TYPE_KEYS.SPAM&&(0,s.jsx)(d.ServerMailStatisticsSpamRecipientsList,{dateValues:e,setDateValues:t,currentPeriod:i,setPeriod:a,statisticsType:r,setStatisticsType:p}),r===c.STATISTIC_TYPE_KEYS.VIRUS_RECIPIENTS&&(0,s.jsx)(m.ServerMailStatisticsVirusRecipientsList,{dateValues:e,setDateValues:t,currentPeriod:i,setPeriod:a,statisticsType:r,setStatisticsType:p}),r===c.STATISTIC_TYPE_KEYS.VIRUS_VIRUSES&&(0,s.jsx)(u.ServerMailStatisticsVirusVirusesList,{dateValues:e,setDateValues:t,currentPeriod:i,setPeriod:a,statisticsType:r,setStatisticsType:p})]})},g=(0,a.withPageLayout)((0,r.withServerMailTabs)(p),(()=>{const{showFrames:e,pageHeader:t,pageSidebar:i}=(0,o.default)();return{showFrames:e,pageHeader:{...t,helpMenu:{...t.helpMenu,helpContext:"server.mail.statistics"}},pageSidebar:i,pageContentHeader:{breadcrumbs:[i.isPowerUserPanel?null:{title:l.Locale.getSection("components.pages.home").lmsg("title"),href:"/admin/home"},{title:l.Locale.getSection("admin.controllers.server.tools").lmsg("title"),href:"/admin/server/tools"},{title:l.Locale.getSection("admin.controllers.mail-settings.index").lmsg("title"),href:"/cp/server/mail"},{title:l.Locale.getSection("components.pages.server-mail-statistics").lmsg("title"),url:"/cp/server/mail/statistics"}].filter(Boolean),tabs:[],tabsHasRootPage:!0}}}))},2440:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ServerMailStatisticsSpamRecipientsList:()=>S});var s=i(286),n=i(612),a=i(596),o=i.n(a),l=i(285),r=i(620),d=i(586),c=i(583),m=i(89),u=i(1253),p=i.n(u),g=(i(2439),i(2441)),h=i(2412),b=i(2442);const x=m.Locale.getTranslate("admin.components.lists.serverMailStatistics.SpamRecipients"),v=[{key:"email",title:(0,l.jsx)(x,{content:"email"}),sortable:!0},{key:"count",title:(0,l.jsx)(x,{content:"count"}),align:"right",sortable:!0},{key:"ratio",title:(0,l.jsx)(x,{content:"ratio"}),render:({ratio:e})=>(0,l.jsxs)("div",{className:"server-mail-statistics-page-progressbar-container",children:[(0,l.jsx)("span",{children:`${(100*e).toFixed(2)}%`}),(0,l.jsx)(s.ProgressBar,{className:"server-mail-statistics-page-stats-progressbar",progress:100*e})]})}],S=({dateValues:e,...t})=>{const[i,a]=(0,l.useState)({pagination:{page:0,itemsPerPage:25},orderBy:{email:"DESC"}}),o=(0,l.useMemo)((()=>({...i,from:(0,c.toPhpDate)((0,c.getStartOfDay)((0,h.getTimestampFromDateSelector)(e.from)).getTime()),to:(0,c.toPhpDate)((0,c.getEndOfDay)((0,h.getTimestampFromDateSelector)(e.to)).getTime())})),[i,e]),m=(0,n.useDebounce)(o,300),{data:{emailStatistics:{spamSummary:u,spamRecipients:x}={}}={},loading:S,refetch:j}=(0,d.useQuery)(p(),{variables:m}),y=Object.keys(i.orderBy)[0],f=Math.ceil((x?.totalRows??0)/i.pagination.itemsPerPage),{renderPagination:k,sortParams:T,handleReload:F}=(0,r.useList)({onReload:j,pagination:{current:i.pagination.page,totalPage:f,itemsPerPage:i.pagination.itemsPerPage,onPageChange(e){a((t=>({...t,pagination:{...t.pagination,page:e-1}})))},onChangeItemsPerPage(e){a((t=>({...t,pagination:{...t.pagination,itemsPerPage:e}})))}},sort:{direction:i.orderBy[y],column:y,onChange({sortColumn:e,sortDirection:t}){a((i=>({...i,orderBy:{[e]:t}})))}}});return(0,l.jsxs)("div",{children:[(0,l.jsx)(b.ServerMailStatisticsToolbar,{...t,dateValues:e,onRefresh:F}),(0,l.jsx)(g.ServerMailStatisticsSummary,{cleanCount:u?.clean,infectedCount:u?.infected,protectedCount:u?.protected,skippedCount:u?.skipped}),(0,l.jsx)(s.List,{loading:S,totalRows:x?.totalRows,pagination:k(),...T,data:x?.rows??[],columns:v})]})};S.propTypes={dateValues:o().object.isRequired,setDateValues:o().func.isRequired,currentPeriod:o().string.isRequired,setPeriod:o().func.isRequired,statisticsType:o().string.isRequired,setStatisticsType:o().func.isRequired}},2441:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ServerMailStatisticsSummary:()=>c});var s=i(286),n=i(596),a=i.n(n),o=i(89),l=(i(2439),i(285));const r=o.Locale.getSection("admin.components.lists.serverMailStatistics.summary"),d=({value:e=null,title:t})=>(0,l.jsx)(s.Panel,{title:t,children:(0,l.jsx)("div",{className:"server-mail-statistics-page-stats-container",children:"number"==typeof e?(0,l.jsxs)(s.Heading,{level:2,children:[e," "]}):(0,l.jsx)(s.ContentLoader,{})})});d.propTypes={value:a().number,title:a().string.isRequired};const c=({cleanCount:e,infectedCount:t,protectedCount:i,skippedCount:n}={})=>(0,l.jsxs)(s.Grid,{sm:4,gap:"lg",children:[(0,l.jsx)(s.GridCol,{children:(0,l.jsx)(d,{value:e,title:r.lmsg("cleanTitle")})}),(0,l.jsx)(s.GridCol,{children:(0,l.jsx)(d,{value:t,title:r.lmsg("infectedTitle")})}),(0,l.jsx)(s.GridCol,{children:(0,l.jsx)(d,{value:i,title:r.lmsg("protectedTitle")})}),(0,l.jsx)(s.GridCol,{children:(0,l.jsx)(d,{value:n,title:r.lmsg("skippedTitle")})})]});c.propTypes={cleanCount:a().number,infectedCount:a().number,protectedCount:a().number,skippedCount:a().number}},2442:(e,t,i)=>{"use strict";i.r(t),i.d(t,{PERIOD_KEYS:()=>b,STATISTIC_TYPE_KEYS:()=>v,ServerMailStatisticsToolbar:()=>j,getDatesFromPeriod:()=>S});var s=i(1120),n=i(628),a=i(286),o=i(536),l=i(596),r=i.n(l),d=i(2412),c=i(1289),m=i(583),u=i(89),p=(i(2439),i(285));const g=u.Locale.getSection("admin.components.lists.serverMailStatistics"),h=s.gql` mutation ReloadEmailStatistics { reloadEmailStatistics { success message } } `,b={TODAY:"today",YESTERDAY:"yesterday",LAST_WEEK:"lastWeek",PREV_WEEK:"prevWeek",LAST_MONTH:"lastMonth",PREV_MONTH:"prevMonth",ALL:"all",CUSTOM:"custom"},x=Object.values(b),v={SPAM:"spam",VIRUS_RECIPIENTS:"virusRecipients",VIRUS_VIRUSES:"viruses"},S=e=>{let t=new Date,i=new Date;switch(e){case b.YESTERDAY:t=(0,m.addDays)(-1),i=(0,m.addDays)(-1);break;case b.LAST_WEEK:t=(0,m.getStartOfWeek)(Date.now()),i=(0,m.getEndOfWeek)(Date.now());break;case b.PREV_WEEK:t=(0,m.getStartOfWeek)((0,m.addDays)(-7)),i=(0,m.getEndOfWeek)((0,m.addDays)(-7));break;case b.LAST_MONTH:t=(0,m.getStartOfMonth)((0,m.addDays)(-7));break;case b.PREV_MONTH:{const e=(0,m.getDaysInPreviousMonth)(Date.now());t=(0,m.getStartOfMonth)((0,m.addDays)(-e)),i=(0,m.getEndOfMonth)((0,m.addDays)(-e));break}case b.ALL:t=new Date(0)}return{from:{day:t.getDate(),month:t.getMonth()+1,year:t.getFullYear()},to:{day:i.getDate(),month:i.getMonth()+1,year:i.getFullYear()}}},j=({dateValues:e,setDateValues:t,currentPeriod:i,setPeriod:s,statisticsType:l,setStatisticsType:r,onRefresh:m})=>{const[u]=(0,n.useMutation)(h,{onCompleted:({reloadEmailStatistics:{success:e}})=>{(0,o.addToast)({intent:e?"success":"danger",message:e?g.lmsg("statisticsRefreshed"):g.lmsg("statisticsRefreshFailed")}),m()}});return(0,p.jsxs)(a.Toolbar,{children:[(0,p.jsx)(a.ToolbarGroup,{children:(0,p.jsx)(a.Button,{"data-testid":"refresh-button",onClick:()=>u(),children:g.lmsg("refresh")})}),(0,p.jsx)(a.ToolbarGroup,{groupable:!1,children:(0,p.jsxs)(a.Select,{size:"md",value:l,onChange:r,children:[(0,p.jsx)(a.SelectOptionGroup,{label:g.lmsg("statisticsTypeSpamCategory"),children:(0,p.jsx)(a.SelectOption,{value:v.SPAM,children:g.lmsg("statisticsTypeSpam")})}),(0,p.jsxs)(a.SelectOptionGroup,{label:g.lmsg("statisticsTypeVirusesCategory"),children:[(0,p.jsx)(a.SelectOption,{value:v.VIRUS_RECIPIENTS,children:g.lmsg("statisticsTypeVirusRecipients")}),(0,p.jsx)(a.SelectOption,{value:v.VIRUS_VIRUSES,children:g.lmsg("statisticsTypeVirusViruses")})]})]})}),(0,p.jsx)(a.ToolbarExpander,{}),(0,p.jsxs)(a.ToolbarGroup,{groupable:!1,children:[(0,p.jsx)(a.Select,{size:"md",value:i,onChange:e=>{s(e),e!==b.CUSTOM&&t(S(e))},children:x.map((e=>(0,p.jsx)(a.SelectOption,{value:e,children:g.lmsg(`period.${e}`)},e)))}),"custom"===i&&(0,p.jsx)(c.default,{values:e,applyButton:!1,cancelButton:!1,submitButton:!1,onFieldChange:(i,s)=>t((0,a.setIn)(e,i,s)),vertical:!1,footerClassName:"server-mail-statistics-page-footer",children:(0,p.jsxs)("div",{className:"server-mail-statistics-page-form-container",children:[(0,p.jsx)(d.default,{name:"from",label:null})," - ",(0,p.jsx)(d.default,{name:"to",label:null})]})})]})]})};j.propTypes={dateValues:r().object.isRequired,setDateValues:r().func.isRequired,currentPeriod:r().string.isRequired,setPeriod:r().func.isRequired,statisticsType:r().string.isRequired,setStatisticsType:r().func.isRequired,onRefresh:r().func.isRequired}},2443:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ServerMailStatisticsVirusRecipientsList:()=>S});var s=i(286),n=i(612),a=i(596),o=i.n(a),l=i(285),r=i(620),d=i(586),c=i(583),m=i(89),u=i(2444),p=i.n(u),g=(i(2439),i(2441)),h=i(2412),b=i(2442);const x=m.Locale.getTranslate("admin.components.lists.serverMailStatistics.VirusRecipients"),v=[{key:"email",title:(0,l.jsx)(x,{content:"email"}),sortable:!0},{key:"count",title:(0,l.jsx)(x,{content:"count"}),align:"right",sortable:!0},{key:"ratio",title:(0,l.jsx)(x,{content:"ratio"}),render:({ratio:e})=>(0,l.jsxs)("div",{className:"server-mail-statistics-page-progressbar-container",children:[(0,l.jsx)("span",{children:`${(100*e).toFixed(2)}%`}),(0,l.jsx)(s.ProgressBar,{className:"server-mail-statistics-page-stats-progressbar",progress:100*e})]})}],S=({dateValues:e,...t})=>{const[i,a]=(0,l.useState)({pagination:{page:0,itemsPerPage:25},orderBy:{email:"DESC"}}),o=(0,l.useMemo)((()=>({...i,from:(0,c.toPhpDate)((0,c.getStartOfDay)((0,h.getTimestampFromDateSelector)(e.from)).getTime()),to:(0,c.toPhpDate)((0,c.getEndOfDay)((0,h.getTimestampFromDateSelector)(e.to)).getTime())})),[i,e]),m=(0,n.useDebounce)(o,300),{data:{emailStatistics:{virusSummary:u,virusRecipients:x}={}}={},loading:S,refetch:j}=(0,d.useQuery)(p(),{variables:m}),y=Object.keys(i.orderBy)[0],f=Math.ceil((x?.totalRows??0)/i.pagination.itemsPerPage),{renderPagination:k,sortParams:T,handleReload:F}=(0,r.useList)({onReload:j,pagination:{current:i.pagination.page,totalPage:f,itemsPerPage:i.pagination.itemsPerPage,onPageChange(e){a((t=>({...t,pagination:{...t.pagination,page:e-1}})))},onChangeItemsPerPage(e){a((t=>({...t,pagination:{...t.pagination,itemsPerPage:e}})))}},sort:{direction:i.orderBy[y],column:y,onChange({sortColumn:e,sortDirection:t}){a((i=>({...i,orderBy:{[e]:t}})))}}});return(0,l.jsxs)("div",{children:[(0,l.jsx)(b.ServerMailStatisticsToolbar,{...t,dateValues:e,onRefresh:F}),(0,l.jsx)(g.ServerMailStatisticsSummary,{cleanCount:u?.clean,infectedCount:u?.infected,protectedCount:u?.protected,skippedCount:u?.skipped}),(0,l.jsx)(s.List,{loading:S,totalRows:x?.totalRows,pagination:k(),...T,data:x?.rows??[],columns:v})]})};S.propTypes={dateValues:o().object.isRequired,setDateValues:o().func.isRequired,currentPeriod:o().string.isRequired,setPeriod:o().func.isRequired,statisticsType:o().string.isRequired,setStatisticsType:o().func.isRequired}},2445:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ServerMailStatisticsVirusVirusesList:()=>S});var s=i(286),n=i(612),a=i(596),o=i.n(a),l=i(285),r=i(620),d=i(586),c=i(583),m=i(89),u=i(2446),p=i.n(u),g=(i(2439),i(2441)),h=i(2412),b=i(2442);const x=m.Locale.getTranslate("admin.components.lists.serverMailStatistics.VirusViruses"),v=[{key:"name",title:(0,l.jsx)(x,{content:"name"}),sortable:!0},{key:"count",title:(0,l.jsx)(x,{content:"count"}),align:"right",sortable:!0},{key:"ratio",title:(0,l.jsx)(x,{content:"ratio"}),render:({ratio:e})=>(0,l.jsxs)("div",{className:"server-mail-statistics-page-progressbar-container",children:[(0,l.jsx)("span",{children:`${(100*e).toFixed(2)}%`}),(0,l.jsx)(s.ProgressBar,{className:"server-mail-statistics-page-stats-progressbar",progress:100*e})]})}],S=({dateValues:e,...t})=>{const[i,a]=(0,l.useState)({pagination:{page:0,itemsPerPage:25},orderBy:{name:"DESC"}}),o=(0,l.useMemo)((()=>({...i,from:(0,c.toPhpDate)((0,c.getStartOfDay)((0,h.getTimestampFromDateSelector)(e.from)).getTime()),to:(0,c.toPhpDate)((0,c.getEndOfDay)((0,h.getTimestampFromDateSelector)(e.to)).getTime())})),[i,e]),m=(0,n.useDebounce)(o,300),{data:{emailStatistics:{virusSummary:u,viruses:x}={}}={},loading:S,refetch:j}=(0,d.useQuery)(p(),{variables:m}),y=Object.keys(i.orderBy)[0],f=Math.ceil((x?.totalRows??0)/i.pagination.itemsPerPage),{renderPagination:k,sortParams:T,handleReload:F}=(0,r.useList)({onReload:j,pagination:{current:i.pagination.page,totalPage:f,itemsPerPage:i.pagination.itemsPerPage,onPageChange(e){a((t=>({...t,pagination:{...t.pagination,page:e-1}})))},onChangeItemsPerPage(e){a((t=>({...t,pagination:{...t.pagination,itemsPerPage:e}})))}},sort:{direction:i.orderBy[y],column:y,onChange({sortColumn:e,sortDirection:t}){a((i=>({...i,orderBy:{[e]:t}})))}}});return(0,l.jsxs)("div",{children:[(0,l.jsx)(b.ServerMailStatisticsToolbar,{...t,dateValues:e,onRefresh:F}),(0,l.jsx)(g.ServerMailStatisticsSummary,{cleanCount:u?.clean,infectedCount:u?.infected,protectedCount:u?.protected,skippedCount:u?.skipped}),(0,l.jsx)(s.List,{loading:S,totalRows:x?.totalRows,pagination:k(),...T,data:x?.rows??[],columns:v})]})};S.propTypes={dateValues:o().object.isRequired,setDateValues:o().func.isRequired,currentPeriod:o().string.isRequired,setPeriod:o().func.isRequired,statisticsType:o().string.isRequired,setStatisticsType:o().func.isRequired}},2437:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>s.default});var s=i(2438)},2430:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>p});var s=i(285),n=i(89),a=i(335),o=i(603),l=i(2431),r=i(2432),d=i(2426),c=i(586),m=i(1250),u=i.n(m);const p=(0,o.withPageLayout)((0,d.withServerMailTabs)((()=>{const[e,t]=(0,s.useState)(!1),{data:{serverMail:i,os:{isWindows:n},capability:a}}=(0,c.useQuery)(u());return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.default,{...a,isWindows:n,isOpen:e,onClose:()=>t(!1)}),(0,s.jsx)(l.default,{...i,isWindows:n,onAddNetwork:()=>t(!0)})]})})),(()=>{const{showFrames:e,pageHeader:t,pageSidebar:i}=(0,a.default)();return{showFrames:e,pageHeader:{...t,helpMenu:{...t.helpMenu,helpContext:"mail_white_list"}},pageSidebar:i,pageContentHeader:{breadcrumbs:[i.isPowerUserPanel?null:{title:n.Locale.getSection("components.pages.home").lmsg("title"),href:"/admin/home"},{title:n.Locale.getSection("admin.controllers.server.tools").lmsg("title"),href:"/admin/server/tools"},{title:n.Locale.getSection("admin.controllers.mail-settings.index").lmsg("title"),href:"/cp/server/mail"},{title:n.Locale.getSection("components.pages.server-mail-white-list").lmsg("title"),href:"/cp/server/mail/white-list"}].filter(Boolean),tabs:[],tabsHasRootPage:!0}}}))},2426:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>g,withServerMailTabs:()=>p});var s=i(285),n=i(580),a=i(581),o=i(586),l=i(286),r=i(89),d=i(625),c=i(1248),m=i.n(c);const u=()=>{const{pathname:e}=(0,n.useLocation)(),t=(0,d.default)(),{data:{viewer:{permissions:{manageServerMail:i,manageServerVirusProtection:c,manageServerSpamFilter:u,manageServerMailAutodiscover:p,manageServerMailBlackWhiteLists:g}},capability:{mailServer:{isDomainsBlacklistSupported:h,isSmtpWhiteListSupported:b,isSmarthostAvailable:x,isLocal:v},packages:{isAntiVirusInstalled:S,isSpamAssassinInstalled:j}},os:{isWindows:y},primaryKey:{keyDrWeb:f,keyQmailQueue:k}}}=(0,o.useQuery)(m()),T=(0,s.useMemo)((()=>[(i||u||p)&&{title:r.Locale.getSection("components.pages.server-mail-settings").lmsg("title"),url:"/cp/server/mail/settings",id:"tabSettings"},y&&u&&j&&{title:r.Locale.getSection("components.pages.server-mail-spam-filter").lmsg("title"),url:"/cp/server/mail/spam-filter",id:"tabSpamFilter"},v&&c&&{title:r.Locale.getSection("components.pages.server-mail-antivirus").lmsg("title"),url:"/cp/server/mail/antivirus",id:"tabAntivirus"},g&&h&&{title:r.Locale.getSection("components.pages.server-mail-black-list").lmsg("title"),url:"/cp/server/mail/black-list",id:"tabBlackList"},g&&(!y||j||b)&&{title:r.Locale.getSection("components.pages.server-mail-white-list").lmsg("title"),url:"/cp/server/mail/white-list",id:"tabWhiteList"},!y&&i&&k&&{title:r.Locale.getSection("components.pages.server-mail-queue").lmsg("title"),url:"/admin/mail-settings/queue",id:"tabQueue"},y&&i&&(u&&j||c&&S&&f)&&{title:r.Locale.getSection("components.pages.server-mail-statistics").lmsg("title"),url:"/cp/server/mail/statistics/",id:"tabStatisticsNew"},x&&{title:r.Locale.getSection("components.pages.server-mail-smarthost").lmsg("title"),url:"/cp/server/mail/smarthost",id:"tabSmarthost"}].filter(Boolean)),[i,c,u,p,g,j,S,f,k,h,b,y,x,v]),F=(0,s.useMemo)((()=>T.findIndex((({url:t})=>(0,a.matchPath)(t,e)))+1),[T,e]);return(0,s.jsx)(l.Tabs,{active:F,children:T.map((({url:e,...i})=>(0,s.jsx)(l.Tab,{onActivate:()=>t(e),...i},e)))})},p=e=>{const t=t=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u,{}),(0,s.jsx)(e,{...t})]});return t.displayName=`withServerMailTabs(${e.displayName||e.name||"Component"})`,t.WrappedComponent=e,t},g=u},2444:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ServerMailVirusRecipientsStatistics"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"from"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"to"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"pagination"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"PaginationInput"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"orderBy"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"EmailStatisticsRecipientsSortingInput"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"emailStatistics"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"virusSummary"},arguments:[{kind:"Argument",name:{kind:"Name",value:"from"},value:{kind:"Variable",name:{kind:"Name",value:"from"}}},{kind:"Argument",name:{kind:"Name",value:"to"},value:{kind:"Variable",name:{kind:"Name",value:"to"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clean"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"infected"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"protected"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"skipped"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"virusRecipients"},arguments:[{kind:"Argument",name:{kind:"Name",value:"from"},value:{kind:"Variable",name:{kind:"Name",value:"from"}}},{kind:"Argument",name:{kind:"Name",value:"to"},value:{kind:"Variable",name:{kind:"Name",value:"to"}}},{kind:"Argument",name:{kind:"Name",value:"pagination"},value:{kind:"Variable",name:{kind:"Name",value:"pagination"}}},{kind:"Argument",name:{kind:"Name",value:"orderBy"},value:{kind:"Variable",name:{kind:"Name",value:"orderBy"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"rows"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"count"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"ratio"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"totalRows"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:559}};t.loc.source={body:"query ServerMailVirusRecipientsStatistics(\n $from: String!\n $to: String!\n $pagination: PaginationInput!\n $orderBy: EmailStatisticsRecipientsSortingInput!\n) {\n emailStatistics {\n virusSummary(from: $from, to: $to) {\n clean\n infected\n protected\n skipped\n }\n virusRecipients(from: $from, to: $to, pagination: $pagination, orderBy: $orderBy) {\n rows {\n email\n count\n ratio\n }\n totalRows\n }\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function i(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var s=e.type;"NamedType"===s.kind&&t.add(s.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){i(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){i(e,t)})),e.definitions&&e.definitions.forEach((function(e){i(e,t)}))}var s={};function n(e,t){for(var i=0;i<e.definitions.length;i++){var s=e.definitions[i];if(s.name&&s.name.value==t)return s}}t.definitions.forEach((function(e){if(e.name){var t=new Set;i(e,t),s[e.name.value]=t}})),e.exports=t,e.exports.ServerMailVirusRecipientsStatistics=function(e,t){var i={kind:e.kind,definitions:[n(e,t)]};e.hasOwnProperty("loc")&&(i.loc=e.loc);var a=s[t]||new Set,o=new Set,l=new Set;for(a.forEach((function(e){l.add(e)}));l.size>0;){var r=l;l=new Set,r.forEach((function(e){o.has(e)||(o.add(e),(s[e]||new Set).forEach((function(e){l.add(e)})))}))}return o.forEach((function(t){var s=n(e,t);s&&i.definitions.push(s)})),i}(t,"ServerMailVirusRecipientsStatistics")},2446:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ServerMailVirusVirusesStatistics"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"from"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"to"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"pagination"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"PaginationInput"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"orderBy"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"EmailStatisticsVirusesSortingInput"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"emailStatistics"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"virusSummary"},arguments:[{kind:"Argument",name:{kind:"Name",value:"from"},value:{kind:"Variable",name:{kind:"Name",value:"from"}}},{kind:"Argument",name:{kind:"Name",value:"to"},value:{kind:"Variable",name:{kind:"Name",value:"to"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"clean"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"infected"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"protected"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"skipped"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"viruses"},arguments:[{kind:"Argument",name:{kind:"Name",value:"from"},value:{kind:"Variable",name:{kind:"Name",value:"from"}}},{kind:"Argument",name:{kind:"Name",value:"to"},value:{kind:"Variable",name:{kind:"Name",value:"to"}}},{kind:"Argument",name:{kind:"Name",value:"pagination"},value:{kind:"Variable",name:{kind:"Name",value:"pagination"}}},{kind:"Argument",name:{kind:"Name",value:"orderBy"},value:{kind:"Variable",name:{kind:"Name",value:"orderBy"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"rows"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"count"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"ratio"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"totalRows"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:544}};t.loc.source={body:"query ServerMailVirusVirusesStatistics(\n $from: String!\n $to: String!\n $pagination: PaginationInput!\n $orderBy: EmailStatisticsVirusesSortingInput!\n) {\n emailStatistics {\n virusSummary(from: $from, to: $to) {\n clean\n infected\n protected\n skipped\n }\n viruses(from: $from, to: $to, pagination: $pagination, orderBy: $orderBy) {\n rows {\n name\n count\n ratio\n }\n totalRows\n }\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function i(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var s=e.type;"NamedType"===s.kind&&t.add(s.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){i(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){i(e,t)})),e.definitions&&e.definitions.forEach((function(e){i(e,t)}))}var s={};function n(e,t){for(var i=0;i<e.definitions.length;i++){var s=e.definitions[i];if(s.name&&s.name.value==t)return s}}t.definitions.forEach((function(e){if(e.name){var t=new Set;i(e,t),s[e.name.value]=t}})),e.exports=t,e.exports.ServerMailVirusVirusesStatistics=function(e,t){var i={kind:e.kind,definitions:[n(e,t)]};e.hasOwnProperty("loc")&&(i.loc=e.loc);var a=s[t]||new Set,o=new Set,l=new Set;for(a.forEach((function(e){l.add(e)}));l.size>0;){var r=l;l=new Set,r.forEach((function(e){o.has(e)||(o.add(e),(s[e]||new Set).forEach((function(e){l.add(e)})))}))}return o.forEach((function(t){var s=n(e,t);s&&i.definitions.push(s)})),i}(t,"ServerMailVirusVirusesStatistics")},2439:(e,t,i)=>{"use strict";i.r(t)}}]); //# sourceMappingURL=mail.js.map?e17a71aac330600325ac