<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[iRedMail — RESTFUL API addAlias cross domain]]></title>
	<link rel="self" href="https://forum.iredmail.org/feed-atom-topic21237.xml" />
	<updated>2026-10-28T07:46:31Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.iredmail.org/topic21237-restful-api-addalias-cross-domain.html</id>
		<entry>
			<title type="html"><![CDATA[Re: RESTFUL API addAlias cross domain]]></title>
			<link rel="alternate" href="https://forum.iredmail.org/post92308.html#p92308" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>ZhangHuangbin wrote:</cite><blockquote><p>Could you please show me your full API request code to reproduce the issue? Hide sensitive info before pasting please.</p></blockquote></div><p># 1. Login<br /></p><div class="codebox"><pre><code>curl -k -c /tmp/cookie.txt -X POST https://127.0.0.1/iredadmin/api/login \
  --data-urlencode &#039;username=postmaster@example.local&#039; \
  --data-urlencode &#039;password=******&#039;; echo
  
{&quot;_success&quot;: true}</code></pre></div><p># 2a. Create domain example.com<br /></p><div class="codebox"><pre><code>curl -k -b /tmp/cookie.txt -X POST https://127.0.0.1/iredadmin/api/domain/example.com \
  --data-urlencode &#039;name=example.com&#039; \
  --data-urlencode &#039;quota=0&#039;; echo
  
{&quot;_success&quot;: true}</code></pre></div><p># 2b. Create domain example.net<br /></p><div class="codebox"><pre><code>curl -k -b /tmp/cookie.txt -X POST https://127.0.0.1/iredadmin/api/domain/example.net \
  --data-urlencode &#039;name=example.net&#039; \
  --data-urlencode &#039;quota=0&#039;; echo
  
{&quot;_success&quot;: true}</code></pre></div><p># 3. Create user user@example.com<br /></p><div class="codebox"><pre><code>curl -k -b /tmp/cookie.txt -X POST https://127.0.0.1/iredadmin/api/user/user@example.com \
  --data-urlencode &#039;name=user&#039; \
  --data-urlencode &#039;password=Test@12345678&#039; \
  --data-urlencode &#039;quota=1024&#039;; echo
  
{&quot;_success&quot;: true}</code></pre></div><p># 4. Add cross-domain alias<br /></p><div class="codebox"><pre><code>curl -k -b /tmp/cookie.txt -X PUT https://127.0.0.1/iredadmin/api/user/user@example.com \
  --data-urlencode &#039;addAlias=cross@example.net&#039;; echo
  
{&quot;_success&quot;: true}</code></pre></div><p># 5. Get user details, show only username and aliases<br /></p><div class="codebox"><pre><code>curl -k -s -b /tmp/cookie.txt https://127.0.0.1/iredadmin/api/user/user@example.com | jq &#039;{username: ._data.username, aliases: ._data.aliases}&#039;; echo

{
  &quot;username&quot;: &quot;user@example.com&quot;,
  &quot;aliases&quot;: []
}</code></pre></div><p># 6a. add alias for user@example.com from the iredadmin web manually</p><p># 6b. Get user details, show only username and aliases, after adding manually from iredadmin<br /></p><div class="codebox"><pre><code>curl -k -s -b /tmp/cookie.txt https://127.0.0.1/iredadmin/api/user/user@example.com | jq &#039;{username: ._data.username, aliases: ._data.aliases}&#039;; echo

{
  &quot;username&quot;: &quot;user@example.com&quot;,
  &quot;aliases&quot;: [
    &quot;fromweb@example.net&quot;
  ]
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[beez]]></name>
				<uri>https://forum.iredmail.org/user17056.html</uri>
			</author>
			<updated>2026-10-28T07:46:31Z</updated>
			<id>https://forum.iredmail.org/post92308.html#p92308</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: RESTFUL API addAlias cross domain]]></title>
			<link rel="alternate" href="https://forum.iredmail.org/post92307.html#p92307" />
			<content type="html"><![CDATA[<p>Could you please show me your full API request code to reproduce the issue? Hide sensitive info before pasting please.</p>]]></content>
			<author>
				<name><![CDATA[ZhangHuangbin]]></name>
				<uri>https://forum.iredmail.org/user2.html</uri>
			</author>
			<updated>2026-10-28T07:11:36Z</updated>
			<id>https://forum.iredmail.org/post92307.html#p92307</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[RESTFUL API addAlias cross domain]]></title>
			<link rel="alternate" href="https://forum.iredmail.org/post92306.html#p92306" />
			<content type="html"><![CDATA[<p>==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====<br />- iRedMail version (check /etc/iredmail-release): 1.8.4 mysql<br />- Deployed with iRedMail Easy or the downloadable installer? installer<br />- Linux/BSD distribution name and version: ubuntu 26.04<br />- Store mail accounts in which backend (LDAP/MySQL/PGSQL): mysql<br />- Web server (Apache or Nginx): nginx<br />- Manage mail accounts with iRedAdmin-Pro? yes<br />- [IMPORTANT] Related original log or error message is required if you&#039;re experiencing an issue.<br />====</p><p>api : PUT /api/user/&lt;mail&gt;</p><p>Hello, seems the restful API to add mail alias is not following the setting USER_ALIAS_CROSS_ALL_DOMAINS = True</p><p>using the web admin we can add alias for mail account to different domain, but the API still dropping any different domain alias for user</p>]]></content>
			<author>
				<name><![CDATA[beez]]></name>
				<uri>https://forum.iredmail.org/user17056.html</uri>
			</author>
			<updated>2026-10-28T07:07:22Z</updated>
			<id>https://forum.iredmail.org/post92306.html#p92306</id>
		</entry>
</feed>
