Topic: I would like to have non list aliases in the alias lists
============ Required information ====
- iRedMail version: 1.9.1
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: CENTOS 6
- Related log if you're reporting an issue:
====
I have many aliases where I do NOT want the to appear in a list to pick from and I have islets = 0 for the alias.
Creating a user account for a non users just does not seem right. Examples are the default email addresses that need to be sent somewhere but EVERY domain would need to have them setup, root, postmaster, webmaster, abuse etc. OR common misspellings of names that should not be in a list, like zhang@example.com will need hang@example.com, zeehang@example.com, zedhang@example.com, zang@example.com, z.hang@example.com just to keep all us English speakers from sending the email to the wrong address and I DO NOT want those to appear in the pick lists when making users and aliases.
How can I get the alias only accounts that are not part of a list to display and be editable.
Here is how I get the list and only these non list aliases.
mysql vmail -e "select username,address,islist from alias A left JOIN mailbox M ON M.username = A.address WHERE islist = '0' and username IS NULL "
I would be happy to pay for this modification as I have to go to the command line to manage this right now.
Here is a quick and dirty way to spit out some HTML to be able to edit but not add the existing nonlist aliases.
TMPFILE="/tmp/nonalias-$$.tmp"
HTMLFILE="/var/www/html/nonlistaliaes.html"
SQL="select address,goto
FROM alias A LEFT JOIN mailbox M ON M.username = A.address
WHERE islist = '0' and username IS NULL "
mysql vmail -e "$SQL" > $TMPFILE
awk 'BEGIN { print "<table>"}
{if ( NR == 1 )
print "<tr><th>"$1"</th><th>" $2"</th></tr>"
else
print "<tr><td><a href=/iredadmin/profile/alias/general/"$1">"$1"</a></td><td>" $2"</td></tr>"
}END { print "</table>"} ' $TMPFILE > $HTMLFILE
rm $TMPFILE
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.