Sync iRedAdmin-Pro API document.

This commit is contained in:
Zhang Huangbin 2017-05-25 10:40:20 +08:00
parent f29215e1f4
commit 8e5a445e51
4 changed files with 69 additions and 177 deletions

View File

@ -12,7 +12,8 @@ export TMP_DIR="${OUTPUT_DIR}/tmp"
export CONVERTER="${ROOTDIR}/tools/markdown2html.py"
export CMD_CONVERT="python ${CONVERTER}"
export CHANGED_FILES="$(hg st | grep '\.md$')"
export CMD_CHECK_CHANGE="hg st"
export CHANGED_FILES="$(${CMD_CHECK_CHANGE} | grep '\.md$')"
export TODAY="$(date +%Y-%m-%d)"
[ -d ${OUTPUT_DIR} ] || mkdir -p ${OUTPUT_DIR}
@ -53,15 +54,21 @@ if echo "$@" | grep -q -- '--all' &>/dev/null; then
fi
article_counter=0
echo -n "* Processing Markdown files: "
for lang in ${all_languages}; do
src_dir="${ROOTDIR}/${lang}"
if [ ! -d ${src_dir} ]; then
echo "* [SKIP] No translation for ${lang} (${src_dir})."
echo "* [SKIP] No translation for language: ${lang}."
break
fi
if ${CMD_CHECK_CHANGE} | grep "${lang}/" &>/dev/null; then
echo "* Change found for language: ${lang}."
else
echo "* [SKIP] No change found for language: ${lang}."
continue
fi
# Generate a Markdown file used to store index of chapters/articles.
if [ X"${lang}" == X'en_US' ]; then
INDEX_MD="${OUTPUT_DIR}/index.md"
@ -283,5 +290,5 @@ fi
# Show changed files.
echo "* Changed files:"
echo "---------------"
hg st
${CMD_CHECK_CHANGE}
echo "---------------"

View File

