Zentyal Forum, Linux Small Business Server

Zentyal Server => Email and Groupware => Topic started by: Rodney on January 31, 2017, 06:24:24 pm

Title: Zentyal 5 454 4.7.1 relay access denied on virtual domains
Post by: Rodney on January 31, 2017, 06:24:24 pm
Hello all.
I have installed Zentyal 5 and added 3 virtual domains. All mail to the main domain addresses delivers to dovecot fine but any other virtual domain address gets a 454 4.7.1 relay access denied in the log. I can sent from the other virtual domains fine. Any thoughts?
Title: Re: Zentyal 5 454 4.7.1 relay access denied on virtual domains
Post by: bounee on February 08, 2017, 10:25:50 pm
I have the same problem. So far, I could not find a solution. Does anyone have an idea?  :-\
Title: Re: Zentyal 5 454 4.7.1 relay access denied on virtual domains
Post by: J. A. Calvo on February 10, 2017, 10:03:37 am
which version of zentyal-mail are you using?

You can check with apt-cache policy zentyal-mail

thanks!
Title: Re: Zentyal 5 454 4.7.1 relay access denied on virtual domains
Post by: mitko992 on February 10, 2017, 11:07:21 am
My version is 5.0.3. :)
Title: Re: Zentyal 5 454 4.7.1 relay access denied on virtual domains
Post by: Rodney on February 10, 2017, 05:58:09 pm
I am also using 5.0.3.
Where is the apt-cache policy zentyal-mail?
Title: Re: Zentyal 5 454 4.7.1 relay access denied on virtual domains
Post by: branislav.kopun on February 14, 2017, 01:29:22 pm
you must put it in ssh session (not thru web)

user@zentyal:~$ apt-cache policy zentyal-mail
zentyal-mail:
  Installed: 5.0.4
  Candidate: 5.0.4
  Version table:
 *** 5.0.4 500
        500 http://archive.zentyal.org/zentyal 5.0/main amd64 Packages
        500 http://archive.zentyal.org/zentyal 5.0/main i386 Packages
        100 /var/lib/dpkg/status
Title: Re: Zentyal 5 454 4.7.1 relay access denied on virtual domains
Post by: branislav.kopun on February 15, 2017, 09:57:23 am
WORKAROUND - for me was solution to mofify mas template
edit /usr/share/zentyal/stubs/mail/main.cf.mas and add your domain to parameter mydestination

original my destination look like
Code: [Select]
mydestination = $myorigin,$myhostname,localhost,localhost.$mydomain,$mydomain
after change (for domain acme.com)
Code: [Select]
mydestination = $myorigin,$myhostname,localhost,localhost.$mydomain,$mydomain,acme.com
And you need to restart Mail service thru zentyal web dashboard

I think that problem is in parsing $mydomain parameter but I don't know where is it ...
Title: Re: Zentyal 5 454 4.7.1 relay access denied on virtual domains
Post by: nontrivial on February 17, 2017, 09:29:35 pm
I am using zentyal mail version 5.0.4 and I am having the same problem. Unfortunately the workaround isn't working for me. Any ideas?
Title: Re: Zentyal 5 454 4.7.1 relay access denied on virtual domains
Post by: p.surmont on February 18, 2017, 10:20:31 pm
The problem still exist with 5.0.7 version. After upgrading, i had to edit main.cf.mas and add my domains manually again. Of course the work around is working but it s not very practical.

Best regards
Title: Re: Zentyal 5 454 4.7.1 relay access denied on virtual domains
Post by: Neustradamus on February 20, 2017, 01:22:12 pm
Same problem with last Zentyal (updated)
Title: Re: Zentyal 5 454 4.7.1 relay access denied on virtual domains
Post by: timroijers on February 23, 2017, 03:33:46 pm
email sent to an alias email address seems to work just fine.

So for now i assigned the user an email address johndoe@doe.com and provided this user with an alias email address  john@doe.com (the address i actually want).



Title: Re: Zentyal 5 454 4.7.1 relay access denied on virtual domains
Post by: Syntax on February 23, 2017, 08:48:09 pm
email sent to an alias email address seems to work just fine.

The topic is about virtual domains, not email alias'

And yes, same problem here.  I added a second virtual mail domain and get "Relay access denied (in reply to RCPT TO command)"

I have 2 test users one has email addresses from both v-domains and the other for only the 2nd one:
User1@vdomain1.tld --> delivery success
User1@vdomain2.tld --> relay error (unless sent from within mailbox from User1@vdomain1.tld to User1@vdomain2.tld)
User2@vdomain2.tld --> relay error

EDIT: the above is from an outside email.  Zentyal 5.07
Title: Re: Zentyal 5 454 4.7.1 relay access denied on virtual domains
Post by: timroijers on February 23, 2017, 08:57:49 pm
Quote
The topic is about virtual domains, not email alias'

