# mail.enable()

Canonical URL: https://developers.iagenify.com/ar/sdk/ref/domain/mail/enable/
Language: ar

`domain.mail.enable({ subdomain?, replace? }) → Promise<Mail>`

يُفضّل كلّ بريد حاجة بوصة نداء واحد: توجيه، المرسل سياسة مفتاح و مُتّحدة سياسة يعمل a أو a مجال عندما a من.

Status: four records, one call · refuses to replace live mail · the key is reused

```javascript
await domain.mail.enable();                         // addresses at @example.com
await domain.mail.enable({ subdomain: "team" });    // at @team.example.com, apex untouched
await domain.mail.enable({ replace: true });        // replace live mail servers — deliberate
```

## لا يمكن استبدال البريد الحي من دون طلب {#live-mx}

> **mail_would_replace_mxمع الخواديم الحالية الملحقة**
>
> جاري عرض بياناتنا على تشكيلات عمل توقف العميل الذي يستلم في الثانية التي يبدأ مفعولها، ويكتشفون في الرسالة الأولى المفقودة. details.current -أعرضها، واعرض طريقين للخروج

```javascript
import { IaGenifyError } from "iagenify";

try {
  await domain.mail.enable();
} catch (err) {
  if (err instanceof IaGenifyError && err.code === "mail_would_replace_mx") {
    console.log("mail currently goes to:", err.details.current);
    await domain.mail.enable({ subdomain: "team" });   // or { replace: true }
  }
}
```

كلا المجالين معظم الناس يُرفقون بالفعل يستلمون البريد في مكان ما. هذه هي الحالة العادية، وليس حالة الحافة.

## القيمة المُعادة {#returns}

```javascript
{
  host: "team.example.com", subdomain: "team",
  mx: [{ name, content, priority }],
  spf: "…", dkim: { selector, publicKey }, dmarc: "…",
  posed: [...], replaced: [...], failed: [...],
  dns: { mxOk, spfOk, dkimOk, dmarcOk },
  ready: true,
}
```

`failed` هو الذي يقرأ : السجل الذي لم يُهبط يعني بريداً لا يعمل ، و الدعوة مرة أخرى لا تشكل سوى ما هو مفقود .

## مضيف، ليس حقل {#host}

والغاية العليا وكل واحد من كل من المجالات الفرعية مهيأة بشكل منفصل، كل على حدة مع سجلاته الخاصة، مفتاحه وسياسته - سياسة على الطرف الأعلى لا تغطي مجالا فرعيا. كلاهما يتعايش.

## يدعوه مرتين لايفعل شيئاً {#idempotent}

تكتب ما هو مفقود. نداء ثان على مضيف مهيأ لا يغير شيئاً، مما يجعله آمناً للهرب من واجهة.

## ما هو مفروض، وما هو السبب في {#content}

- سياسة صارمة لإرسال الرسائل - سياسة لينة تسمح بالابتزاز.
- قائمة المرسل نقاط في اسم لنا، لذلك يمكن أن تتغير التتابع دون لمس منطقة العميل.
- مفتاح توقيع 2048 بت بدون علم اختبار
- سياسة مراقبة: أولا، سياسة صارمة تكسر القوائم البريدية قبل أن ينظر أي شخص في تقرير ما.

- [mail.status()](/ar/sdk/ref/domain/mail/status): -يقرأ الشهود الشهود
- [mail.dmarc()](/ar/sdk/ref/domain/mail/dmarc): -مُتَأَدّد لاحقاً
- [api.mail](/ar/sdk/ref/mail): إنشاء صندوق بريد عليه.

```python
domain.mail.enable()                      # addresses at @example.com
domain.mail.enable(subdomain="team")      # at @team.example.com, apex untouched
domain.mail.enable(replace=True)          # replace live mail servers — deliberate
```

```python
from iagenify import IaGenifyError

try:
    domain.mail.enable()
except IaGenifyError as error:
    if error.code != "mail_would_replace_mx":
        raise
    print("mail currently goes to:", error.details["current"])
    domain.mail.enable(subdomain="team")   # or replace=True
```

```python
{
    "host": "team.example.com", "subdomain": "team",
    "mx": [{"name": ..., "content": ..., "priority": ...}],
    "spf": "…", "dkim": {"selector": ..., "publicKey": ...}, "dmarc": "…",
    "posed": [...], "replaced": [...], "failed": [...],
    "dns": {"mxOk": ..., "spfOk": ..., "dkimOk": ..., "dmarcOk": ...},
    "ready": True,
}
```