@ -16,6 +16,8 @@
### iRedAdmin-Pro-SQL-2.7.0, iRedAdmin-Pro-LDAP-2.9.0
* New: Able to manage global, per-domain and per-user greylisting settings,
whitelist senders, and global whitelisted SPF domains.
* Variable names changed in returned JSON data of user profile (`GET /api/user/<mail>`):
* name `forwarding` is replaced by `forwardings`, and it's now a list
object of user forwarding email addresses (was a string, multiple
@ -526,41 +528,19 @@ Notes:
!!! api "`DELETE`{: .delete } `/api/greylisting/<domain>`{: .url } `Delete per-domain greylisting setting`{: .comment }"
!!! api "`DELETE`{: .delete } `/api/greylisting/<mail>`{: .url } `Delete per-user greylisting setting`{: .comment }"
!!! api "`GET`{: .get } `/api/greylisting/global/whitelists`{: .url } `Get globally whitelisted senders for greylisting service`{: .comment }"
!!! api "`POST`{: .post } `/api/greylisting/global/whitelists`{: .url } `Whitelist senders for greylisting service globally`{: .comment } `Parameters`{: .has_params }"
<div class="params">
Parameter | Summary | Sample Usage
--- |--- |---
`whitelistSenderDomains` | Reset whitelisted sender domains for global greylisting service to given sender domains. __Note: given sender domain names are not used directly while checking whitelisting, instead, there's a cron job to query SPF and MX DNS records of given sender domains, then whitelist the IP addresses/networks listed in DNS records.__ Multiple domains must be separated by comma. | `whitelistSenderDomains=iredmail.org,gmail.com`
`addWhitelistSenderDomain` | Add new whitelist sender domains for global greylisting service. __Note: given sender domain names are not used directly while checking whitelisting, instead, there's a cron job to query SPF and MX DNS records of given sender domains, then whitelist the IP addresses/networks listed in DNS records.__ Multiple domains must be separated by comma. | `addWhitelistSenderDomain=iredmail.org,gmail.com`
`removeWhitelistSenderDomain` | Remove existing whitelisted sender domains for global greylisting service. __Note: given sender domain names are not used directly while checking whitelisting, instead, there's a cron job to query SPF and MX DNS records of given sender domains, then whitelist the IP addresses/networks listed in DNS records.__ Multiple domains must be separated by comma. | `removeWhitelistSenderDomain=iredmail.org,gmail.com`
`whitelistSenders` | Reset whitelisted senders for global greylisting service to given senders. Multiple addresses must be separated by comma. Conflicts with parameter `addWhitelistSender` and `removeWhitelistSender`. | `whitelistSenders=192.168.1.0/24,172.16.10.1,@example.com`
`addWhitelistSender` | Whitelist new senders for greylisting service globally. Multiple addresses must be separated by comma. Conflicts with parameter `whitelistSenders`. | `addWhitelistSender=192.168.1.0/24,@example.com`
`removeWhitelistSender` | Remove existing whitelisted senders for greylisting service globally. Multiple addresses must be separated by comma. Conflicts with parameter `whitelistSenders`. | `removeWhitelistSender=192.168.1.0/24,@example.com`
Valid sender address formats:
Sender Address | Comment
---|---
`192.168.2.10` | Single IP address
`192.168.1.0/24` | CIDR network
`user@example.com` | Single email address
`@example.com` | Entire domain
`@.example.com` | Entire domain and all its sub-domains
</div>
!!! api "`GET`{: .get } `/api/greylisting/<domain>/whitelists`{: .url } `Get whitelisted senders for greylisting service for specified domain`{: .comment }"
!!! api "`POST`{: .post } `/api/greylisting/<domain>/whitelists`{: .url } `Whitelist senders for greylisting service for specified domain`{: .comment } `Parameters`{: .has_params }"
!!! api "`GET`{: .get } `/api/greylisting/<mail>/whitelists`{: .url } `Get whitelisted senders for greylisting service for specified user`{: .comment }"
!!! api "`POST`{: .post } `/api/greylisting/global/whitelists`{: .url } `Whitelist senders for greylisting service globally`{: .comment } `Parameters`{: .has_params_greylisting_whitelists }"
!!! api "`POST`{: .post } `/api/greylisting/<domain>/whitelists`{: .url } `Whitelist senders for greylisting service for specified domain`{: .comment } `Parameters`{: .has_params_greylisting_whitelists }"
!!! api "`POST`{: .post } `/api/greylisting/<mail>/whitelists`{: .url } `Whitelist senders for greylisting services for specified user`{: .comment } `Parameters`{: .has_params_greylisting_whitelists }"
<div class="params">
<div class="params params_greylisting_whitelists">
Parameter | Summary | Sample Usage
--- |--- |---
`whitelistSenders` | Reset whitelisted senders for __per-domain__ greylisting service to given senders. Multiple addresses must be separated by comma. Conflicts with parameter `addWhitelistSender` and `removeWhitelistSender`. | `whitelistSenders=192.168.1.0/24,172.16.10.1`
`addWhitelistSender` | Whitelist new senders for __per-domain__ greylisting service. Multiple addresses must be separated by comma. Conflicts with parameter `whitelistSenders`. | `addWhitelistSender=192.168.1.0/24`
`removeWhitelistSender` | Remove existing whitelisted senders for __per-domain__ greylisting service. Multiple addresses must be separated by comma. Conflicts with parameter `whitelistSenders`. | `removeWhitelistSender=192.168.1.0/24`
`whitelistSenders` | Reset whitelisted senders for global greylisting service to given senders. Multiple addresses must be separated by comma. Conflicts with parameter `addWhitelistSender` and `removeWhitelistSender`. | `whitelistSenders=192.168.1.0/24,172.16.10.1,@example.com`
`addWhitelistSenders` | Whitelist new senders for greylisting service globally. Multiple addresses must be separated by comma. Conflicts with parameter `whitelistSenders`. | `addWhitelistSender=192.168.1.0/24,@example.com`
`removeWhitelistSenders` | Remove existing whitelisted senders for greylisting service globally. Multiple addresses must be separated by comma. Conflicts with parameter `whitelistSenders`. | `removeWhitelistSender=192.168.1.0/24,@example.com`
Valid sender address formats:
@ -574,26 +554,23 @@ Notes:
</div>
!!! api "`GET`{: .get } `/api/greylisting/<mail>/whitelists`{: .url } `Get whitelisted senders for greylisting service for specified user`{: .comment }"
!!! api "`POST`{: .post } `/api/greylisting/<mail>/whitelists`{: .url } `Whitelist senders for greylisting services for specified user`{: .comment } `Parameters`{: .has_params }"
!!! api "`POST`{: .post } `/api/greylisting/whitelist_spf_domains`{: .url } `Whitelist IP addresses and networks listed in SPF/MX DNS record of given sender domains for greylisting service globally`{: .comment } `Parameters`{: .has_params }"
<div class="params">
Given sender domain names are not used directly while checking whitelisting, instead, there's a cron job to query SPF and MX DNS records of given sender domains, then whitelist the IP addresses/networks listed in DNS records.
Multiple domains must be separated by comma.
Parameter | Summary | Sample Usage
--- |--- |---
`whitelistSenders` | Reset whitelisted senders for __per-user__ greylisting service to given senders. Multiple addresses must be separated by comma. Conflicts with parameter `addWhitelistSender` and `removeWhitelistSender`. | `whitelistSenders=192.168.1.0/24,172.16.10.1`
`addWhitelistSender` | Whitelist new senders for __per-user__ greylisting service. Multiple addresses must be separated by comma. Conflicts with parameter `whitelistSenders`. | `addWhitelistSender=192.168.1.0/24`
`removeWhitelistSender` | Remove existing whitelisted senders for __per-user__ greylisting service. Multiple addresses must be separated by comma. Conflicts with parameter `whitelistSenders`. | `removeWhitelistSender=192.168.1.0/24`
`domains` | Reset whitelisted sender domains for global greylisting service to given sender domains. Conflicts with parameters `addDomains` and `removeDomains`. | `domains=iredmail.org,gmail.com`
`addDomains` | Add new whitelist sender domains for global greylisting service. Conflicts with parameter `domains`. | `addDomains=iredmail.org,gmail.com`
`removeDomains` | Remove existing whitelisted sender domains for global greylisting service. Conflicts with parameter `domains`. | `removeDomains=iredmail.org,gmail.com`
Valid sender address formats:
Sender Address | Comment
---|---
`192.168.2.10` | Single IP address
`192.168.1.0/24` | CIDR network
`user@example.com` | Single email address
`@example.com` | Entire domain
`@.example.com` | Entire domain and all its sub-domains
<!--
`query_dns_immediately` | Query SPF/MX/A DNS records of given sender domains immediately, and whitelist returned IP/networks | `query_dns_immediately=yes`
-->
</div>
@ -639,6 +616,7 @@ $(document).ready(function(){
/* Expand/Collapse specific parameters */
$('.has_params_throttle').bind('click', function(){$('.params_throttle').toggle();});
$('.has_params_greylisting').bind('click', function(){$('.params_greylisting').toggle();});
$('.has_params_greylisting_whitelists').bind('click', function(){$('.params_greylisting_whitelists').toggle();});
$('.has_params_spampolicy').bind('click', function(){$('.params_spampolicy').toggle();});
});
</script>

View File

@ -402,6 +402,7 @@ button, .button { font-size: 16px; padding: 5px 5px 5px 5px; }
.api code.has_params,
.api code.has_params_throttle,
.api code.has_params_greylisting,
.api code.has_params_greylisting_whitelists,
.api code.has_params_spampolicy
{
display: inline-block;
@ -417,6 +418,7 @@ button, .button { font-size: 16px; padding: 5px 5px 5px 5px; }
.api code.has_params,
.api code.has_params_throttle,
.api code.has_params_greylisting,
.api code.has_params_greylisting_whitelists,
.api code.has_params_spampolicy
{
background-color: #0064cd;

View File

@ -64,6 +64,8 @@
<h2 id="changelog">ChangeLog</h2>
<h3 id="iredadmin-pro-sql-270-iredadmin-pro-ldap-290">iRedAdmin-Pro-SQL-2.7.0, iRedAdmin-Pro-LDAP-2.9.0</h3>
<ul>
<li>New: Able to manage global, per-domain and per-user greylisting settings,
whitelist senders, and global whitelisted SPF domains.</li>
<li>Variable names changed in returned JSON data of user profile (<code>GET /api/user/&lt;mail&gt;</code>):<ul>
<li>name <code>forwarding</code> is replaced by <code>forwardings</code>, and it's now a list
object of user forwarding email addresses (was a string, multiple
@ -1405,8 +1407,20 @@ please use mail alias account as mailing list.</p>
<p class="admonition-title"><code class="get">GET</code> <code class="url">/api/greylisting/global/whitelists</code> <code class="comment">Get globally whitelisted senders for greylisting service</code></p>
</div>
<div class="admonition api">
<p class="admonition-title"><code class="post">POST</code> <code class="url">/api/greylisting/global/whitelists</code> <code class="comment">Whitelist senders for greylisting service globally</code> <code class="has_params">Parameters</code></p>
<div class="params">
<p class="admonition-title"><code class="get">GET</code> <code class="url">/api/greylisting/&lt;domain&gt;/whitelists</code> <code class="comment">Get whitelisted senders for greylisting service for specified domain</code></p>
</div>
<div class="admonition api">
<p class="admonition-title"><code class="get">GET</code> <code class="url">/api/greylisting/&lt;mail&gt;/whitelists</code> <code class="comment">Get whitelisted senders for greylisting service for specified user</code></p>
</div>
<div class="admonition api">
<p class="admonition-title"><code class="post">POST</code> <code class="url">/api/greylisting/global/whitelists</code> <code class="comment">Whitelist senders for greylisting service globally</code> <code class="has_params_greylisting_whitelists">Parameters</code></p>
</div>
<div class="admonition api">
<p class="admonition-title"><code class="post">POST</code> <code class="url">/api/greylisting/&lt;domain&gt;/whitelists</code> <code class="comment">Whitelist senders for greylisting service for specified domain</code> <code class="has_params_greylisting_whitelists">Parameters</code></p>
</div>
<div class="admonition api">
<p class="admonition-title"><code class="post">POST</code> <code class="url">/api/greylisting/&lt;mail&gt;/whitelists</code> <code class="comment">Whitelist senders for greylisting services for specified user</code> <code class="has_params_greylisting_whitelists">Parameters</code></p>
<div class="params params_greylisting_whitelists">
<table>
<thead>
@ -1418,32 +1432,17 @@ please use mail alias account as mailing list.</p>
</thead>
<tbody>
<tr>
<td><code>whitelistSenderDomains</code></td>
<td>Reset whitelisted sender domains for global greylisting service to given sender domains. <strong>Note: given sender domain names are not used directly while checking whitelisting, instead, there's a cron job to query SPF and MX DNS records of given sender domains, then whitelist the IP addresses/networks listed in DNS records.</strong> Multiple domains must be separated by comma.</td>
<td><code>whitelistSenderDomains=iredmail.org,gmail.com</code></td>
</tr>
<tr>
<td><code>addWhitelistSenderDomain</code></td>
<td>Add new whitelist sender domains for global greylisting service. <strong>Note: given sender domain names are not used directly while checking whitelisting, instead, there's a cron job to query SPF and MX DNS records of given sender domains, then whitelist the IP addresses/networks listed in DNS records.</strong> Multiple domains must be separated by comma.</td>
<td><code>addWhitelistSenderDomain=iredmail.org,gmail.com</code></td>
</tr>
<tr>
<td><code>removeWhitelistSenderDomain</code></td>
<td>Remove existing whitelisted sender domains for global greylisting service. <strong>Note: given sender domain names are not used directly while checking whitelisting, instead, there's a cron job to query SPF and MX DNS records of given sender domains, then whitelist the IP addresses/networks listed in DNS records.</strong> Multiple domains must be separated by comma.</td>
<td><code>removeWhitelistSenderDomain=iredmail.org,gmail.com</code></td>
</tr>
<tr>
<td><code>whitelistSenders</code></td>
<td>Reset whitelisted senders for global greylisting service to given senders. Multiple addresses must be separated by comma. Conflicts with parameter <code>addWhitelistSender</code> and <code>removeWhitelistSender</code>.</td>
<td><code>whitelistSenders=192.168.1.0/24,172.16.10.1,@example.com</code></td>
</tr>
<tr>
<td><code>addWhitelistSender</code></td>
<td><code>addWhitelistSenders</code></td>
<td>Whitelist new senders for greylisting service globally. Multiple addresses must be separated by comma. Conflicts with parameter <code>whitelistSenders</code>.</td>
<td><code>addWhitelistSender=192.168.1.0/24,@example.com</code></td>
</tr>
<tr>
<td><code>removeWhitelistSender</code></td>
<td><code>removeWhitelistSenders</code></td>
<td>Remove existing whitelisted senders for greylisting service globally. Multiple addresses must be separated by comma. Conflicts with parameter <code>whitelistSenders</code>.</td>
<td><code>removeWhitelistSender=192.168.1.0/24,@example.com</code></td>
</tr>
@ -1484,12 +1483,11 @@ please use mail alias account as mailing list.</p>
</div>
<div class="admonition api">
<p class="admonition-title"><code class="get">GET</code> <code class="url">/api/greylisting/&lt;domain&gt;/whitelists</code> <code class="comment">Get whitelisted senders for greylisting service for specified domain</code></p>
</div>
<div class="admonition api">
<p class="admonition-title"><code class="post">POST</code> <code class="url">/api/greylisting/&lt;domain&gt;/whitelists</code> <code class="comment">Whitelist senders for greylisting service for specified domain</code> <code class="has_params">Parameters</code></p>
<p class="admonition-title"><code class="post">POST</code> <code class="url">/api/greylisting/whitelist_spf_domains</code> <code class="comment">Whitelist IP addresses and networks listed in SPF/MX DNS record of given sender domains for greylisting service globally</code> <code class="has_params">Parameters</code></p>
<div class="params">
<p>Given sender domain names are not used directly while checking whitelisting, instead, there's a cron job to query SPF and MX DNS records of given sender domains, then whitelist the IP addresses/networks listed in DNS records.</p>
<p>Multiple domains must be separated by comma.</p>
<table>
<thead>
<tr>
@ -1500,120 +1498,26 @@ please use mail alias account as mailing list.</p>
</thead>
<tbody>
<tr>
<td><code>whitelistSenders</code></td>
<td>Reset whitelisted senders for <strong>per-domain</strong> greylisting service to given senders. Multiple addresses must be separated by comma. Conflicts with parameter <code>addWhitelistSender</code> and <code>removeWhitelistSender</code>.</td>
<td><code>whitelistSenders=192.168.1.0/24,172.16.10.1</code></td>
<td><code>domains</code></td>
<td>Reset whitelisted sender domains for global greylisting service to given sender domains. Conflicts with parameters <code>addDomains</code> and <code>removeDomains</code>.</td>
<td><code>domains=iredmail.org,gmail.com</code></td>
</tr>
<tr>
<td><code>addWhitelistSender</code></td>
<td>Whitelist new senders for <strong>per-domain</strong> greylisting service. Multiple addresses must be separated by comma. Conflicts with parameter <code>whitelistSenders</code>.</td>
<td><code>addWhitelistSender=192.168.1.0/24</code></td>
<td><code>addDomains</code></td>
<td>Add new whitelist sender domains for global greylisting service. Conflicts with parameter <code>domains</code>.</td>
<td><code>addDomains=iredmail.org,gmail.com</code></td>
</tr>
<tr>
<td><code>removeWhitelistSender</code></td>
<td>Remove existing whitelisted senders for <strong>per-domain</strong> greylisting service. Multiple addresses must be separated by comma. Conflicts with parameter <code>whitelistSenders</code>.</td>
<td><code>removeWhitelistSender=192.168.1.0/24</code></td>
<td><code>removeDomains</code></td>
<td>Remove existing whitelisted sender domains for global greylisting service. Conflicts with parameter <code>domains</code>.</td>
<td><code>removeDomains=iredmail.org,gmail.com</code></td>
</tr>
</tbody>
</table>
<p>Valid sender address formats:</p>
<table>
<thead>
<tr>
<th>Sender Address</th>
<th>Comment</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>192.168.2.10</code></td>
<td>Single IP address</td>
</tr>
<tr>
<td><code>192.168.1.0/24</code></td>
<td>CIDR network</td>
</tr>
<tr>
<td><code>user@example.com</code></td>
<td>Single email address</td>
</tr>
<tr>
<td><code>@example.com</code></td>
<td>Entire domain</td>
</tr>
<tr>
<td><code>@.example.com</code></td>
<td>Entire domain and all its sub-domains</td>
</tr>
</tbody>
</table>
</div>
<!--
<code>query_dns_immediately</code> | Query SPF/MX/A DNS records of given sender domains immediately, and whitelist returned IP/networks | <code>query_dns_immediately=yes</code>
-->
</div>
<div class="admonition api">
<p class="admonition-title"><code class="get">GET</code> <code class="url">/api/greylisting/&lt;mail&gt;/whitelists</code> <code class="comment">Get whitelisted senders for greylisting service for specified user</code></p>
</div>
<div class="admonition api">
<p class="admonition-title"><code class="post">POST</code> <code class="url">/api/greylisting/&lt;mail&gt;/whitelists</code> <code class="comment">Whitelist senders for greylisting services for specified user</code> <code class="has_params">Parameters</code></p>
<div class="params">
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Summary</th>
<th>Sample Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>whitelistSenders</code></td>
<td>Reset whitelisted senders for <strong>per-user</strong> greylisting service to given senders. Multiple addresses must be separated by comma. Conflicts with parameter <code>addWhitelistSender</code> and <code>removeWhitelistSender</code>.</td>
<td><code>whitelistSenders=192.168.1.0/24,172.16.10.1</code></td>
</tr>
<tr>
<td><code>addWhitelistSender</code></td>
<td>Whitelist new senders for <strong>per-user</strong> greylisting service. Multiple addresses must be separated by comma. Conflicts with parameter <code>whitelistSenders</code>.</td>
<td><code>addWhitelistSender=192.168.1.0/24</code></td>
</tr>
<tr>
<td><code>removeWhitelistSender</code></td>
<td>Remove existing whitelisted senders for <strong>per-user</strong> greylisting service. Multiple addresses must be separated by comma. Conflicts with parameter <code>whitelistSenders</code>.</td>
<td><code>removeWhitelistSender=192.168.1.0/24</code></td>
</tr>
</tbody>
</table>
<p>Valid sender address formats:</p>
<table>
<thead>
<tr>
<th>Sender Address</th>
<th>Comment</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>192.168.2.10</code></td>
<td>Single IP address</td>
</tr>
<tr>
<td><code>192.168.1.0/24</code></td>
<td>CIDR network</td>
</tr>
<tr>
<td><code>user@example.com</code></td>
<td>Single email address</td>
</tr>
<tr>
<td><code>@example.com</code></td>
<td>Entire domain</td>
</tr>
<tr>
<td><code>@.example.com</code></td>
<td>Entire domain and all its sub-domains</td>
</tr>
</tbody>
</table>
</div>
</div>
@ -1660,6 +1564,7 @@ $(document).ready(function(){
/* Expand/Collapse specific parameters */
$('.has_params_throttle').bind('click', function(){$('.params_throttle').toggle();});
$('.has_params_greylisting').bind('click', function(){$('.params_greylisting').toggle();});
$('.has_params_greylisting_whitelists').bind('click', function(){$('.params_greylisting_whitelists').toggle();});
$('.has_params_spampolicy').bind('click', function(){$('.params_spampolicy').toggle();});
});
</script><div class="footer">