FutureNet

NXR,VXRシリーズ

REST-API編

8. 各種サービス設定

8-20. メール設定(mail)

 処理概要

メール設定に関する処理を実行します。

 

URIおよびメソッド

機能 Version URI メソッド
POST PUT GET DELETE
MAIL v2 /api/v2/mail
/api/v2/mail/mailto
/api/v2/mail/mailfrom
/api/v2/mail/server
/api/v2/mail/server/{NUM}

凡例:〇対応、-未対応

  • api/v1は対応していません。

 

実行例

宛先メールアドレス設定の更新

メソッド URI
PUT /api/v2/mail/mailto
JSON
リクエスト

PUT /api/v2/mail/mailto
Content-Type: application/json

 

{
"mailto": "admin@example.com"
}

 

レスポンス

204 No content

 

XML
リクエスト

PUT /api/v2/mail/mailto
Content-Type: application/xml

 

<mail>
<mailto>admin@example.com</mailto>
</mail>

 

レスポンス

204 No content

 

宛先メールアドレス設定の取得

メソッド URI
GET /api/v2/mail/mailto
JSON
リクエスト

GET /api/v2/mail/mailto
Accept: application/json

 

レスポンス

200 OK
Content-Type: application/json

 

{
"mailto": "admin@example.com"
}

 

XML
リクエスト

GET /api/v2/mail/mailto
Accept: application/xml

 

レスポンス

200 OK
Content-Type: application/xml

 

<mail>
<mailto>admin@example.com</mailto>
</mail>

 

TEXT/PLAIN
リクエスト

GET /api/v2/mail/mailto
Accept: text/plain

 

レスポンス

200 OK
Content-Type: text/plain

 

mail to admin@example.com

 

宛先メールアドレス設定の削除

メソッド URI
DELETE /api/v2/mail/mailto
リクエスト

DELETE /api/v2/mail/mailto

 

レスポンス

204 No content

 

送信元メールアドレス設定の更新

メソッド URI
PUT /api/v2/mail/mailfrom
JSON
リクエスト

PUT /api/v2/mail/mailfrom
Content-Type: application/json

 

{
"mailfrom": "test@example.com"
}

 

レスポンス

204 No content

 

XML
リクエスト

PUT /api/v2/mail/mailfrom
Content-Type: application/xml

 

<mail>
<mailfrom>test@example.com</mailfrom>
</mail>

 

レスポンス

204 No content

 

送信元メールアドレス設定の取得

メソッド URI
GET /api/v2/mail/mailfrom
JSON
リクエスト

GET /api/v2/mail/mailfrom
Accept: application/json

 

レスポンス

200 OK
Content-Type: application/json

 

{
"mailfrom": "test@example.com"
}

 

XML
リクエスト

GET /api/v2/mail/mailfrom
Accept: application/xml

 

レスポンス

200 OK
Content-Type: application/xml

 

<mail>
<mailfrom>test@example.com</mailfrom>
</mail>

 

TEXT/PLAIN
リクエスト

GET /api/v2/mail/mailfrom
Accept: text/plain

 

レスポンス

200 OK
Content-Type: text/plain

 

mail from test@example.com

 

送信元メールアドレス設定の削除

メソッド URI
DELETE /api/v2/mail/mailfrom
リクエスト

DELETE /api/v2/mail/mailfrom

 

レスポンス

204 No content

 

メールサーバ設定の作成

メソッド URI
POST /api/v2/mail/server
JSON
リクエスト

POST /api/v2/mail/server
Content-Type: application/json

 

{
"server": {
"number": 0,
"auth": "smtp-auth-login",
"smtp": {
"address": "smtp.example.com",
"port": 587
},
"account": {
"username": "test",
"password": {
"passphrase": "testpass"
}
}
}
}

 

レスポンス

201 Created

 

XML
リクエスト

POST /api/v2/mail/server
Content-Type: application/xml

 

<mail>
<server>
<number>0</number>
<auth>smtp-auth-login</auth>
<smtp>
<address>smtp.example.com</address>
<port>587</port>
</smtp>
<account>
<username>test</username>
<password>
<passphrase>testpass</passphrase>
</password>
</account>
</server>
</mail>

 

レスポンス

201 Created

 

全メールサーバ設定の取得

メソッド URI
GET /api/v2/mail/server
JSON
リクエスト

GET /api/v2/mail/server
Accept: application/json

 

レスポンス

200 OK
Content-Type: application/json

 

