"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/server/mail"],{1659:(e,t,s)=>{s.r(t),s.d(t,{SORT_ASC:()=>c,SORT_DESC:()=>u,default:()=>g});var i=s(231),n=s(233),a=s.n(n),l=s(232),o=s(85);const r=o.Locale.getTranslate("components.list"),d=o.Locale.getSection("components.list"),c="ASC",u="DESC",m="all",p=({data:e,columns:t,itemsPerPage:s,itemsPerPageOptions:n,sortColumn:a,sortDirection:o,searchField:u,searchPlaceholder:p,locale:g,emptyView:b,toolbar:x,selection:h,onSelectionChange:j,rowKey:v,...S})=>{const[y,f]=(0,i.useState)(1),[T,M]=(0,i.useState)(a??t.find((({sortable:e})=>e))?.key),[F,L]=(0,i.useState)(o),[w,R]=(0,i.useState)(s??n[0]),[k,E]=(0,i.useState)(""),I=(0,i.useMemo)((()=>u?e.filter((e=>(Array.isArray(u)?u:[u]).some((t=>e[t]&&String(e[t]).toLowerCase().includes(k.toLowerCase()))))):e),[e,k,u]),P=(0,i.useMemo)((()=>{if(!T)return I;const e=t.find((({key:e})=>e===T))?.sort??((e,t)=>e[T]<t[T]?-1:e[T]>t[T]?1:0);return[...I].sort(((t,s)=>c===F?e(t,s):e(s,t)))}),[I,T,F,t]),C=(0,i.useMemo)((()=>{if(w===m)return P;const e=w*(y-1),t=e+w;return P.slice(e,t)}),[y,P,w]),A=(0,i.useCallback)((e=>{E(e),e!==k&&f(1)}),[k]),D=(0,i.useCallback)((e=>{R(e);(e===m?1:Math.ceil(I.length/e))<y&&f(1)}),[I.length,y]);return(0,i.useEffect)((()=>{if("function"==typeof j&&h.length){const e=I.map((e=>{return t=e,"function"==typeof(s=v)?s(t):t[s];var t,s})).filter((e=>h.includes(e)));j(e)}}),[I]),(0,i.jsx)(l.List,{pagination:(0,i.jsx)(l.Pagination,{current:y,total:w===m?1:Math.ceil(I.length/w),onSelect:e=>f(e),itemsPerPage:w,itemsPerPageOptions:n,onItemsPerPageChange:D}),toolbar:(x||u)&&(0,i.jsxs)(l.Toolbar,{children:[x,u&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.ToolbarExpander,{}),(0,i.jsx)(l.ToolbarGroup,{title:"",children:(0,i.jsx)(l.SearchBar,{inputProps:{placeholder:p??d.lmsg("searchPlaceholder"),"data-testid":"list-searchbar"},onTyping:A})})]})]}),totalRows:I.length,sortColumn:T,sortDirection:F,onSortChange:({sortColumn:e,sortDirection:t})=>{M(e),L(t)},columns:t,data:C,filtered:!!k,locale:{totalRows:({totalRows:e})=>d.formatMessage("recordsTotal",{total:e}),...g},emptyView:k?(0,i.jsx)(l.ListEmptyView,{title:(0,i.jsx)(r,{content:"emptyViewFilteredTitle"}),description:(0,i.jsx)(r,{content:"emptyViewFilteredDescription"})}):b??(0,i.jsx)(l.ListEmptyView,{title:(0,i.jsx)(r,{content:"emptyViewTitle"})}),onSelectionChange:j,selection:h,rowKey:v,...S})};p.propTypes={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)]),searchPlaceholder:a().string,locale:a().object,emptyView:a().node,toolbar:a().node,onSelectionChange:a().func,selection:a().array,rowKey:a().oneOfType([a().string,a().func])},p.defaultProps={itemsPerPage:void 0,itemsPerPageOptions:[10,25,100,m],sortColumn:void 0,sortDirection:c,searchField:void 0,searchPlaceholder:void 0,locale:{},emptyView:void 0,toolbar:void 0,onSelectionChange:void 0,selection:[],rowKey:"key"};const g=p},1805:(e,t,s)=>{s.r(t),s.d(t,{default:()=>g});var i=s(233),n=s(232),a=s(85),l=s(231),o=s(283),r=s(389),d=s(756);const c=a.Locale.getTranslate("admin.components.forms.server-mail-black-list"),u=a.Locale.getTranslate("components.buttons"),m=o.gql`
    mutation AddBlackListedDomain($input: AddServerMailListItemInput!) {
        addBlackListedDomain(input: $input) {
            errors
        }
    }
`,p=({isWindows:e,isOpen:t,onClose:i})=>{const[a,o]=(0,l.useState)(null),[p,g]=(0,l.useState)(null),[b,x]=(0,l.useState)({});(0,l.useEffect)((()=>{o({name:[""],action:e?"DELETE":null}),g(null),x({})}),[t,e]);const[h]=(0,r.useMutation)(m,{refetchQueries:[{query:s(729)}],awaitRefetchQueries:!0});return(0,l.jsxs)(n.Drawer,{"data-type":"add-black-listed-domain",title:(0,l.jsx)(c,{content:"title"}),isOpen:t,onClose:i,size:"sm",form:{state:p,errors:b,applyButton:!1,onSubmit:async({name:e,action:t})=>{g("submit"),x({});const{data:{addBlackListedDomain:{errors:s}}}=await h({variables:{input:{name:e.map((e=>(e??"").trim())),action:t}}});g(null),s?x({name:s}):((0,d.addToast)({intent:"success",message:(0,l.jsx)(c,{content:"success"})}),i())},values:a,submitButton:{id:"btn-ok",name:"ok",children:(0,l.jsx)(u,{content:"save"})},cancelButton:{id:"btn-cancel",name:"cancel",children:(0,l.jsx)(u,{content:"cancel"}),onClick:i}},children:[(0,l.jsx)(n.FormFieldText,{label:(0,l.jsx)(c,{content:e?"emailAddress":"domainName"}),description:e&&(0,l.jsx)(c,{content:"emailAddressHint"}),name:"name",size:"md",multi:!0,required:!0}),e&&(0,l.jsx)(n.FormFieldRadioButtons,{label:(0,l.jsx)(c,{content:"action"}),name:"action",options:[{value:"DELETE",label:(0,l.jsx)(c,{content:"actionDelete"})},{value:"SPAM",label:(0,l.jsx)(c,{content:"actionSpam"})}]})]})};p.propTypes={isWindows:i.PropTypes.bool,isOpen:i.PropTypes.bool,onClose:i.PropTypes.func.isRequired},p.defaultProps={isWindows:!1,isOpen:!1};const g=p},1808:(e,t,s)=>{s.r(t),s.d(t,{default:()=>g});var i=s(233),n=s(232),a=s(85),l=s(231),o=s(283),r=s(389),d=s(756);const c=a.Locale.getTranslate("admin.components.forms.server-mail-white-list"),u=a.Locale.getTranslate("components.buttons"),m=o.gql`
    mutation AddWhiteListedNetwork($input: AddServerMailListItemInput!) {
        addWhiteListedNetwork(input: $input) {
            errors
        }
    }
`,p=({isWindows:e,mailServer:{isSmtpWhiteListSupported:t,isSmtpWhiteListWithWildcardSupported:i,isSmtpWhiteListWithCIDRSupported:a},isOpen:o,onClose:p})=>{const[g,b]=(0,l.useState)(null),[x,h]=(0,l.useState)(null),[j,v]=(0,l.useState)({});(0,l.useEffect)((()=>{b({name:[""]}),h(null),v({})}),[o,e]);const[S]=(0,r.useMutation)(m,{refetchQueries:[{query:s(730)}],awaitRefetchQueries:!0});return(0,l.jsxs)(n.Drawer,{"data-type":"add-white-listed-network",title:(0,l.jsx)(c,{content:"title"}),isOpen:o,onClose:p,size:"sm",form:{state:x,errors:j,applyButton:!1,onSubmit:async({name:e})=>{h("submit"),v({});const{data:{addWhiteListedNetwork:{errors:t}}}=await S({variables:{input:{name:e.map((e=>(e??"").trim()))}}});h(null),t?v({name:t}):((0,d.addToast)({intent:"success",message:(0,l.jsx)(c,{content:"success"})}),p())},values:g,submitButton:{id:"btn-ok",name:"ok",children:(0,l.jsx)(u,{content:"save"})},cancelButton:{id:"btn-cancel",name:"cancel",children:(0,l.jsx)(u,{content:"cancel"}),onClick:p}},children:[e&&(0,l.jsxs)("p",{children:[(0,l.jsx)(c,{content:"descEmailAddress"}),t&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("br",{}),(0,l.jsx)(c,{content:"descIpAddress"})]})]}),(0,l.jsx)(n.FormFieldText,{label:(0,l.jsx)(c,{content:e?t?"emailAddressOrIp":"emailAddress":"ipAddress"}),description:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c,{content:e?"emailAddressHint":"ipAddressHint"}),e&&t&&i&&(0,l.jsxs)(l.Fragment,{children:[" ",(0,l.jsx)(c,{content:"wildcardPattern"})]}),e&&t&&a&&(0,l.jsxs)(l.Fragment,{children:[" ",(0,l.jsx)(c,{content:"cidrPattern"})]})]}),name:"name",size:"md",multi:!0,required:!0})]})};p.propTypes={isWindows:i.PropTypes.bool,mailServer:i.PropTypes.shape({isSmtpWhiteListSupported:i.PropTypes.bool.isRequired,isSmtpWhiteListWithWildcardSupported:i.PropTypes.bool.isRequired,isSmtpWhiteListWithCIDRSupported:i.PropTypes.bool.isRequired}).isRequired,isOpen:i.PropTypes.bool,onClose:i.PropTypes.func.isRequired},p.defaultProps={isWindows:!1,isOpen:!1};const g=p},1810:(e,t,s)=>{s.r(t),s.d(t,{default:()=>j});var i=s(232),n=s(880),a=s(231),l=s(85),o=s(518),r=s(233),d=s.n(r),c=s(283),u=s(389),m=s(712),p=s(756);const g=l.Locale.getTranslate("admin.components.forms.server-mail-antivirus"),b=l.Locale.getTranslate("components.buttons"),x=c.gql`
    mutation UpdateServerMailAntivirusPolicy($input: UpdateServerMailAntivirusPolicyInput!) {
        updateServerMailAntivirusPolicy(input: $input) {
            query {
                serverMail {
                    antivirusPolicy {
                        policy
                        isAppliedToIncoming
                        isAppliedToOutgoing
                    }
                }
            }
        }
    }
`,h=({serverMail:{antivirusPolicy:{policy:e,isAppliedToIncoming:t,isAppliedToOutgoing:s}}})=>{const l=(0,m.useNavigate)(),[r]=(0,u.useMutation)(x),d=(0,i.useTranslate)("admin.components.forms.server-mail-antivirus"),c="/admin/server/tools",[h,j]=(0,a.useState)({});(0,a.useEffect)((()=>{j({policy:e,isAppliedToIncoming:t,isAppliedToOutgoing:s})}),[e,t,s]);return(0,a.jsxs)(n.default,{id:"server-mail-antivirus-policy",mutation:r,values:h,onFieldChange:(e,t)=>j((s=>(0,i.setIn)(s,e,t))),submitButton:{id:"buttonid-ok",name:"ok",children:(0,a.jsx)(b,{content:"save"})},applyButton:{id:"buttonid-apply",name:"apply",children:(0,a.jsx)(b,{content:"apply"})},cancelButton:{id:"buttonid-cancel",name:"cancel",children:(0,a.jsx)(b,{content:"cancel"}),component:o.default,to:c},onSuccess:(e,t)=>{(0,p.addToast)({intent:"success",message:(0,a.jsx)(g,{content:"success"})}),t?l(window.location.pathname,{replace:!0,state:{reload:!0}}):l(c)},children:[(0,a.jsxs)(i.FormFieldSelect,{label:(0,a.jsx)(g,{content:"policy"}),name:"policy",children:[(0,a.jsx)("option",{value:"any",children:d("policyAny")}),(0,a.jsx)("option",{value:"from",children:d("policyFrom")}),(0,a.jsx)("option",{value:"to",children:d("policyTo")}),(0,a.jsx)("option",{value:"",children:d("policyOff")})]}),(0,a.jsxs)(i.FormField,{label:(0,a.jsx)(g,{content:"allowPersonalSettings"}),children:[(0,a.jsx)(i.FormFieldCheckbox,{label:(0,a.jsx)(g,{content:"incoming"}),name:"isAppliedToIncoming",disabled:null===(0,i.getIn)(h,"isAppliedToIncoming")}),(0,a.jsx)(i.FormFieldCheckbox,{label:(0,a.jsx)(g,{content:"outgoing"}),name:"isAppliedToOutgoing",disabled:null===(0,i.getIn)(h,"isAppliedToOutgoing")})]})]})};h.propTypes={serverMail:d().shape({antivirusPolicy:d().shape({policy:d().string.isRequired,isAppliedToIncoming:d().bool,isAppliedToOutgoing:d().bool}).isRequired}).isRequired};const j=h},1798:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var i=s(232),n=s(85),a=s(233),l=s.n(a),o=s(231);const r=n.Locale.getTranslate("admin.components.forms.server-mail-settings.antivirus"),d=({isMailUiDisabled:e,options:t})=>(0,o.jsx)(i.Section,{title:(0,o.jsx)(r,{content:"title"}),children:1===t.length?(0,o.jsx)(i.FormField,{label:(0,o.jsx)(r,{content:"used"}),children:t[0].name}):(0,o.jsx)(i.FormFieldRadioButtons,{label:(0,o.jsx)(r,{content:"used"}),name:"antivirus",disabled:e,options:t.map((({key:e,name:t})=>({value:e,label:t})))})});d.propTypes={isMailUiDisabled:l().bool,options:l().array.isRequired},d.defaultProps={isMailUiDisabled:!1};const c=d},1800:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var i=s(232),n=s(85),a=s(233),l=s.n(a),o=s(231);const r=n.Locale.getTranslate("admin.components.forms.server-mail-settings.auto-reply-headers"),d=({isMailUiDisabled:e})=>(0,o.jsxs)(i.Section,{title:(0,o.jsx)(r,{content:"title"}),children:[(0,o.jsx)("p",{children:(0,o.jsx)(r,{content:"description"})}),(0,o.jsx)(i.FormField,{label:(0,o.jsx)(r,{content:"extra"}),name:"settings[autoReplyHeaders]",multi:{max:10},className:"server-mail-settings-form-field-multi",disabled:e,children:({getValue:t,setValue:s,getName:n})=>{const{name:a,value:l}=t({name:"",value:""});return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(i.Input,{name:`${n()}[name]`,size:"lg",value:a,onChange:({target:e})=>s({name:e.value,value:l}),maxLength:"75",disabled:e})," : ",(0,o.jsx)(i.Input,{name:`${n()}[value]`,value:l,onChange:({target:e})=>s({name:a,value:e.value}),maxLength:"75",disabled:e})]})}})]});d.propTypes={isMailUiDisabled:l().bool},d.defaultProps={isMailUiDisabled:!1};const c=d},1793:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var i=s(232),n=s(85),a=s(233),l=s.n(a),o=s(231);const r=n.Locale.getTranslate("admin.components.forms.server-mail-settings.autodiscover"),d=({isMailUiDisabled:e,values:t,isEnabled:s,customServer:n,isDnsEnabled:a})=>(0,o.jsxs)(i.Section,{title:(0,o.jsx)(r,{content:"title"}),children:[(0,o.jsx)("p",{children:(0,o.jsx)(r,{content:"description",params:{link:(0,o.jsx)(i.Link,{href:"https://support.plesk.com/hc/en-us/articles/360009747280",target:"_blank",children:(0,o.jsx)(r,{content:"link"})})}})}),(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:"enabled"}),name:"autodiscover[isEnabled]",description:(0,o.jsx)(r,{content:"enabledHint"}),disabled:e}),(0,o.jsx)(i.FormFieldText,{label:(0,o.jsx)(r,{content:"customServer"}),name:"autodiscover[customServer]",description:(0,o.jsx)(r,{content:"customServerHint"}),size:"xl",disabled:e||!(0,i.getIn)(t,"autodiscover[isEnabled]")}),a&&(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:"reconfigureDns"}),name:"autodiscover[reconfigureDns]",description:(0,o.jsx)(r,{content:"reconfigureDnsHint"}),disabled:e||!((0,i.getIn)(t,"autodiscover[isEnabled]")&&((0,i.getIn)(t,"autodiscover[isEnabled]")!==s||(0,i.getIn)(t,"autodiscover[customServer]")!==n))})]});d.propTypes={isMailUiDisabled:l().bool,values:l().object.isRequired,isEnabled:l().bool,customServer:l().string.isRequired,isDnsEnabled:l().bool},d.defaultProps={isMailUiDisabled:!1,isEnabled:!1,isDnsEnabled:!0};const c=d},1792:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var i=s(232),n=s(85),a=s(233),l=s.n(a),o=s(231);const r=n.Locale.getTranslate("admin.components.forms.server-mail-settings.general"),d=({isMailUiDisabled:e,values:t,mailServerName:s,imapServerName:n,isWindows:a,ipAddresses:l,isMaxLetterSizeChangeable:d,isMessageSubmissionDedicatedIPSupported:c,isMessageSubmissionAllIPSupported:u,handleFieldChange:m})=>{const p=(0,i.useTranslate)("admin.components.forms.server-mail-settings.general"),g=a?"/server/defaultcomponents.php?type_name=mailserver":"/admin/update/add-components",b=l.filter((({isIPv6:e})=>!e)),x=l.filter((({isIPv6:e})=>e));return(0,o.jsxs)(i.Section,{title:(0,o.jsx)(r,{content:"title"}),children:[(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:"mailUiEnabled"}),name:"settings[isMailUiEnabled]"}),(0,o.jsx)(i.FormField,{label:(0,o.jsx)(r,{content:"serverName"}),description:(0,o.jsx)(r,{content:"changeServerHint",params:{serverChangeLink:(0,o.jsx)(i.Link,{href:g,target:"_blank",children:(0,o.jsx)(r,{content:"changeServerName"})})}}),children:s}),n&&n!==s&&(0,o.jsx)(i.FormField,{label:(0,o.jsx)(r,{content:"imapServerName"}),description:(0,o.jsx)(r,{content:"changeServerHint",params:{serverChangeLink:(0,o.jsx)(i.Link,{href:g,target:"_blank",children:(0,o.jsx)(r,{content:"changeImapServerName"})})}}),children:n}),null!==(0,i.getIn)(t,"settings[maxMessageSize]")&&(0,o.jsx)(i.FormField,{name:"settings[maxMessageSize]",label:(0,o.jsx)(r,{content:"maxMessageSize"}),children:({getValue:t,setValue:s,getName:n})=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(i.Input,{name:n(),size:8,value:t(),onChange:e=>s(e.target.value),maxLength:"7",disabled:e||!d}),"  ",(0,o.jsx)(r,{content:"kbytes"})]})}),null!==(0,i.getIn)(t,"settings[maxConnections]")&&(0,o.jsx)(i.FormField,{name:"settings[maxConnections]",label:(0,o.jsx)(r,{content:"maxConnections"}),description:(0,o.jsx)(r,{content:`maxConnectionsHint${n}`}),children:({getValue:t,setValue:s,getName:n})=>(0,o.jsx)(i.Input,{name:n(),size:8,value:t(),onChange:e=>s(e.target.value),maxLength:"10",disabled:e})}),null!==(0,i.getIn)(t,"settings[maxConnectionsPerIp]")&&(0,o.jsx)(i.FormField,{name:"settings[maxConnectionsPerIp]",label:(0,o.jsx)(r,{content:`maxConnectionsPerIp${n}`}),description:(0,o.jsx)(r,{content:`maxConnectionsPerIpHint${n}`}),children:({getValue:t,setValue:s,getName:n})=>(0,o.jsx)(i.Input,{name:n(),size:8,value:t(),onChange:e=>s(e.target.value),maxLength:"10",disabled:e})}),null!==(0,i.getIn)(t,"settings[outgoingEmailMode]")&&(0,o.jsx)(i.FormFieldRadioButtons,{label:(0,o.jsx)(r,{content:"outgoingEmailMode"}),name:"settings[outgoingEmailMode]",disabled:e,options:[{value:"domain-ip",label:(0,o.jsx)(r,{content:"outgoingEmailModeDomainIp"})},{value:"domain-name",label:(0,o.jsx)(r,{content:"outgoingEmailModeDomainName"})},{value:"explicit-ip",label:(0,o.jsx)(r,{content:"outgoingEmailModeExplicitIp"}),indentFields:[b.length&&(0,o.jsxs)("div",{style:{marginBlockStart:"8px"},children:[(0,o.jsx)(r,{content:"outgoingEmailModeExplicitIpV4"})," ",(0,o.jsxs)(i.Select,{name:"settings[outgoingEmailModeIpV4]",id:"settings-outgoingEmailModeIpV4",size:"sm",value:(0,i.getIn)(t,"settings[outgoingEmailModeIpV4]"),onChange:e=>m("settings[outgoingEmailModeIpV4]",e),disabled:e||"explicit-ip"!==(0,i.getIn)(t,"settings[outgoingEmailMode]"),children:[(0,o.jsx)(i.SelectOption,{value:"",children:p("outgoingEmailModeExplicitIpNone")}),b.map((({ipAddress:e})=>(0,o.jsx)(i.SelectOption,{value:e,children:e},e)))]})]}),x.length&&(0,o.jsxs)("div",{style:{marginBlockStart:"8px"},children:[(0,o.jsx)(r,{content:"outgoingEmailModeExplicitIpV6"})," ",(0,o.jsxs)(i.Select,{name:"settings[outgoingEmailModeIpV6]",id:"settings-outgoingEmailModeIpV6",size:"sm",value:(0,i.getIn)(t,"settings[outgoingEmailModeIpV6]"),onChange:e=>m("settings[outgoingEmailModeIpV6]",e),disabled:e||"explicit-ip"!==(0,i.getIn)(t,"settings[outgoingEmailMode]"),children:[(0,o.jsx)(i.SelectOption,{value:"",children:p("outgoingEmailModeExplicitIpNone")}),x.map((({ipAddress:e})=>(0,o.jsx)(i.SelectOption,{value:e,children:e},e)))]})]})].filter(Boolean)}]}),null!==(0,i.getIn)(t,"settings[isMessageSubmissionEnabled]")&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:c?"messageSubmission":"messageSubmissionOnAllIp"}),name:"settings[isMessageSubmissionEnabled]",disabled:e}),(0,i.getIn)(t,"settings[isMessageSubmissionEnabled]")&&c&&(0,o.jsxs)(i.Section,{collapsible:!0,children:[(0,o.jsx)(r,{content:"messageSubmissionBindTo"})," ",(0,o.jsxs)(i.Select,{name:"settings[messageSubmissionIp]",value:(0,i.getIn)(t,"settings[messageSubmissionIp]"),disabled:e,onChange:e=>m("settings[messageSubmissionIp]",e),children:[u&&(0,o.jsx)(i.SelectOption,{value:"",children:p("messageSubmissionAllIpAddresses")}),l.map((({ipAddress:e})=>(0,o.jsx)(i.SelectOption,{value:e,children:e},e)))]})]})]}),null!==(0,i.getIn)(t,"settings[isEmailSubaddressingEnabled]")&&(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:"subaddressing"}),name:"settings[isEmailSubaddressingEnabled]",description:(0,o.jsx)(r,{content:"subaddressingHint",params:{verpStyleLink:(0,o.jsx)(i.Link,{href:"https://en.wikipedia.org/wiki/Variable_envelope_return_path",target:"_blank",children:(0,o.jsx)(r,{content:"verpStyleLink"})})}}),disabled:e}),null!==(0,i.getIn)(t,"settings[isMboxQuotaWarningEnabled]")&&(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:"mboxQuotaWarning"}),name:"settings[isMboxQuotaWarningEnabled]",description:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(r,{content:"mboxQuotaWarningHint"}),(0,o.jsx)("br",{}),(0,o.jsx)(i.Link,{href:"/admin/mail-settings/customize-mailbox-quota-warning",children:(0,o.jsx)(r,{content:"mboxQuotaWarningChange"})})]}),disabled:e}),null!==(0,i.getIn)(t,"settings[isFixSenderEnabled]")&&(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:"fixSender"}),name:"settings[isFixSenderEnabled]",description:(0,o.jsx)(r,{content:"fixSenderHint"}),disabled:e})]})};d.propTypes={isMailUiDisabled:l().bool,values:l().object.isRequired,mailServerName:l().string.isRequired,imapServerName:l().string.isRequired,isWindows:l().bool,ipAddresses:l().array.isRequired,isMaxLetterSizeChangeable:l().bool,isMessageSubmissionDedicatedIPSupported:l().bool,isMessageSubmissionAllIPSupported:l().bool,handleFieldChange:l().func.isRequired},d.defaultProps={isMailUiDisabled:!1,isWindows:!1,isMaxLetterSizeChangeable:!1,isMessageSubmissionDedicatedIPSupported:!1,isMessageSubmissionAllIPSupported:!1};const c=d},1797:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var i=s(232),n=s(85),a=s(233),l=s.n(a),o=s(231);const r=n.Locale.getTranslate("admin.components.forms.server-mail-settings.mailman"),d=({isMailUiDisabled:e,hasLocalhostRelayingAddressesIpV4:t,hasLocalhostRelayingAddressesIpV6:s})=>(0,o.jsxs)(i.Section,{title:(0,o.jsx)(r,{content:"title"}),children:[!t&&!s&&(0,o.jsx)(i.StatusMessage,{intent:"warning",children:(0,o.jsx)(r,{content:"noLocalhost"})}),!t&&s&&(0,o.jsx)(i.StatusMessage,{intent:"warning",children:(0,o.jsx)(r,{content:"noLocalhostIpv4"})}),t&&!s&&(0,o.jsx)(i.StatusMessage,{intent:"warning",children:(0,o.jsx)(r,{content:"noLocalhostIpv6"})}),(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:"secureLinks"}),name:"settings[isListSecureLinksEnabled]",description:(0,o.jsx)(r,{content:"secureLinksHint"}),disabled:e})]});d.propTypes={isMailUiDisabled:l().bool,hasLocalhostRelayingAddressesIpV4:l().bool,hasLocalhostRelayingAddressesIpV6:l().bool},d.defaultProps={isMailUiDisabled:!1,hasLocalhostRelayingAddressesIpV4:!1,hasLocalhostRelayingAddressesIpV6:!1};const c=d},1796:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var i=s(232),n=s(85),a=s(231),l=s(233),o=s.n(l);const r=n.Locale.getTranslate("admin.components.forms.server-mail-settings.outgoing"),d=({value:e,name:t,isUnlimited:s,warnings:n,isDisabled:l})=>{const[o,d]=(0,a.useState)("");return(0,a.useEffect)((()=>{d(s(e)?"":e)}),[e,s]),(0,a.jsx)(i.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)(i.Input,{name:`outgoingMessages[${t}]`,size:8,value:o,onChange:e=>{c(e.target.value),d(e.target.value)},maxLength:"9",disabled:l||s(e())}),(0,a.jsx)(i.Checkbox,{name:`outgoingMessages[${t}Unlimited]`,checked:s(e()),onChange:e=>c(e?-1:o),disabled:l,children:(0,a.jsx)(r,{content:"unlimited"})})]}),n.map((e=>(0,a.jsx)(i.Status,{intent:"warning",children:e},e)))]})})};d.propTypes={value:o().number.isRequired,name:o().string.isRequired,isUnlimited:o().func.isRequired,warnings:o().array,isDisabled:o().bool},d.defaultProps={warnings:[],isDisabled:!1};const c=d},1795:(e,t,s)=>{s.r(t),s.d(t,{default:()=>u});var i=s(232),n=s(85),a=s(231),l=s(1796),o=s(233),r=s.n(o);const d=n.Locale.getTranslate("admin.components.forms.server-mail-settings.outgoing"),c=({isMailUiDisabled:e,values:t,allowedReportPeriods:s,allowedNotificationPeriods:n})=>{const o=(0,i.useTranslate)("admin.components.forms.server-mail-settings.outgoing"),r=!e&&(0,i.getIn)(t,"outgoingMessages[isEnabled]"),[c,u]=(0,a.useState)([]),[m,p]=(0,a.useState)([]),g=(0,i.getIn)(t,"outgoingMessages[mailboxLimit]"),b=(0,i.getIn)(t,"outgoingMessages[domainLimit]"),x=(0,i.getIn)(t,"outgoingMessages[subscriptionLimit]"),h=(0,a.useCallback)((e=>-1===e),[]);return(0,a.useEffect)((()=>{const e=e=>h(e)?(0,a.jsx)(d,{content:"unlimited"}):+e,t=e=>null!==e&&""!==e,s=[],i=[];r&&(t(g)&&t(b)&&!h(b)&&(g>b||h(g))&&s.push((0,a.jsx)(d,{content:"mailboxLimitExceedsDomainLimit",params:{value:e(g),highLevelLimitValue:e(b)}})),t(g)&&t(x)&&!h(x)&&(g>x||h(g))&&s.push((0,a.jsx)(d,{content:"mailboxLimitExceedsSubscriptionLimit",params:{value:e(g),highLevelLimitValue:e(x)}})),t(b)&&t(x)&&!h(x)&&(b>x||h(b))&&i.push((0,a.jsx)(d,{content:"domainLimitExceedsSubscriptionLimit",params:{value:e(b),highLevelLimitValue:e(x)}}))),u(s),p(i)}),[r,g,b,x,h]),(0,a.jsxs)(i.Section,{title:(0,a.jsx)(d,{content:"title"}),children:[r&&0!==((0,i.getIn)(t,"relay[noRelayNetworks]")??[]).length&&(0,a.jsx)(i.StatusMessage,{intent:"warning",children:(0,a.jsx)(d,{content:"whiteListNotEmpty"})}),r&&"open"===(0,i.getIn)(t,"relay[type]")&&(0,a.jsx)(i.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)(i.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)(i.FormFieldCheckbox,{label:(0,a.jsx)(d,{content:"enabled"}),name:"outgoingMessages[isEnabled]",disabled:e}),null!==(0,i.getIn)(t,"outgoingMessages[isCountRecipientsEnabled]")&&(0,a.jsx)(i.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)(l.default,{value:g,name:"mailboxLimit",isUnlimited:h,warnings:c,isDisabled:!r}),null!==b&&(0,a.jsx)(l.default,{value:b,name:"domainLimit",isUnlimited:h,warnings:m,isDisabled:!r}),null!==x&&(0,a.jsx)(l.default,{value:x,name:"subscriptionLimit",isUnlimited:h,isDisabled:!r}),null!==(0,i.getIn)(t,"outgoingMessages[isSendmailEnabled]")&&(0,a.jsx)(i.FormFieldCheckbox,{label:(0,a.jsx)(d,{content:"sendmail"}),name:"outgoingMessages[isSendmailEnabled]",description:(0,a.jsx)(d,{content:"sendmailHint"}),disabled:!r}),(0,a.jsx)(i.FormFieldSelect,{label:(0,a.jsx)(d,{content:"reportPeriod"}),name:"outgoingMessages[reportPeriod]",description:(0,a.jsx)(d,{content:"reportPeriodHint"}),size:"sm",disabled:!r,children:s.map((e=>(0,a.jsx)("option",{value:e,children:o(`period${e}`)},e)))}),(0,a.jsx)(i.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:o(`period${e}`)},e)))})]})};c.propTypes={isMailUiDisabled:r().bool,values:r().object.isRequired,allowedReportPeriods:r().array.isRequired,allowedNotificationPeriods:r().array.isRequired},c.defaultProps={isMailUiDisabled:!1};const u=c},1801:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var i=s(232),n=s(85),a=s(233),l=s.n(a),o=s(231);const r=n.Locale.getTranslate("admin.components.forms.server-mail-settings.pop3-names"),d=({isMailUiDisabled:e})=>(0,o.jsx)(i.Section,{title:(0,o.jsx)(r,{content:"title"}),children:(0,o.jsx)(i.FormFieldRadioButtons,{label:null,name:"settings[isShortPop3NameEnabled]",disabled:e,options:[{value:"true",label:(0,o.jsx)(r,{content:"enabled"})},{value:"false",label:(0,o.jsx)(r,{content:"disabled"})}]})});d.propTypes={isMailUiDisabled:l().bool},d.defaultProps={isMailUiDisabled:!1};const c=d},1794:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var i=s(232),n=s(85),a=s(233),l=s.n(a),o=s(231);const r=n.Locale.getTranslate("admin.components.forms.server-mail-settings.relay"),d=({isMailUiDisabled:e,values:t,isOpenRelayAllowed:s,isWindows:n,isRelayLockTimeSupported:a,isRelayTypeOpenSupported:l,isRelayTypeClosedSupported:d,isRelayTypeAuthSupported:c,isRelayTypeAuthPop3Supported:u,isRelayTypeAuthSmtpSupported:m,isRelayTypeAuthBothSupported:p,handleFieldChange:g})=>{const b=(e,t)=>p&&e&&t||u&&e&&!t||m&&!e&&t;return(0,o.jsxs)(i.Section,{title:(0,o.jsx)(r,{content:"title"}),children:[(0,o.jsx)(i.FormFieldRadioButtons,{label:(0,o.jsx)(r,{content:"type"}),name:"relay[type]",disabled:e,description:"open"===(0,i.getIn)(t,"relay[type]")&&(0,o.jsxs)(i.Status,{intent:"danger",children:[(0,o.jsx)(r,{content:"openSpamWarning"}),(0,o.jsx)("br",{}),(0,o.jsx)(r,{content:"openSpamChange"})]}),options:[s&&{value:"open",label:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(r,{content:"open"}),!l&&(0,o.jsxs)(o.Fragment,{children:[" ","(",(0,o.jsx)(r,{content:"notSupported"}),")"]})]}),disabled:!l},{value:"closed",label:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(r,{content:"closed"}),!d&&(0,o.jsxs)(o.Fragment,{children:[" ","(",(0,o.jsx)(r,{content:"notSupported"}),")"]})]}),disabled:!d,description:n&&(0,o.jsx)(r,{content:"change",params:{changeLink:(0,o.jsx)(i.Link,{href:"/admin/mail-gate",children:(0,o.jsx)(r,{content:"changeLink"})})}})},{value:"auth",label:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(r,{content:"auth"}),!c&&(0,o.jsxs)(o.Fragment,{children:[" ","(",(0,o.jsx)(r,{content:"notSupported"}),")"]})]}),disabled:!c,indentFields:[(0,o.jsx)(i.FormField,{label:null,style:{marginBlockEnd:0},children:(0,o.jsxs)("div",{className:"server-mail-settings-form-field-complex",children:[(0,o.jsx)(i.Checkbox,{name:"relay[isPopAuthEnabled]",checked:(0,i.getIn)(t,"relay[isPopAuthEnabled]"),onChange:e=>{const s=(0,i.getIn)(t,"relay[isSmtpAuthEnabled]");if(!b(e,s))return s||e||!b(e,!0)?void g("relay[isPopAuthEnabled]",!e):(g("relay[isSmtpAuthEnabled]",!0),void g("relay[isPopAuthEnabled]",e));g("relay[isPopAuthEnabled]",e)},disabled:e||"auth"!==(0,i.getIn)(t,"relay[type]")||!(u||p),children:(0,o.jsx)(r,{content:"pop3"})}),(0,o.jsx)(r,{content:"lockTime"}),(0,o.jsx)(i.Input,{name:"relay[lockTime]",size:"sm",value:(0,i.getIn)(t,"relay[lockTime]"),onChange:e=>g("relay[lockTime]",e.target.value),maxLength:"5",disabled:e||"auth"!==(0,i.getIn)(t,"relay[type]")||!(0,i.getIn)(t,"relay[isPopAuthEnabled]")||!a||!(u||p)}),(0,o.jsx)(r,{content:"min"})]})},"popAuth"),(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:"smtp"}),name:"relay[isSmtpAuthEnabled]",onChange:e=>{const s=(0,i.getIn)(t,"relay[isPopAuthEnabled]");if(!b(s,e))return s||e||!b(!0,e)?void g("relay[isSmtpAuthEnabled]",!e):(g("relay[isPopAuthEnabled]",!0),void g("relay[isSmtpAuthEnabled]",e));g("relay[isSmtpAuthEnabled]",e)},disabled:e||!(m||p)},"smtp")]}].filter(Boolean)}),n&&t?.relay?.noRelayNetworks&&(0,o.jsx)(i.FormFieldText,{label:(0,o.jsx)(r,{content:"noRelayNetworks"}),name:"relay[noRelayNetworks]",multi:!0,size:"xl",description:(0,o.jsx)(r,{content:"noRelayNetworksHint"}),disabled:e})]})};d.propTypes={isMailUiDisabled:l().bool,values:l().object.isRequired,isOpenRelayAllowed:l().bool,isWindows:l().bool,isRelayLockTimeSupported:l().bool,isRelayTypeOpenSupported:l().bool,isRelayTypeClosedSupported:l().bool,isRelayTypeAuthSupported:l().bool,isRelayTypeAuthPop3Supported:l().bool,isRelayTypeAuthSmtpSupported:l().bool,isRelayTypeAuthBothSupported:l().bool,handleFieldChange:l().func.isRequired},d.defaultProps={isMailUiDisabled:!1,isOpenRelayAllowed:!1,isWindows:!1,isRelayLockTimeSupported:!1,isRelayTypeOpenSupported:!1,isRelayTypeClosedSupported:!1,isRelayTypeAuthSupported:!1,isRelayTypeAuthPop3Supported:!1,isRelayTypeAuthSmtpSupported:!1,isRelayTypeAuthBothSupported:!1};const c=d},1799:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var i=s(232),n=s(85),a=s(233),l=s.n(a),o=s(231);const r=n.Locale.getTranslate("admin.components.forms.server-mail-settings.spam-filter"),d=({isMailUiDisabled:e,values:t,isRBLInstalled:s})=>{const n=(0,i.useTranslate)("admin.components.forms.server-mail-settings.spam-filter"),a=null!==(0,i.getIn)(t,"spamFilter[isDmarcEnabled]"),l=null!==(0,i.getIn)(t,"spamFilter[isSigningOutgoingMailEnabled]"),d=null!==(0,i.getIn)(t,"spamFilter[isSpfEnabled]");return(0,o.jsxs)(o.Fragment,{children:[a&&(0,o.jsx)(i.Section,{title:(0,o.jsx)(r,{content:"dmarc"}),children:(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:"dmarcEnabled"}),name:"spamFilter[isDmarcEnabled]",description:l&&d&&(0,o.jsx)(r,{content:"dmarcHint"}),disabled:e||!1===(0,i.getIn)(t,"spamFilter[isVerifyingIncomingMailEnabled]")||!1===(0,i.getIn)(t,"spamFilter[isSpfEnabled]")})}),l&&(0,o.jsxs)(i.Section,{title:(0,o.jsx)(r,{content:"dkim"}),children:[(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:"singOutgoing"}),name:"spamFilter[isSigningOutgoingMailEnabled]",disabled:e}),a&&(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:"verifyIncoming"}),name:"spamFilter[isVerifyingIncomingMailEnabled]",description:(0,o.jsx)(r,{content:"verifyIncomingHint"}),disabled:e||(0,i.getIn)(t,"spamFilter[isDmarcEnabled]")})]}),d&&(0,o.jsxs)(i.Section,{title:(0,o.jsx)(r,{content:"spf"}),children:[(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:"spfEnabled"}),name:"spamFilter[isSpfEnabled]",description:a&&(0,o.jsx)(r,{content:"spfEnabledHint"}),disabled:e||(0,i.getIn)(t,"spamFilter[isDmarcEnabled]")}),(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:"ignoreErrors"}),name:"spamFilter[isErrorIgnored]",description:(0,o.jsx)(r,{content:"ignoreErrorsHint"}),disabled:e||!(0,i.getIn)(t,"spamFilter[isSpfEnabled]")||+(0,i.getIn)(t,"spamFilter[behavior]")<=2}),(0,o.jsxs)(i.FormFieldSelect,{label:(0,o.jsx)(r,{content:"behavior"}),name:"spamFilter[behavior]",description:(0,o.jsx)(r,{content:"behaviorHint"}),disabled:e||!(0,i.getIn)(t,"spamFilter[isSpfEnabled]"),children:[(0,o.jsx)("option",{value:"1",children:n("behaviorCreateHeadersNoBlock")}),(0,o.jsx)("option",{value:"2",children:n("behaviorUseTmpErrors")}),(0,o.jsx)("option",{value:"3",children:n("behaviorRejectIfFail")}),(0,o.jsx)("option",{value:"4",children:n("behaviorRejectIfSoftfail")}),(0,o.jsx)("option",{value:"5",children:n("behaviorRejectIfNeutral")}),(0,o.jsx)("option",{value:"6",children:n("behaviorRejectIfNoPass")})]}),(0,o.jsx)(i.FormField,{label:(0,o.jsx)(r,{content:"localRules"}),name:"spamFilter[localRules]",children:({getValue:s,setValue:n,getName:a})=>(0,o.jsx)(i.Input,{name:a(),size:50,value:s(),onChange:e=>n(e.target.value),maxLength:"255",disabled:e||!(0,i.getIn)(t,"spamFilter[isSpfEnabled]")})}),(0,o.jsx)(i.FormField,{label:(0,o.jsx)(r,{content:"guessRules"}),name:"spamFilter[guessRules]",children:({getValue:s,setValue:n,getName:a})=>(0,o.jsx)(i.Input,{name:a(),size:50,value:s(),onChange:e=>n(e.target.value),maxLength:"255",disabled:e||!(0,i.getIn)(t,"spamFilter[isSpfEnabled]")})}),(0,o.jsx)(i.FormField,{label:(0,o.jsx)(r,{content:"explanationText"}),name:"spamFilter[explanationText]",children:({getValue:s,setValue:n,getName:a})=>(0,o.jsx)(i.Input,{name:a(),size:50,value:s(),onChange:e=>n(e.target.value),maxLength:"255",disabled:e||!(0,i.getIn)(t,"spamFilter[isSpfEnabled]")})})]}),null!==(0,i.getIn)(t,"spamFilter[isRblEnabled]")&&(0,o.jsxs)(i.Section,{title:(0,o.jsx)(r,{content:"rbl"}),children:[(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:"rblEnabled"}),name:"spamFilter[isRblEnabled]",disabled:e||!s}),(0,o.jsx)(i.FormFieldText,{label:(0,o.jsx)(r,{content:"rblServer"}),name:"spamFilter[rblServer]",size:"xl",description:(0,o.jsx)(r,{content:"rblServerHint"}),disabled:e||!s||!(0,i.getIn)(t,"spamFilter[isRblEnabled]")})]})]})};d.propTypes={isMailUiDisabled:l().bool,values:l().object.isRequired,isRBLInstalled:l().bool},d.defaultProps={isMailUiDisabled:!1,isRBLInstalled:!1};const c=d},1791:(e,t,s)=>{s.r(t),s.d(t,{default:()=>k});var i=s(231),n=s(712),a=s(232),l=s(880),o=s(1792),r=s(1793),d=s(1794),c=s(1795),u=s(1797),m=s(1798),p=s(1799),g=s(1800),b=s(1801),x=s(233),h=s.n(x),j=s(283),v=s(389),S=s(756),y=s(518),f=s(85);const T=f.Locale.getTranslate("admin.components.forms.server-mail-settings"),M=f.Locale.getTranslate("components.buttons"),F=j.gql`
    mutation UpdateServerMail($input: UpdateServerMailInput!) {
        updateServerMail(input: $input) {
            warnings
        }
    }

`,L=e=>null===e?null:`${e}`,w=e=>null===e||""===`${e}`.trim()?null:+e,R=({serverMail:{isMailUiEnabled:e,settings:t,autodiscover:x,relay:h,outgoingMessages:j,antivirus:f,spamFilter:R},os:{isWindows:k},capability:{mailServer:{isMaxLetterSizeChangeable:E,isMessageSubmissionDedicatedIPSupported:I,isMessageSubmissionAllIPSupported:P,isRelayLockTimeSupported:C,isRelayTypeOpenSupported:A,isRelayTypeClosedSupported:D,isRelayTypeAuthSupported:q,isRelayTypeAuthPop3Supported:N,isRelayTypeAuthSmtpSupported:U,isRelayTypeAuthBothSupported:V},packages:{isRBLInstalled:B}},server:{ipAddresses:W}})=>{const H=(0,n.useNavigate)(),[O]=(0,v.useMutation)(F,{refetchQueries:[{query:s(727)}],awaitRefetchQueries:!0}),z="/admin/server/tools",[$,Q]=(0,i.useState)({});(0,i.useEffect)((()=>{const{mailServerName:s,imapServerName:i,outgoingEmailModeIps:n,hasLocalhostRelayingAddressesIpV4:a,hasLocalhostRelayingAddressesIpV6:l,...o}=t||{},{isDnsEnabled:r,...d}=x||{},{isOpenRelayAllowed:c,...u}=h||{},{allowedReportPeriods:m,allowedNotificationPeriods:p,...g}=j||{};Q({settings:t?{...o,isMailUiEnabled:e,maxMessageSize:null===t.maxMessageSize?null:Math.max(Math.ceil(t.maxMessageSize/1024),0),messageSubmissionIp:I?t.messageSubmissionIp?.ipAddress??"":null,outgoingEmailModeIpV4:n?.find((({isIPv6:e})=>!e))?.ipAddress??"",outgoingEmailModeIpV6:n?.find((({isIPv6:e})=>e))?.ipAddress??"",isShortPop3NameEnabled:L(t.isShortPop3NameEnabled)}:null,autodiscover:x?d:null,relay:h?u:null,outgoingMessages:j?g:null,antivirus:0===f.length?null:f.find((({isActive:e})=>e))?.key??"",spamFilter:R?{...R,behavior:L(R.behavior)}:null})}),[e,t,x,h,j,f,R,I]);const _=(0,i.useCallback)(((e,t)=>Q((s=>(0,a.setIn)(s,e,t)))),[]),K=t?!1===(0,a.getIn)($,"settings[isMailUiEnabled]"):!e;return(0,i.jsxs)(l.default,{id:"main-settings-content",mutation:O,values:$,onFieldChange:_,submitButton:{id:"buttonid-ok",name:"ok",children:(0,i.jsx)(M,{content:"save"})},applyButton:{id:"buttonid-apply",name:"apply",children:(0,i.jsx)(M,{content:"apply"})},cancelButton:{id:"buttonid-cancel",name:"cancel",children:(0,i.jsx)(M,{content:"cancel"}),component:y.default,to:z},onSubmit:e=>Object.entries(e).reduce(((e,[t,s])=>{if(null!==s&&"object"==typeof s){const{__typename:i,...n}=s;switch(t){case"settings":return{...e,settings:{...n,maxMessageSize:w(n.maxMessageSize),maxConnections:w(n.maxConnections),maxConnectionsPerIp:w(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:s}=e;return{name:t,value:s}}))}};case"relay":return{...e,relay:{...n,lockTime:w(n.lockTime)}};case"outgoingMessages":return{...e,outgoingMessages:{...n,mailboxLimit:""===n.mailboxLimit?null:w(n.mailboxLimit),domainLimit:""===n.domainLimit?null:w(n.domainLimit),subscriptionLimit:""===n.subscriptionLimit?null:w(n.subscriptionLimit)}};case"spamFilter":return{...e,spamFilter:{...n,behavior:null===n.behavior?null:+n.behavior}}}return{...e,[t]:n}}return{...e,[t]:s}}),{}),onSuccess:({updateServerMail:{warnings:e}},t)=>{e.forEach((e=>(0,S.addToast)({intent:"warning",message:e}))),(0,S.addToast)({intent:"success",message:(0,i.jsx)(T,{content:"success"})}),t?H(window.location.pathname,{replace:!0,state:{reload:!0}}):H(z)},children:[t&&(0,i.jsx)(o.default,{...t,isMailUiDisabled:K,values:$,isWindows:k,ipAddresses:W,isMaxLetterSizeChangeable:E,isMessageSubmissionDedicatedIPSupported:I,isMessageSubmissionAllIPSupported:P,handleFieldChange:_}),x&&(0,i.jsx)(r.default,{...x,isMailUiDisabled:K,values:$}),h&&(0,i.jsx)(d.default,{...h,isMailUiDisabled:K,values:$,isWindows:k,isRelayLockTimeSupported:C,isRelayTypeOpenSupported:A,isRelayTypeClosedSupported:D,isRelayTypeAuthSupported:q,isRelayTypeAuthPop3Supported:N,isRelayTypeAuthSmtpSupported:U,isRelayTypeAuthBothSupported:V,handleFieldChange:_}),j&&(0,i.jsx)(c.default,{...j,isMailUiDisabled:K,values:$}),null!==(t?.isListSecureLinksEnabled??null)&&(0,i.jsx)(u.default,{...t,isMailUiDisabled:K}),!!f.length&&(0,i.jsx)(m.default,{isMailUiDisabled:K,options:f}),R&&(0,i.jsx)(p.default,{isMailUiDisabled:K,values:$,isRBLInstalled:B}),null!==(t?.autoReplyHeaders??null)&&(0,i.jsx)(g.default,{isMailUiDisabled:K}),null!==(t?.isShortPop3NameEnabled??null)&&(0,i.jsx)(b.default,{isMailUiDisabled:K})]})};R.propTypes={serverMail:h().shape({isMailUiEnabled:h().bool.isRequired,settings:h().object,autodiscover:h().object,relay:h().object,outgoingMessages:h().object,antivirus:h().array.isRequired,spamFilter:h().object}).isRequired,os:h().shape({isWindows:h().bool.isRequired}).isRequired,capability:h().shape({mailServer:h().object.isRequired,packages:h().object.isRequired}).isRequired,server:h().shape({ipAddresses:h().array.isRequired}).isRequired};const k=R},1812:(e,t,s)=>{s.r(t),s.d(t,{default:()=>j});var i=s(232),n=s(880),a=s(231),l=s(85),o=s(518),r=s(283),d=s(389),c=s(233),u=s.n(c),m=s(756),p=s(712);const g=l.Locale.getTranslate("admin.components.forms.server-mail-spam-filter"),b=l.Locale.getTranslate("components.buttons"),x=r.gql`
    mutation UpdateSpamAssassin($input: UpdateSpamAssassinInput!) {
        updateSpamAssassin(input: $input) {
            result
        }
    }
`,h=({serverMail:{spamAssassin:{isEnabled:e,isUserSettingsEnabled:t,isUserSettingsAllowed:l,requiredHits:r,maxMailLimit:c,maxThreadsLimit:u,tag:h,alarmMessage:j,languages:v,locales:S}},capability:{mailServer:{isUserSettingsSupported:y}}})=>{const f=(0,p.useNavigate)(),T="/admin/server/tools",[M]=(0,d.useMutation)(x,{refetchQueries:[{query:s(732)}],awaitRefetchQueries:!0}),[F,L]=(0,a.useState)({}),[w,R]=(0,a.useState)(""),[k,E]=(0,a.useState)(""),I=!y||!l;(0,a.useEffect)((()=>{L({isEnabled:e,isUserSettingsEnabled:t,requiredHits:`${r}`,maxMailLimit:null===c?null:`${c}`,maxThreadsLimit:u,alarmMessage:j,tag:""===h?null:h,languages:v.filter((({isTrusted:e})=>e)).map((({key:e})=>e)),locales:S.filter((({isTrusted:e})=>e)).map((({key:e})=>e))})}),[e,t,r,c,u,h,j,v,S]),(0,a.useEffect)((()=>{R(c??"")}),[c]),(0,a.useEffect)((()=>{E(h)}),[h]);return(0,a.jsxs)(n.default,{id:"server-mail-spam-assassin",mutation:M,values:F,onFieldChange:(e,t)=>L((s=>(0,i.setIn)(s,e,t))),submitButton:{id:"buttonid-ok",name:"ok",children:(0,a.jsx)(b,{content:"save"})},applyButton:{id:"buttonid-apply",name:"apply",children:(0,a.jsx)(b,{content:"apply"})},cancelButton:{id:"buttonid-cancel",name:"cancel",children:(0,a.jsx)(b,{content:"cancel"}),component:o.default,to:T},onSuccess:(e,t)=>{(0,m.addToast)({intent:"success",message:(0,a.jsx)(g,{content:"success"})}),t?f(window.location.pathname,{replace:!0,state:{reload:!0}}):f(T)},children:[(0,a.jsxs)(i.Section,{title:(0,a.jsx)(g,{content:"general"}),children:[(0,a.jsx)(i.FormFieldCheckbox,{label:(0,a.jsx)(g,{content:"isEnabled"}),name:"isEnabled",disabled:null===e}),(0,a.jsx)(i.FormFieldCheckbox,{label:(0,a.jsx)(g,{content:"isUserSettingsEnabled"}),name:"isUserSettingsEnabled",disabled:I,description:I&&(0,a.jsx)(g,{content:"isUserSettingsEnabledHint"})})]}),(0,a.jsxs)(i.Section,{title:(0,a.jsx)(g,{content:"settings"}),children:[(0,a.jsx)(i.FormField,{label:(0,a.jsx)(g,{content:"requiredHits"}),name:"requiredHits",required:!0,children:({getValue:e,setValue:t,getName:s})=>(0,a.jsx)(i.Input,{name:s(),value:e(),onChange:e=>t(e.target.value),size:"sm",maxLength:"4"})}),(0,a.jsx)(i.FormField,{label:(0,a.jsx)(g,{content:"maxMailLimit"}),name:"maxMailLimit",children:({getValue:e,setValue:t,getName:s})=>(0,a.jsxs)("div",{className:"server-mail-spam-filter-form-field-complex",style:{gap:8},children:[(0,a.jsx)(i.Checkbox,{name:`${s()}Enabled`,checked:null!==e(),onChange:e=>t(e?w:null),children:(0,a.jsx)(g,{content:"maxMailLimitText"})}),(0,a.jsx)(i.Input,{name:s,value:w,onChange:e=>{R(e.target.value),t(e.target.value)},size:10,maxLength:"9",disabled:null===e()}),(0,a.jsx)(g,{content:"kbytes"})]})}),null!==u&&(0,a.jsx)(i.FormField,{label:(0,a.jsx)(g,{content:"maxThreadsLimit"}),name:"maxThreadsLimit",children:({getValue:e,setValue:t,getName:s})=>(0,a.jsx)(i.InputNumber,{name:s(),value:e(),onChange:t,min:1,max:32})}),(0,a.jsx)(i.FormField,{label:(0,a.jsx)(g,{content:"tag"}),name:"tag",children:({getValue:e,setValue:t,getName:s})=>(0,a.jsxs)("div",{className:"server-mail-spam-filter-form-field-complex",style:{gap:8},children:[(0,a.jsx)(i.Checkbox,{name:`${s()}Enabled`,checked:null!==e(),onChange:e=>t(e?k:null),children:(0,a.jsx)(g,{content:"byTag"})}),(0,a.jsx)(i.Input,{name:s,value:k,onChange:e=>{E(e.target.value),t(e.target.value)},size:"xl",maxLength:"50",disabled:null===e()})]})}),null!==j&&(0,a.jsx)(i.FormFieldText,{label:(0,a.jsx)(g,{content:"alarmMessage"}),name:"alarmMessage",multiline:!0,size:"xl"})]}),(0,a.jsx)(i.FormField,{label:(0,a.jsx)(g,{content:"languages"}),name:"languages",children:({getValue:e,setValue:t,getName:s})=>(0,a.jsx)(i.Select,{name:s(),multiple:!0,searchable:!0,value:e(),onChange:t,size:"xl",children:v.map((({key:e,name:t})=>(0,a.jsx)(i.SelectOption,{value:e,children:t},e)))})}),(0,a.jsx)(i.FormField,{label:(0,a.jsx)(g,{content:"locales"}),name:"locales",children:({getValue:e,setValue:t,getName:s})=>(0,a.jsx)(i.Select,{name:s(),multiple:!0,searchable:!0,value:e(),onChange:t,size:"xl",children:S.map((({key:e,name:t})=>(0,a.jsx)(i.SelectOption,{value:e,children:t},e)))})})]})};h.propTypes={serverMail:u().shape({spamAssassin:u().shape({isEnabled:u().bool.isRequired,isUserSettingsEnabled:u().bool.isRequired,isUserSettingsAllowed:u().bool.isRequired,requiredHits:u().number.isRequired,maxMailLimit:u().number,maxThreadsLimit:u().number,tag:u().string.isRequired,alarmMessage:u().string,languages:u().array.isRequired,locales:u().array.isRequired}).isRequired}).isRequired,capability:u().shape({mailServer:u().shape({isUserSettingsSupported:u().bool.isRequired}).isRequired}).isRequired};const j=h},1804:(e,t,s)=>{s.r(t),s.d(t,{default:()=>x});var i=s(233),n=s(232),a=s(85),l=s(1659),o=s(231),r=s(283),d=s(389),c=s(756);const u=a.Locale.getTranslate("admin.components.lists.servermailblacklist"),m=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
        }
    }
