Page 2 of 2

Re: Forwarding mail addresses

Posted: Mon Apr 06, 2015 2:13 pm
by YoloDude87
Aight people listen up. I think I found the cause of the issue why "Do not store forwarded email" isn't working properly.

If we check the fwd_only file in in $HOMEDIR/$user/conf/mail/$domain/fwd_only, we see it only holds 1 entry max. If we add another forward only account in the GUI, we see that LAST entry. Now after some debugging, I found out that if you add or edit something in the GUI, the following command is called:

v-add-mail-account-fwd-only USER DOMAIN ACCOUNT

Now if we open this file in /usr/local/vesta/bin/v-add-mail-account-fwd-only we see the following line somewhere near the end:

$account" > $HOMEDIR/$user/conf/mail/$domain/fwd_only

Aha! It overwrites the file instead of appending the new account. All we need to do is change > to >>. We can do this with the following command:

sed -i 's/echo "$account" > $HOMEDIR\/$user\/conf\/mail\/$domain\/fwd_only/echo "$account" >> $HOMEDIR\/$user\/conf\/mail\/$domain\/fwd_only/g' /usr/local/vesta/bin/v-add-mail-account-fwd-only

Eh voila, email forwarding only fixed (at least for me). Try it out and see if it works. And I hope the developers can change this in the real code :)

P.S.: This might be why it seemed to work for some people who only test with 1 account (cause yeah, it works for one account, just not multiple :) )

Re: Forwarding mail addresses

Posted: Fri May 15, 2015 4:37 pm
by fedekrum
It looks YoloDude87 is right.
Are you admins planning to introduce this fix in next release?

thanks

Re: Forwarding mail addresses

Posted: Tue Aug 25, 2015 6:04 pm
by desertflyer
Is there any update on this? It looks like this is still a problem.

Re: Forwarding mail addresses

Posted: Sat Nov 14, 2015 7:10 pm
by Pong
I'm on version: 0.9.8, release 15.

File /usr/local/vesta/bin/v-add-mail-account-fwd-only now has this code:
$account" > $HOMEDIR/$user/conf/mail/$domain/fwd_only

Re: Forwarding mail addresses

Posted: Wed Jan 06, 2016 11:33 am
by arafatx
still doesn't forward email.

Re: Forwarding mail addresses

Posted: Wed Jan 06, 2016 2:18 pm
by tjebbeke
arafatx wrote:still doesn't forward email.
Create bug https://bugs.vestacp.com/

Re: Forwarding mail addresses

Posted: Fri Jan 08, 2016 4:37 pm
by arafatx
tjebbeke wrote:
arafatx wrote:still doesn't forward email.
Create bug https://bugs.vestacp.com/
Well, currently I'm able to forward mail within my mail in roundcube not the external email like Gmail. So, this is my temporary solution without having to open every email that I created. Example, in a business hosting we would have [email protected], [email protected], [email protected].. etc that would be time consuming to check every mail each day.

Re: Forwarding mail addresses

Posted: Fri Jan 22, 2016 2:52 pm
by atonit