I know... i can read. having the same problem with the virtual domains.
I was providing a workaround, but good luck on your search.
Title: Re: Zentyal 5 454 4.7.1 relay access denied on virtual domains
Post by: Syntax on February 24, 2017, 12:06:02 am

original my destination look like
Code: [Select]
mydestination = $myorigin,$myhostname,localhost,localhost.$mydomain,$mydomain
after change (for domain acme.com)
Code: [Select]
mydestination = $myorigin,$myhostname,localhost,localhost.$mydomain,$mydomain,acme.com

Going off of what branislav.kopun wrote I started poking around in the stubs.  His workaround still works (just added a comma and typed in the name of my virtual domain on the end), but I wanted to figure out what variable was missing. 

Haven't found anything yet, several spots refer to objectClass=CourierVirtualDomain (and CourierMailAlias etc...) when Dovecot is installed instead of Courier, but changing that didn't seem to have any effect.

I tried guessing at the variable name (assuming that was what was missing) and it's not $vdomain, $vdomains, $vdomainsCfFile, or $virtual_mailbox_domains (all of which were things I came across in the files and decided to try).  I thought that last one would work, because it looked to be formatted the same way as some of the other declarations in the main.cf.mas

Speaking of formatting, I compared the vdomains.cf.mas and the valiases.cf.mas files and found the "query_filter = " line backwards in vdomains compared to valiases and tried flipping it around, but no dice.



SHORT VERSION:
branislav.kopun's workaround of manually putting in the virtual domain still works.
I tried a bunch of stuff to find the problem (missing parameter?) that didn't solve it.
Title: Re: Zentyal 5 454 4.7.1 relay access denied on virtual domains
Post by: timroijers on February 25, 2017, 07:42:41 pm
Quote
SHORT VERSION:
branislav.kopun's workaround of manually putting in the virtual domain still works.

added my domain name in /usr/share/zentyal/stubs/mail/main.cf.mas, rebooted the server.
checked /etc/postfix/main.cf and can see my domain name is added to my destinations.
Still cannot send and/or receive any mails, so back to my Zentyal 4.0 for now.
Title: Re: Zentyal 5 454 4.7.1 relay access denied on virtual domains
Post by: happnatious1 on February 27, 2017, 04:07:18 am
WORKAROUND - for me was solution to mofify mas template
edit /usr/share/zentyal/stubs/mail/main.cf.mas and add your domain to parameter mydestination

original my destination look like
Code: [Select]
mydestination = $myorigin,$myhostname,localhost,localhost.$mydomain,$mydomain
after change (for domain acme.com)
Code: [Select]
mydestination = $myorigin,$myhostname,localhost,localhost.$mydomain,$mydomain,acme.com
And you need to restart Mail service thru zentyal web dashboard

I think that problem is in parsing $mydomain parameter but I don't know where is it ...

This worked for me, Thanks!
Title: Re: Zentyal 5 454 4.7.1 relay access denied on virtual domains
Post by: J. A. Calvo on February 27, 2017, 10:59:47 pm
In the new zentyal-mail 5.0.5 domains are explicitly added to mydestination in main.cf, could you please confirm if upgrading to the new version solves the issue without having to modify the template manually? Thanks!
Title: Re: Zentyal 5 454 4.7.1 relay access denied on virtual domains
Post by: timroijers on March 01, 2017, 12:01:29 am
confirmed!

/etc/postfix/main.cf is now updated without manually adding it to the stubs file.
Title: Re: Zentyal 5 454 4.7.1 relay access denied on virtual domains
Post by: happnatious1 on March 01, 2017, 01:41:33 am
Just updated and rebooted and I'm still getting mail from my one and only virtual domain.  Mark it [SOLVED]?   :-\
Title: Re: Zentyal 5 454 4.7.1 relay access denied on virtual domains
Post by: nontrivial on March 01, 2017, 03:18:26 pm
I was always getting mail to the virtual domains, my problem was virtual domain aliases. How it used to work is if you had a.com as virtual domain you could add aliases for b.com and c.com an email to x@b.com and x@c.com would be delivered to x@a.com. That hasn't worked for me since upgrading to 5.0.
Title: Re: Zentyal 5 454 4.7.1 relay access denied on virtual domains
Post by: itmakovec on March 10, 2017, 04:24:55 pm
5.0.5 adding <% join(',', @vdomains) %> , which apparently solved this issue for you, has broken something else for me
Quote
Mar 10 15:32:28 posta postfix/smtpd[15614]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 550 5.1.1 <user@virtual-domain>: Recipient address rejected: User unknown in local recipient table;
my solution: removing vdomains from mydestination https://forum.zentyal.org/index.php/topic,4688.msg105749.html#msg105749
found another IMHO related alternate solution: https://tracker.zentyal.org/issues/5239

Kindly advice, please.