We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
Error: mail alias foo exist
Error: mail alias foo exist
Hi everybody,
Just started using VestaCP and so far, loving it. However, ran across an issue when populating alias entries.
I can populate an account with entries like
Which works perfecly fine, however I can't do the following for some reason
The last entry causes a "Error: mail alias foo exist" error in the interface. I'm hoping this is reproduce-able by others and more importantly, if this is easy to correct or should I start hacking the domains.sh file to get around it?
Thanks in advance
Just started using VestaCP and so far, loving it. However, ran across an issue when populating alias entries.
I can populate an account with entries like
Code: Select all
foo
bar
baz
Code: Select all
foo.bar
foo.baz
foo
Thanks in advance
Re: Error: mail alias foo exist
I'll check it and get back to you soon.
Re: Error: mail alias foo exist
Thanks, looking forward to it.skid wrote:I'll check it and get back to you soon.
Re: Error: mail alias foo exist
Hi Skid,
Testing this further, it appears that "grep -w" seems to match words even with commas (Even though man states "Word-constituent characters are letters, digits, and the underscore.").
I have played a little and the best solution I can come up with is to perform the following. (Only tested on Debian Wheezy (7))
Not sure on the overhead with very large lists (mine has 158 records) and I personally don't like chaining awk into awk but ya get that.
As a note, however, this does produce a correct result in my testing.
Testing this further, it appears that "grep -w" seems to match words even with commas (Even though man states "Word-constituent characters are letters, digits, and the underscore.").
I have played a little and the best solution I can come up with is to perform the following. (Only tested on Debian Wheezy (7))
Code: Select all
# diff -Naur domain.sh.original domain.sh
--- domain.sh.original 2013-12-15 00:33:36.000000000 +1100
+++ domain.sh 2013-12-15 00:54:02.000000000 +1100
@@ -145,8 +145,8 @@
log_event "$E_EXISTS" "$EVENT"
exit $E_EXISTS
fi
- check_als=$(awk -F "ALIAS='" '{print $2}' $USER_DATA/mail/$domain.conf )
- check_als=$(echo "$check_als" | cut -f 1 -d "'" | grep -w $1)
+ check_als=$(awk -F "ALIAS='" '{print $2}' $USER_DATA/mail/$domain.conf |\
+ awk -F "'" '{print $1}' | tr "," "\n" | grep ^$1$ )
if [ ! -z "$check_als" ]; then
echo "Error: mail alias $1 exist"
log_event "$E_EXISTS" "$EVENT"
As a note, however, this does produce a correct result in my testing.
Re: Error: mail alias foo exist
Thanks for the research hrabbit. I've tried to reproduce the error on a fresh Debian 7.1 and it seem to be resolved with the new version of grep
grep (GNU grep) 2.12
Can you please check your current version and let me know if it's lower that 2.12.
Thank you
grep (GNU grep) 2.12
Can you please check your current version and let me know if it's lower that 2.12.
Thank you
Re: Error: mail alias foo exist
Hi Skid,
Just checked my system. (Reverted my changes first).
Performed the norm, update, dist-upgrade, etc. the problem is still present.
I'm running an OpenVZ (Proxmox) container for this and it's not referring to 7.1, just 7. However...
If it works properly in a standalone system but not in a container, not sure where that leaves this problem to be honest. Also, even changing to my code, there isn't anything to say it works in RH(and forks)
Just checked my system. (Reverted my changes first).
Performed the norm, update, dist-upgrade, etc. the problem is still present.
I'm running an OpenVZ (Proxmox) container for this and it's not referring to 7.1, just 7. However...
Code: Select all
# grep --version
grep (GNU grep) 2.12
Code: Select all
# cat /etc/issue.net
Debian GNU/Linux 7
Re: Error: mail alias foo exist
It's weird. OpenVZ shouldn't affect the system. Can you still reproduce the error with latest grep?
Original domain function can be downloaded from githab
Original domain function can be downloaded from githab
Re: Error: mail alias foo exist
Absolutely!skid wrote:It's weird. OpenVZ shouldn't affect the system.
That last test was with the original file in place. I just checked over the same function in github and it certainly matches my original copy that's currently in place.skid wrote:Can you still reproduce the error with latest grep?
Original domain function can be downloaded from githab
Just as a point of interest however, even though I performed an upgrade first, the grep version was already 2.12.
Re: Error: mail alias foo exist
I'm not entirely sure, does it work after upgrade?
Re: Error: mail alias foo exist
Nope, same scenario. Exact same error.skid wrote:I'm not entirely sure, does it work after upgrade?
Using the default code, I have added the following aliases to an account.
foo.bar
foo.baz
Code: Select all
# dpkg -l grep
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-=================================
ii grep 2.12-2 amd64 GNU grep, egrep and fgrep
Code: Select all
# grep --version
grep (GNU grep) 2.12
...
# awk -F "ALIAS='" '{print $2}' /usr/local/vesta/data/users/scott/mail/comsetic.net.conf | cut -f 1 -d "'" | grep -w bar
bar.bar,bar.baz
#
This produced the correct result of course (slight variation on my original post).
Code: Select all
# awk -F "ALIAS='" '{print $2}' /usr/local/vesta/data/users/scott/mail/comsetic.net.conf | cut -f 1 -d "'" | tr "," "\n" |grep ^bar$
#