`,b=({blackList:e,spamAssassin:t,isWindows:i,onAddDomain:a})=>{const[r,b]=(0,o.useState)([]),[x,h]=(0,o.useState)([]),j=(0,o.useMemo)((()=>e.filter((({id:e})=>r.includes(e)))),[e,r]),[v]=(0,d.useMutation)(g,{refetchQueries:[{query:s(729)}],awaitRefetchQueries:!0});return(0,o.jsxs)(o.Fragment,{children:[i&&!t?.isEnabled&&(0,o.jsx)(n.StatusMessage,{intent:"warning",children:(0,o.jsx)(u,{content:"spamAssassinDisabled"})}),(0,o.jsx)(l.default,{toolbar:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.ToolbarGroup,{title:p.lmsg("groupAdd"),children:(0,o.jsx)(n.Button,{id:"addBlackListedDomain",intent:"primary",icon:"plus",tooltip:(0,o.jsx)(u,{content:"buttonAddHint"}),"aria-label":p.lmsg("buttonAddHint"),onClick:a})}),(0,o.jsx)(n.ToolbarGroup,{title:p.lmsg("groupActions"),children:(0,o.jsx)(n.ListOperation,{critical:!0,noSelectionText:(0,o.jsx)(u,{content:"removeEmptySelection"}),confirmationText:p.formatMessage("removeConfirmation",{name:(0,o.jsx)("b",{children:j[0]?.name}),count:j.length}),actionButtonText:(0,o.jsx)(m,{content:"yesRemove"}),cancelButtonText:(0,o.jsx)(m,{content:"cancel"}),children:(0,o.jsx)(n.Button,{id:"removeBlackListedDomain",onClick:async()=>{h(r);try{const{data:{deleteBlackListedDomain:{ids:e}}}=await v({variables:{ids:r}});e.length>0&&(0,c.addToast)({intent:"success",message:(0,o.jsx)(u,{content:"removeSuccess"})})}catch({graphQLErrors:e}){e.forEach((({message:e,debugMessage:t})=>{(0,c.addToast)({intent:"danger",message:t||e})}))}finally{b([]),h([])}},children:(0,o.jsx)(u,{content:"buttonRemove"})})})})]}),columns:[{key:"name",title:(0,o.jsx)(u,{content:"entries"}),type:"title",sortable:!0},i&&{key:"action",title:(0,o.jsx)(u,{content:"action"}),sortable:!0,render:({action:e})=>p.lmsg(`${e.toLowerCase()}Action`)}].filter(Boolean),rowKey:"id",data:e,searchField:"name",selection:r,onSelectionChange:e=>b(e),loadingRows:x,emptyView:(0,o.jsx)(n.ListEmptyView,{actions:(0,o.jsx)(n.Button,{id:"addBlackListedDomain",intent:"primary",tooltip:(0,o.jsx)(u,{content:"buttonAddHint"}),onClick:a,children:(0,o.jsx)(u,{content:"buttonAdd"})})})})]})};b.propTypes={blackList:i.PropTypes.array.isRequired,spamAssassin:i.PropTypes.shape({isEnabled:i.PropTypes.bool.isRequired}),isWindows:i.PropTypes.bool,onAddDomain:i.PropTypes.func.isRequired},b.defaultProps={spamAssassin:void 0,isWindows:!1};const x=b},1807:(e,t,s)=>{s.r(t),s.d(t,{default:()=>x});var i=s(233),n=s(232),a=s(85),l=s(1659),o=s(231),r=s(283),d=s(389),c=s(756);const u=a.Locale.getTranslate("admin.components.lists.servermailwhitelist"),m=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
        }
    }
`,b=({whiteList:e,outgoingMessages:t,relay:i,isWindows:a,onAddNetwork:r})=>{const[b,x]=(0,o.useState)([]),[h,j]=(0,o.useState)([]),v=(0,o.useMemo)((()=>e.filter((({id:e})=>b.includes(e)))),[e,b]),S=(0,o.useMemo)((()=>v.filter((({name:e})=>{if(a)return!1;const[t,s]=e.split("/");return"127"===t.substring(0,3)&&+s>=8})).map((({name:e})=>e))),[v,a]),[y]=(0,d.useMutation)(g,{refetchQueries:[{query:s(730)}],awaitRefetchQueries:!0});return(0,o.jsxs)(o.Fragment,{children:[t?.isEnabled&&0!==(i?.noRelayNetworks??[]).length&&(0,o.jsx)(n.StatusMessage,{intent:"warning",children:(0,o.jsx)(u,{content:"whiteListNotEmpty"})}),(0,o.jsx)(l.default,{toolbar:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.ToolbarGroup,{title:p.lmsg("groupAdd"),children:(0,o.jsx)(n.Button,{id:"addWhiteListedNetwork",intent:"primary",icon:"plus",tooltip:(0,o.jsx)(u,{content:"buttonAddHint"}),"aria-label":p.lmsg("buttonAddHint"),onClick:r})}),(0,o.jsx)(n.ToolbarGroup,{title:p.lmsg("groupActions"),children:(0,o.jsx)(n.ListOperation,{critical:!0,noSelectionText:(0,o.jsx)(u,{content:"removeEmptySelection"}),confirmationText:(0,o.jsxs)(o.Fragment,{children:[S.length?(0,o.jsx)(n.StatusMessage,{intent:"warning",children:p.formatMessage(1===v.length?"webmailAffectedSingle":"webmailAffected",{count:S.length,list:S.join(", ")})}):null,p.formatMessage("removeConfirmation",{name:(0,o.jsx)("b",{children:v[0]?.name}),count:v.length})]}),actionButtonText:(0,o.jsx)(m,{content:"yesRemove"}),cancelButtonText:(0,o.jsx)(m,{content:"cancel"}),children:(0,o.jsx)(n.Button,{id:"removeWhiteListedNetwork",onClick:async()=>{j(b);try{const{data:{deleteWhiteListedNetwork:{ids:e}}}=await y({variables:{ids:b}});e.length>0&&(0,c.addToast)({intent:"success",message:(0,o.jsx)(u,{content:"removeSuccess"})})}catch({graphQLErrors:e}){e.forEach((({message:e,debugMessage:t})=>{(0,c.addToast)({intent:"danger",message:t||e})}))}finally{x([]),j([])}},children:(0,o.jsx)(u,{content:"buttonRemove"})})})})]}),columns:[{key:"name",title:(0,o.jsx)(u,{content:"entries"}),type:"title",sortable:!0}],rowKey:"id",data:e,searchField:"name",selection:b,onSelectionChange:e=>x(e),loadingRows:h,emptyView:(0,o.jsx)(n.ListEmptyView,{actions:(0,o.jsx)(n.Button,{id:"addWhiteListedNetwork",intent:"primary",tooltip:(0,o.jsx)(u,{content:"buttonAddHint"}),onClick:r,children:(0,o.jsx)(u,{content:"buttonAdd"})})})})]})};b.propTypes={whiteList:i.PropTypes.array.isRequired,outgoingMessages:i.PropTypes.shape({isEnabled:i.PropTypes.bool}),relay:i.PropTypes.shape({noRelayNetworks:i.PropTypes.array}),isWindows:i.PropTypes.bool,onAddNetwork:i.PropTypes.func.isRequired},b.defaultProps={outgoingMessages:void 0,isWindows:!1,relay:void 0};const x=b},1809:(e,t,s)=>{s.r(t),s.d(t,{default:()=>m});var i=s(85),n=s(282),a=s(790),l=s(1810),o=s(1802),r=s(389),d=s(731),c=s.n(d),u=s(231);const m=(0,a.withPageLayout)((0,o.withServerMailTabs)((()=>{const{data:e}=(0,r.useQuery)(c());return(0,u.jsx)(l.default,{...e})})),(()=>{const{logo:e,showFrames:t,pageHeader:s,pageSidebar:a}=(0,n.default)(),l=[a.isPowerUserPanel?null:{title:i.Locale.getSection("admin.controllers.home.admin").lmsg("title"),href:"/admin/home"},{title:i.Locale.getSection("admin.controllers.server.tools").lmsg("title"),href:"/admin/server/tools"},{title:i.Locale.getSection("admin.controllers.mail-settings.index").lmsg("title"),href:"/cp/server/mail/antivirus"}].filter(Boolean),o=l[l.length-1].title;return{logo:e,showFrames:t,pageHeader:{...s,helpMenu:{...s.helpMenu,helpContext:"mail_antivirus"}},pageSidebar:a,pageContentHeader:{pageTitle:o,breadcrumbs:l},pageTitle:o}}))},1803:(e,t,s)=>{s.r(t),s.d(t,{default:()=>p});var i=s(231),n=s(85),a=s(282),l=s(790),o=s(1804),r=s(1805),d=s(1802),c=s(389),u=s(729),m=s.n(u);const p=(0,l.withPageLayout)((0,d.withServerMailTabs)((()=>{const[e,t]=(0,i.useState)(!1),{data:{serverMail:s,os:{isWindows:n}}}=(0,c.useQuery)(m());return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.default,{isWindows:n,isOpen:e,onClose:()=>t(!1)}),(0,i.jsx)(o.default,{isWindows:n,...s,onAddDomain:()=>t(!0)})]})})),(()=>{const{logo:e,showFrames:t,pageHeader:s,pageSidebar:i}=(0,a.default)(),l=[i.isPowerUserPanel?null:{title:n.Locale.getSection("admin.controllers.home.admin").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/black-list"}].filter(Boolean),o=l[l.length-1].title;return{logo:e,showFrames:t,pageHeader:{...s,helpMenu:{...s.helpMenu,helpContext:"mail_blocked_domains"}},pageSidebar:i,pageContentHeader:{pageTitle:o,breadcrumbs:l},pageTitle:o}}))},1790:(e,t,s)=>{s.r(t),s.d(t,{default:()=>m});var i=s(85),n=s(282),a=s(790),l=s(1791),o=s(1802),r=s(389),d=s(727),c=s.n(d),u=s(231);const m=(0,a.withPageLayout)((0,o.withServerMailTabs)((()=>{const{data:e}=(0,r.useQuery)(c());return(0,u.jsx)(l.default,{...e})})),(()=>{const{logo:e,showFrames:t,pageHeader:s,pageSidebar:a}=(0,n.default)(),l=[a.isPowerUserPanel?null:{title:i.Locale.getSection("admin.controllers.home.admin").lmsg("title"),href:"/admin/home"},{title:i.Locale.getSection("admin.controllers.server.tools").lmsg("title"),href:"/admin/server/tools"},{title:i.Locale.getSection("admin.controllers.mail-settings.index").lmsg("title"),href:"/cp/server/mail/settings"}].filter(Boolean),o=l[l.length-1].title;return{logo:e,showFrames:t,pageHeader:{...s,helpMenu:{...s.helpMenu,helpContext:"mail"}},pageSidebar:a,pageContentHeader:{pageTitle:o,breadcrumbs:l},pageTitle:o}}))},1811:(e,t,s)=>{s.r(t),s.d(t,{default:()=>m});var i=s(85),n=s(282),a=s(790),l=s(1812),o=s(1802),r=s(389),d=s(732),c=s.n(d),u=s(231);const m=(0,a.withPageLayout)((0,o.withServerMailTabs)((()=>{const{data:e}=(0,r.useQuery)(c());return(0,u.jsx)(l.default,{...e})})),(()=>{const{logo:e,showFrames:t,pageHeader:s,pageSidebar:a}=(0,n.default)(),l=[a.isPowerUserPanel?null:{title:i.Locale.getSection("admin.controllers.home.admin").lmsg("title"),href:"/admin/home"},{title:i.Locale.getSection("admin.controllers.server.tools").lmsg("title"),href:"/admin/server/tools"},{title:i.Locale.getSection("admin.controllers.mail-settings.index").lmsg("title"),href:"/cp/server/mail/spam-filter"}].filter(Boolean),o=l[l.length-1].title;return{logo:e,showFrames:t,pageHeader:{...s,helpMenu:{...s.helpMenu,helpContext:"spamassassin"}},pageSidebar:a,pageContentHeader:{pageTitle:o,breadcrumbs:l},pageTitle:o}}))},1806:(e,t,s)=>{s.r(t),s.d(t,{default:()=>p});var i=s(231),n=s(85),a=s(282),l=s(790),o=s(1807),r=s(1808),d=s(1802),c=s(389),u=s(730),m=s.n(u);const p=(0,l.withPageLayout)((0,d.withServerMailTabs)((()=>{const[e,t]=(0,i.useState)(!1),{data:{serverMail:s,os:{isWindows:n},capability:a}}=(0,c.useQuery)(m());return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.default,{...a,isWindows:n,isOpen:e,onClose:()=>t(!1)}),(0,i.jsx)(o.default,{...s,isWindows:n,onAddNetwork:()=>t(!0)})]})})),(()=>{const{logo:e,showFrames:t,pageHeader:s,pageSidebar:i}=(0,a.default)(),l=[i.isPowerUserPanel?null:{title:n.Locale.getSection("admin.controllers.home.admin").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/white-list"}].filter(Boolean),o=l[l.length-1].title;return{logo:e,showFrames:t,pageHeader:{...s,helpMenu:{...s.helpMenu,helpContext:"mail_white_list"}},pageSidebar:i,pageContentHeader:{pageTitle:o,breadcrumbs:l},pageTitle:o}}))},1802:(e,t,s)=>{s.r(t),s.d(t,{default:()=>u,withServerMailTabs:()=>c});var i=s(231),n=s(233),a=s(712),l=s(232),o=s(85),r=s(518);const d=({pathname:e,viewer:{permissions:{manageServerMail:t,manageServerVirusProtection:s,manageServerSpamFilter:n,manageServerMailAutodiscover:d,manageServerMailBlackWhiteLists:c}},capability:{mailServer:{isDomainsBlacklistSupported:u,isSmtpWhiteListSupported:m},packages:{isAntiVirusInstalled:p,isSpamAssassinInstalled:g}},os:{isWindows:b},primaryKey:{keyDrWeb:x,keyQmailQueue:h}})=>{const j=(0,a.useNavigate)(),v=(0,i.useMemo)((()=>[(t||s||n||d)&&{title:o.Locale.getSection("components.pages.server-mail-settings").lmsg("title"),url:"/cp/server/mail/settings",id:"tabSettings"},b&&n&&g&&{title:o.Locale.getSection("components.pages.server-mail-spam-filter").lmsg("title"),url:"/cp/server/mail/spam-filter",id:"tabSpamFilter"},b&&s&&p&&x&&{title:o.Locale.getSection("components.pages.server-mail-antivirus").lmsg("title"),url:"/cp/server/mail/antivirus",id:"tabAntivirus"},c&&u&&{title:o.Locale.getSection("components.pages.server-mail-black-list").lmsg("title"),url:"/cp/server/mail/black-list",id:"tabBlackList"},c&&(!b||g||m)&&{title:o.Locale.getSection("components.pages.server-mail-white-list").lmsg("title"),url:"/cp/server/mail/white-list",id:"tabWhiteList"},!b&&t&&h&&{title:o.Locale.getSection("components.pages.server-mail-queue").lmsg("title"),url:"/admin/mail-settings/queue",id:"tabQueue"},b&&t&&(n&&g||s&&p&&x)&&{title:o.Locale.getSection("components.pages.server-mail-statistics").lmsg("title"),url:"/plesk/server/mail/statistics/",id:"tabStatistics"}].filter(Boolean)),[t,s,n,d,c,g,p,x,h,u,m,b]),S=(0,i.useMemo)((()=>v.findIndex((({url:t})=>t===e))+1),[v,e]);return(0,i.jsx)(l.Tabs,{active:S,children:v.map((({url:e,...t})=>(0,i.jsx)(l.Tab,{onActivate:()=>(0,r.isMatch)(e)?j(e):(0,o.redirect)(e),...t},e)))})};d.propTypes={pathname:n.PropTypes.string.isRequired,viewer:n.PropTypes.shape({permissions:n.PropTypes.object.isRequired}).isRequired,capability:n.PropTypes.shape({mailServer:n.PropTypes.object.isRequired,packages:n.PropTypes.object.isRequired}).isRequired,os:n.PropTypes.shape({isWindows:n.PropTypes.bool.isRequired}).isRequired,primaryKey:n.PropTypes.shape({keyDrWeb:n.PropTypes.bool.isRequired,keyQmailQueue:n.PropTypes.bool.isRequired}).isRequired};const c=e=>{const t=t=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(d,{...t}),(0,i.jsx)(e,{...t})]});return t.displayName=`withServerMailTabs(${e.displayName||e.name||"Component"})`,t.WrappedComponent=e,t},u=d}}]);
//# sourceMappingURL=mail.js.map?65c9933abd616af4cea1