{
"server": [
{
"number": 0,
"auth": "smtp-auth-login",
"smtp": {
"address": "smtp.example.com",
"port": 587
},
"account": {
"username": "test",
"password": {
"passphrase": "testpass"
}
}
},
{
"number": 1,
・・・・・

 

XML
リクエスト

GET /api/v2/mail/server
Accept: application/xml

 

レスポンス

200 OK
Content-Type: application/xml

 

<mail>
<server>
<number>0</number>
<auth>smtp-auth-login</auth>
<smtp>
<address>smtp.example.com</address>
<port>587</port>
</smtp>
<account>
<username>test</username>
<password>
<passphrase>testpass</passphrase>
</password>
</account>
</server>
<server>
<number>1</number>
・・・・・

 

TEXT/PLAIN
リクエスト

GET /api/v2/mail/server
Accept: text/plain

 

レスポンス

200 OK
Content-Type: text/plain

 

mail server 0
server authentication smtp-auth-login
server smtp address smtp.example.com
server smtp port 587
username test password testpass
mail server 1
・・・・・

 

メールサーバ設定の更新

メソッド URI
PUT /api/v2/mail/server/{NUM}
JSON
リクエスト

PUT /api/v2/mail/server/0
Content-Type: application/json

 

{
"number": 0,
"auth": "smtp-auth-login",
"smtp": {
"address": "smtp.example.com",
"port": 587
},
"account": {
"username": "admin",
"password": {
"passphrase": "adminpass"
}
}
}

 

レスポンス

204 No content

 

XML
リクエスト

PUT /api/v2/mail/server/0
Content-Type: application/xml

 

<server>
<number>0</number>
<auth>smtp-auth-login</auth>
<smtp>
<address>smtp.example.com</address>
<port>587</port>
</smtp>
<account>
<username>admin</username>
<password>
<passphrase>adminpass</passphrase>
</password>
</account>
</server>

 

レスポンス

204 No content

 

メールサーバ設定の取得

メソッド URI
GET /api/v2/mail/server/{NUM}
JSON
リクエスト

GET /api/v2/mail/server/0
Accept: application/json

 

レスポンス

200 OK
Content-Type: application/json

 

{
"number": 0,
"auth": "smtp-auth-login",
"smtp": {
"address": "smtp.example.com",
"port": 587
},
"account": {
"username": "admin",
"password": {
"passphrase": "adminpass"
}
}
}

 

XML
リクエスト

GET /api/v2/mail/server/0
Accept: application/xml

 

レスポンス

200 OK
Content-Type: application/xml

 

<server>
<number>0</number>
<auth>smtp-auth-login</auth>
<smtp>
<address>smtp.example.com</address>
<port>587</port>
</smtp>
<account>
<username>admin</username>
<password>
<passphrase>adminpass</passphrase>
</password>
</account>
</server>

 

TEXT/PLAIN
リクエスト

GET /api/v2/mail/server/0
Accept: text/plain

 

レスポンス

200 OK
Content-Type: text/plain

 

mail server 0
server authentication smtp-auth-login
server smtp address smtp.example.com
server smtp port 587
username admin password adminpass

 

メールサーバ設定の削除

メソッド URI
DELETE /api/v2/mail/server/{NUM}
リクエスト

DELETE /api/v2/mail/server/0

 

レスポンス

204 No content

 

パラメータ

指定可能なパラメータは下記の通りです。

なお指定可能なパラメータは、製品およびファームウェアのバージョンにより異なりますので、各パラメータの詳細については、各製品のユーザーズガイド(CLI版)も合わせてご参照ください。

  • パラメータ表の説明文中の記号について
    < > … 括弧内の値の範囲から選択することを示しています。
    [ ] … 括弧内の値のどれかを選択することを示しています。
  • パラメータ表の説明文中のデータタイプについて
    A.B.C.D … IPv4アドレス
    FQDN … FQDN名

 

パラメータおよびレベル 説明
Lv.1 Lv.2 Lv.3 Lv.4 Lv.5
mail mailto 宛先メールアドレス
mailfrom 送信元メールアドレス
server number メールサーバ設定番号
auth 認証方式 … [pop-before-smtp | smtp-auth-login | smtp-auth-plain] 
smtp address SMTPサーバアドレス … 

  • A.B.C.D
  • FQDN
port ポート番号 … <1-65535>
pop3 address POP3サーバアドレス … 

  • A.B.C.D
  • FQDN
account username ユーザ名
password hidden 暗号化 … [enable | disable] 
passphrase パスワード
apply 暗号化適用 … [enable | disable]
※hidden化する場合は必要