# Turn sending on or off for an extra address

`PATCH https://api.mailmasker.org/api/v1/domains/mail-aliases/:source_pattern`

Let an account send from an extra address, or stop it, while its mail keeps arriving.

- Who can use it: Site admins
- Area: Domains and DNS
- Answers 200 OK when it works
- Page: https://developer.mailmasker.org/alias-sending

Only sending changes: mail to the address reaches the account either way, so this can suspend sending without breaking delivery.

## Parameters

| Name | In | Required | What it is | Example |
|---|---|---|---|---|
| `source_pattern` | path | yes | The exact address, or `@` and a domain, as the list shows it. The `@` may be sent as it is or as `%40`. | `sales@example.com` |
| `send_enabled` | body | yes | true to allow sending from it, false to stop it. | `false` |

## Good to know

- An address that isn't on the list answers 404.

## Examples

cURL:

```bash
curl -s -X PATCH 'https://api.mailmasker.org/api/v1/domains/mail-aliases/sales%40example.com' \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"send_enabled":false}'
```

Perl:

```perl
use Mojo::Base -strict;
use Mojo::UserAgent;

my $ua  = Mojo::UserAgent->new;
my $res = $ua->patch('https://api.mailmasker.org/api/v1/domains/mail-aliases/sales%40example.com',
    { Authorization => "Bearer $ENV{TOKEN}" },
    json => { send_enabled => \0 })->result;
die $res->code, ' ', ($res->json('/error') // $res->message), "\n" unless $res->is_success;
print $res->body, "\n";
```

homelab-cli:

```bash
homelab-cli dns mail-aliases disable-send sales@example.com
```

## Response

200 OK:

```json
{
  "id": 5,
  "source_pattern": "sales@example.com",
  "destination": "you@example.com",
  "active": 1,
  "send_enabled": 0,
  "created_by": "you@example.com",
  "created_at": "2026-11-03 21:42:10.123456-06",
  "updated_at": "2026-11-03 21:50:02.654321-06"
}
```
