PageSourceSearch

https://app.improvmx.com/assets/DomainCredentials-Z7ZAosHQ.js

js improvmx.com collected 2026-09-25 18:56:54 UTC 17,686 bytes, 1 lines download raw bytes

1import{l as ce,a as xe,r as n,p as pe,q as ue,j as e,L as M,b as P,c as he,h as f,t as d}from"./index-B552Uwma.js";import{u as be}from"./useClickOutside-DGxClyqo.js";import{C as ge}from"./Copy-DSunwen3.js";import{e as ye,E as fe}from"./domainFormatter-C2c6zaqK.js";/* empty css             *//* empty css               */import"./createLucideIcon-CAq11JGB.js";function T(){return Array(12).fill("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789").map(function(m){return m[Math.floor(Math.random()*m.length)]}).join("")}function De(){const{domain:l,records:m,checkDNS:q}=ce(),k=xe(),b="domains/"+l.domain+"/credentials/",[B,S]=n.useState(!0),[u,g]=n.useState(null),[E,C]=n.useState(!1),[c,y]=n.useState(()=>({username:null,password:T(),note:null,is_limited:!0})),[w,D]=n.useState(!1),[G,v]=n.useState(!1),[z,_]=n.useState(null),[h,A]=n.useState(null),[I,F]=n.useState(null),[R,O]=n.useState(null),[K,x]=n.useState("Copy"),$=n.useRef({}),L=n.useRef(null),V=(pe(k)||ue(k))&&k.limits.daily_send>0,U=ye(l.display),Y=()=>{S(!0),f.get(b).then(t=>{g(t.body.credentials),S(!1)},t=>{S(!1),d.error("An error occured. We are sorry about this.")})};n.useEffect(()=>{Y()},[]);const W=()=>{const t="any-alias",r=new Set((u||[]).map(i=>i.username));let s=1;for(;r.has(`${t}-${s}`);)s++;return`${t}-${s}`},H=t=>{const r=t.target.checked;y(s=>({...s,is_limited:!r,username:r?W():""}))},J=()=>{y({username:null,password:T(),note:null,is_limited:!0})},Q=t=>{let r=t.body.credential;r.password=c.password,g(s=>[...s,r]),d.success(`Credential '${r.username}' created! Save your password as it will not be viewable again.`,{position:"top-right"}),J(),t.body.requires_new_mx_check&&(m&&(m.advanced=!0,m.dmarc&&!m.dmarc.expected&&(m.dmarc.expected="v=DMARC1; p=none;")),q().then(s=>{var o,a,p,N;if(!s)return;((o=s.spf)==null?void 0:o.valid)&&((a=s.dkim1)==null?void 0:a.valid)&&((p=s.dkim2)==null?void 0:p.valid)&&((N=s.dmarc)==null?void 0:N.valid)||v(!0)}))},X=t=>{t.preventDefault(),!E&&(C(!0),f.post(b,c).then(r=>{C(!1),Q(r)},r=>{C(!1);let s="An unexpected error occured.";try{s=r.body.errors[Object.keys(r.body.errors)[0]][0]}catch{}d.error(s)}))},Z=t=>{F(I===t?null:t)},j=()=>{F(null)};be(L,j);const ee=(t,r)=>{j(),ne(t.encoded,r)},te=(t,r)=>{j(),O(r),setTimeout(()=>{const s=$.current[r];s&&s.focus&&s.focus()},0)},re=(t,r)=>{j(),oe(t,r)},se=(t,r,s)=>{R===s&&O(null),ie(t,r,s)},ie=(t,r,s)=>{const i=t.target.value.trim()||null;i!==r.note&&f.put(b+r.encoded,{note:i}).then(o=>{g(a=>a.map((p,N)=>N===s?{...p,note:i}:p)),d.success(`Note ${i?"updated":"removed"}!`,{position:"top-right"})},o=>{let a="An unexpected error occured.";try{a=o.body.errors[Object.keys(o.body.errors)[0]][0]}catch{}d.error(a),t.target.value=r.note||""})},ne=(t,r)=>{let s=T();f.put(b+t,{password:s}).then(i=>{g(o=>o.map((a,p)=>p===r?{...a,password:s}:a)),d.success("Password reset! Save your new password as it will not be viewable again.",{position:"top-right"})},i=>{let o="An unexpected error occured.";try{o=i.body.errors[Object.keys(i.body.errors)[0]][0]}catch{}d.error(o)})},ae=(t,r)=>{f.delete(b+t.encoded).then(s=>{g(i=>i.filter((o,a)=>a!==r)),d.error(`SMTP credential '${t.username}' deleted!`,{position:"top-right"})},s=>{d.error("An error occured.")})},oe=(t,r)=>{_(t),A(r),D(!0)},le=()=>{D(!1),_(null),A(null)},de=()=>{z&&h!==null&&(ae(z,h),D(!1),_(null),A(null))},me=t=>{if(navigator.clipboard&&navigator.clipboard.writeText)navigator.clipboard.writeText(t).then(()=>{x("Copied!"),setTimeout(()=>{x("Copy")},2e3)}).catch(()=>{x("Failed!"),setTimeout(()=>{x("Copy")},2e3)});else{const r=document.createElement("textarea");r.value=t,document.body.appendChild(r),r.select();try{document.execCommand("copy"),x("Copied!"),setTimeout(()=>{x("Copy")},2e3)}catch{x("Failed!"),setTimeout(()=>{x("Copy")},2e3)}document.body.removeChild(r)}};return e.jsx("div",{className:"text-sm",children:V?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Use"," ",e.jsx("code",{className:"bg-imx-white text-sm border border-solid border-imx-grey-light px-[5px] py-[2px] rounded-[3px] text-base",children:"smtp.improvmx.com"})," ","and port"," ",e.jsx("code",{className:"bg-imx-white text-sm border border-solid border-imx-grey-light px-[5px] py-[2px] rounded-[3px] text-base",children:"587"})," ","on"," ",e.jsx("code",{className:"bg-imx-white text-sm border border-solid border-imx-grey-light px-[5px] py-[2px] rounded-[3px] text-base",children:"TLS"})," ","when configuring your inbox for SMTP email sending."]}),e.jsxs("p",{children:["Need help? Read our"," ",e.jsxs("a",{className:"text-imx-blue-light hover:text-imx-blue-light-hover",href:"https://improvmx.com/guides/generic-smtp-setup",children:[" ","SMTP Setup Guide."]})]}),!l.active&&u&&u.length!=0&&e.jsxs("div",{className:"bg-imx-red-light text-imx-red py-2.5 px-2.5 text-sm relative my-4 roun
1ded border-[0.5px] border-solid border-imx-red transition-all duration-700 ease-[cubic-bezier(0.19,1,0.22,1)]",children:["DNS records for SMTP not found. Visit the"," ",e.jsx(M,{to:P("dns-settings",{domain:l.domain}),className:"underline text-imx-red hover:text-imx-red-darker",children:"DNS Records"})," ","tab to fix."]}),B?e.jsx("p",{className:"text-imx-grey-medium text-md py-3",children:"Loading the credentials, please wait ..."}):e.jsx(e.Fragment,{children:e.jsxs("ul",{className:"opacity-0 animate-[fadeIn_0.5s_ease-in-out_forwards] transition-all duration-1000 ease-[cubic-bezier(0.19,1,0.22,1)] bg-imx-white rounded border border-imx-grey-light border-solid shadow-md",children:[e.jsxs("div",{className:"border-0 border-b border-solid border-imx-grey-light flex gap-[0.5rem] px-3 py-2 tracking-widest justify-end",children:[e.jsx("li",{className:"inline-block text-right",children:e.jsx("span",{className:"uppercase text-[12px] pr-[0.5rem]",children:"alias"})}),e.jsx("li",{className:"inline-block w-[6rem] sm:w-[10rem] 2xl:w-[20rem]",children:e.jsx("span",{className:"uppercase text-[12px] pl-[5px]",children:"password"})}),e.jsx("li",{className:"inline-block min-w-[5.9rem] text-center",children:e.jsx("span",{className:"uppercase text-[12px]",children:"sends (24h)"})}),e.jsx("div",{className:"min-w-[4rem]"})]}),u&&u.length>0?e.jsx("li",{className:"text-sm",children:e.jsx("div",{className:"border-0 outline-none",children:u.map((t,r)=>e.jsxs("li",{className:"relative gap-[0.5rem] px-3 border-0 border-b border-solid border-imx-grey-light"+(h===r&&w?" bg-imx-red-light pointer-events-none":""),children:[e.jsxs("div",{className:"justify-end relative py-[6px] border-b border-imx-grey-light-medium last:border-b-0 flex items-center gap-[0.5rem]"+(h===r&&w?" confirm-remove":""),children:[e.jsxs("div",{className:"inline-flex gap-[0.5rem] justify-end min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap-reverse justify-end items-center gap-x-[0.5rem] min-w-0",children:[!t.is_limited&&e.jsx("span",{className:"inline-block flex-shrink-0 uppercase text-[10px] tracking-wide font-medium px-[8px] py-[2px] rounded-full bg-imx-grey-lighter text-imx-grey-medium whitespace-nowrap",children:"Any alias"}),e.jsxs("li",{className:"py-1 relative flex flex-col items-end justify-center gap-[4px] min-w-0 sm:min-w-[180px] max-w-full",children:[e.jsxs("span",{className:"cursor-pointer relative group inline-flex items-center min-w-0 max-w-full",onClick:()=>me(t.username+"@"+l.display),children:[e.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap text-imx-black text-right pr-[4px]",children:t.username}),e.jsxs("span",{className:"pr-[0.5rem] whitespace-nowrap flex-shrink-0 hidden md:inline",children:["@",l.display]}),e.jsxs("span",{className:"pr-[0.5rem] whitespace-nowrap flex-shrink-0 inline md:hidden",children:["@",U]}),e.jsx("span",{className:"opacity-0 invisible group-hover:opacity-100 group-hover:visible group-hover:translate-y-[-5px] transition-all duration-700 ease-[cubic-bezier(0.19,1,0.22,1)] absolute left-0 right-0 mx-auto bottom-full mb-[-4px] text-center whitespace-nowrap text-[11px] font-light tracking-wide uppercase translate-y-0 w-fit",children:K})]}),(t.note||R===r)&&e.jsx("input",{ref:s=>$.current[r]=s,type:"text",className:"w-full max-w-full text-right text-xs italic text-imx-grey-medium hover:text-imx-grey-dark focus:not-italic focus:text-imx-black bg-transparent border-0 border-b border-solid border-b-transparent hover:border-b-imx-grey-light-medium focus:border-b-imx-blue-light outline-none p-0 m-0 rounded-none pr-[0.5rem]",placeholder:"note",defaultValue:t.note||"",onBlur:s=>se(s,t,r),onKeyUp:s=>{s.key==="Enter"&&s.target.blur()}},t.note||"")]})]}),e.jsx("li",{className:"w-[6rem] sm:w-[10rem] 2xl:w-[20rem] inline-flex py-1 items-center flex-shrink-0",children:t.password?e.jsx("span",{className:"px-1",children:e.jsx(ge,{value:t.password,labelPosition:"above"})}):e.jsx("span",{className:"px-1 font-mono",children:"**********"})})]}),e.jsx("li",{className:"min-w-[6rem] inline-flex py-2.5 text-right place-content-center",children:t.usage}),e.jsxs("li",{className:"min-w-[3rem] inline-block text-right py-2.5 relative",children:[!(h===r&&w)&&e.jsx("a",{href:"#",onClick:s=>{s.preventDefault(),s.stopPropagation(),Z(r)},className:"ml-4 mr-[8px] align-middle inline-flex items-center justify-center w-9 h-9 p-1.5 rounded transition-all duration-200 ease-in-out","aria-label":"Actions",children:e.jsx(fe,{className:"w-7 h-7 text-imx-grey-light-medium hover:text-imx-grey-medium transition-colors duration-200 ease-in-out"})}),I===r&&e.jsxs("div",{ref:L,className:"absolute right-0 top-[calc(100%+4px)] z-[1000] bg-imx-white border border-solid border-imx-grey-light rounded-md shadow-[0_2px_8px_rgba(0,0,0,0.15)] min-w-[150px] text-left animate-[dropdown-fade_0.2s_ease]",children:[e.jsx("div",{onClick:()=>ee(t,r),className:"text-xs rounded-md my-[5px] mx-[5px] px-[12px] py-[8px] text-imx-grey-medium bg-imx-white cursor-pointer transition-colors duration-200 hover:bg-imx-grey-lighter",children:"Reset password"}),e.jsx("div",{onClick:()=>te(t,r),className:"text-xs rounded-md my-[5px] mx-[5px] px-[12px] py-[8px] text-imx-grey-medium bg-imx-white cursor-pointer transition-colors duration-200 hover:bg-imx-grey-lighter",children:t.note?"Edit note":"Add note"}),e.jsx("div",{className:"h-[1px] bg-imx-grey-light my-[4px]"}),e.jsx("div",{onClick:()=>re(t,r),className:"text-xs rounded-md my-[5px] mx-[5px] px-[12px] py-[8px] text-imx-red bg-imx-white cursor-pointer transition-colors duration-200 hover:bg-imx-red-light",children:"Delete"})]})]})]}),h===r&&w&&e.jsxs("div",{className:"absolute -mt-[20px] flex items-center gap-2 whitespace-nowrap z-10 pointer-events-auto right-5 bg-imx-white px-3 py-2 rounded animate-[fadeIn_0.2s_ease-out] to
1p-1/2 -translate-y-1/2 shadow-lg",children:[e.jsx("span",{className:"text-imx-red text-sm",children:"Delete Credential?"}),e.jsx("button",{className:"outline-none cursor-pointer py-1 px-2.5 rounded border-none bg-imx-green-neon text-white transition-all duration-700 ease-[cubic-bezier(0.19,1,0.22,1)] uppercase text-[11px] tracking-wide hover:bg-imx-green-neon-hover hover:text-white",onClick:de,children:"Yes"}),e.jsx("button",{className:"outline-none cursor-pointer py-1 px-2.5 rounded border-none bg-imx-red text-white transition-all duration-700 ease-[cubic-bezier(0.19,1,0.22,1)] uppercase text-[11px] tracking-wide hover:bg-imx-red-darker hover:text-white",onClick:le,children:"No"})]})]},t.username))})}):e.jsx("li",{className:"text-center py-2 px-10 border-0 border-b border-solid border-imx-grey-light",children:e.jsx("p",{className:"my-2 text-sm",children:"You don't have any SMTP credentials yet."})}),e.jsx("li",{className:"border-0 outline-none bg-imx-grey-lightest rounded-b text-sm",children:e.jsxs("form",{onSubmit:X,className:"border-0 outline-none w-full inline-flex justify-end flex-shrink gap-[0.5rem] px-3 py-2 relative",children:[e.jsxs("div",{className:"flex flex-wrap-reverse justify-end items-end gap-x-[0.5rem] flex-shrink min-w-0",children:[e.jsxs("div",{className:"flex h-[2.5rem] flex-shrink-0 items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:"any-alias-toggle",className:"hidden",checked:!c.is_limited,onChange:H}),e.jsx("label",{htmlFor:"any-alias-toggle",className:"switch cursor-pointer"}),e.jsxs("span",{className:"relative",children:[e.jsx("label",{htmlFor:"any-alias-toggle",className:"uppercase text-[11px] tracking-wide text-imx-grey-medium whitespace-nowrap cursor-pointer",children:"Send as any alias"}),e.jsx("a",{href:"https://improvmx.com/guides/send-from-any-alias",target:"_blank",className:"absolute top-full left-0 mt-[1px] text-[10px] leading-none text-imx-blue-light hover:text-imx-blue-light-hover whitespace-nowrap",children:"Learn more"})]})]}),e.jsxs("div",{className:"relative flex flex-col items-end justify-center gap-[4px] flex-shrink min-w-0 max-w-full overflow-hidden",children:[e.jsxs("li",{className:"py-1 relative inline-flex items-center justify-end min-w-0",children:[e.jsx("input",{type:"text",className:"h-[2rem] m-0 rounded-none p-0 border-0 border-solid border-b border-b-transparent hover:border-b-imx-grey-light-medium focus:border-b-imx-blue-light outline-none bg-transparent text-right pr-[4px] w-[180px] max-w-full "+(c.is_limited?"text-imx-black":"text-imx-grey-medium cursor-not-allowed"),placeholder:"username",required:!0,pattern:"^[^@\\s]+$",readOnly:!c.is_limited,value:c.username||"",onChange:t=>y(r=>({...r,username:t.target.value}))}),e.jsxs("span",{className:"pr-[0.5rem] whitespace-nowrap flex-shrink-0 hidden md:inline",children:["@",l.display]}),e.jsxs("span",{className:"pr-[0.5rem] whitespace-nowrap flex-shrink-0 inline md:hidden",children:["@",U]})]}),e.jsx("input",{type:"text",className:"w-full max-w-full text-right text-xs italic text-imx-grey-medium hover:text-imx-grey-dark focus:not-italic focus:text-imx-black bg-transparent border-0 border-b border-solid border-b-transparent hover:border-b-imx-grey-light-medium focus:border-b-imx-blue-light outline-none p-0 m-0 rounded-none pr-[0.5rem]",placeholder:"Add a note (optional) ",value:c.note||"",onChange:t=>y(r=>({...r,note:t.target.value}))})]})]}),e.jsx("div",{className:"w-[6rem] sm:w-[10rem] 2xl:w-[20rem] inline-flex flex-shrink-0 content-center relative",children:e.jsx("div",{className:"content-center rounded border border-imx-grey-light-medium",children:e.jsx("input",{type:"text",className:"w-full h-[2rem] px-1 m-0 rounded-none p-0 border-0 border-solid border-b border-b-transparent hover:border-b-imx-grey-light-medium focus:border-b-imx-blue-light outline-none bg-transparent text-imx-black",placeholder:"Password",value:c.password||"",onChange:t=>y(r=>({...r,password:t.target.value}))})})}),e.jsx("div",{className:"min-w-[9.5rem] content-center text-end ml-[12px]",children:e.jsx("input",{type:"submit",name:"add",value:"Add",className:"outline-none cursor-pointer py-1.5 px-2.5 rounded border-none bg-imx-green text-white transition-all duration-700 ease-[
1cubic-bezier(0.19,1,0.22,1)] hover:bg-imx-green-darker hover:text-white"+(E?" cursor-wait !bg-imx-grey-light":"")})})]})})]})}),G&&he.createPortal(e.jsxs("div",{className:"fixed inset-0 z-[10000] flex items-center justify-center",children:[e.jsx("div",{className:"absolute inset-0 bg-imx-overlay-background backdrop-blur-sm",onClick:()=>v(!1)}),e.jsxs("div",{className:"relative bg-imx-overlay-modal rounded-xl px-6 py-6 w-full max-w-[400px] mx-4 shadow-imx-box",children:[e.jsx("h3",{className:"text-[16px] font-semibold text-imx-grey-dark m-0 mb-3 text-center",children:"Add DNS records to send"}),e.jsx("p",{className:"text-sm text-imx-grey-medium m-0 mb-5 leading-relaxed text-center",children:"Set up SPF, DKIM, and DMARC — without them, messages may fail or land in spam."}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(M,{to:P("dns-settings",{domain:l.domain}),onClick:()=>v(!1),className:"text-center no-underline outline-none cursor-pointer py-2.5 px-4 rounded-lg border-none bg-imx-green text-imx-white text-[13px] tracking-wide transition-all duration-700 ease-[cubic-bezier(0.19,1,0.22,1)] hover:bg-imx-green-darker hover:text-imx-white",children:"Add DNS records"}),e.jsx("button",{className:"outline-none cursor-pointer py-2.5 px-4 rounded-lg border border-solid border-imx-grey-light-medium bg-transparent text-imx-grey-medium text-[13px] tracking-wide transition-all duration-700 ease-[cubic-bezier(0.19,1,0.22,1)] hover:border-imx-grey-medium hover:text-imx-grey-dark",onClick:()=>v(!1),children:"Do this later"})]})]})]}),document.body)]}):e.jsx("div",{children:e.jsxs("div",{className:"bg-imx-orange-lightest border border-solid border-imx-orange-light text-imx-orange text-[13px] rounded-md pt-5 px-5 pb-3 -mt-0 mb-15 shadow-[0_4px_18px_0_rgba(255,156,0,0.06)]",children:[e.jsx(M,{to:P("payment"),className:"float-right mt-1 h-auto w-auto inline-block px-5 py-2.5 rounded-md border-none bg-imx-orange text-imx-white cursor-pointer transition-all duration-700 ease-[cubic-bezier(0.19,1,0.22,1)] hover:bg-imx-orange-light hover:text-imx-white",children:"Upgrade"}),e.jsx("strong",{className:"m-0 text-[15px]",children:"Upgrade to Premium for $9/m"}),e.jsxs("p",{className:"mt-[5px] mb-[5px] mb-0",children:["Send Emails via"," ",e.jsx("a",{href:"https://improvmx.com/smtp",target:"_blank",className:"text-imx-blue-light hover:text-imx-blue-light-hover",children:"SMTP"}),", More Domains & Aliases, Priority Support, 99% Uptime"]}),e.jsxs("p",{className:"mt-5 mb-0 block text-center text-sm text-imx-red",children:["Alternatively, you can send emails using the free but limited"," ",e.jsx("a",{href:"https://improvmx.com/guides/send-emails-using-gmail/",target:"_blank",className:"text-imx-blue-light",children:"Gmail SMTP technique"})]})]})})})}export{De as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.