Page 1 of 2

Permissions problem

Posted: Sun Dec 10, 2017 4:27 pm
by avetma
Hello guys,

I am trying to setup a webmail, but I am stuck. First of all, I checked my domain on intodns.com and everything seeems fine. I can login into roundcube without a problem, but when I try to send a mail, I get an error:

Code: Select all

SMTP Error (550): Failed to add recipient "[email protected]" (Verification failed for <[email protected]>
Unrouteable address
Sender verify failed).
I do not receive mails either. Then, I tested my mail address on verifalia.com and I got an error: "The mailbox for the e-mail address does not exist", as if I didn't create that mail account at all!

/var/log/exim/main.log says:

Code: Select all

2017-12-10 17:21:30 failed to expand condition "${if exists{/etc/exim/domains/$domain/fwd_only}{${lookup{$local_part}lsearch{/etc/exim/domains/$domain/fwd_only}{true}{false}}}}" for localuser_fwd_only router: failed to open /etc/exim/domains/myaddress.com/fwd_only for linear search: Permission denied (euid=93 egid=93)
2017-12-10 17:21:30 failed to expand condition "${if eq {${if match{$h_X-Spam-Status:}{\N^Yes\N}{yes}{no}}} {${lookup{$local_part}lsearch{/etc/exim/domains/$domain/passwd}{yes}{no_such_user}}}}" for localuser_spam router: failed to open /etc/exim/domains/myaddress.com/passwd for linear search: Permission denied (euid=93 egid=93)
2017-12-10 17:21:30 failed to expand condition "${lookup{$local_part}lsearch{/etc/exim/domains/$domain/passwd}{true}{false}}" for localuser router: failed to open /etc/exim/domains/myaddress.com/passwd for linear search: Permission denied (euid=93 egid=93)
2017-12-10 17:21:30 H=myaddress.com (localhost) [5.2.64.201] sender verify fail for <[email protected]>: Unrouteable address
2017-12-10 17:21:30 H=myaddress.com (localhost) [5.2.64.201] F=<[email protected]> rejected RCPT <[email protected]>: Sender verify failed
Thank you!

Re: Permissions problem

Posted: Sun Dec 10, 2017 4:40 pm
by vanderheyde

Code: Select all

failed to open /etc/exim/domains/myaddress.com/fwd_only for linear search: Permission denied (euid=93 egid=93)

failed to open /etc/exim/domains/myaddress.com/passwd for linear search: Permission denied (euid=93 egid=93)
can you check the permissions on that folder please?

here are mine:

Code: Select all

root@vm54:~# ls -lah /etc/exim4/domains/example.com/
total 12K
drwxrwx--x  2 Debian-exim mail 4.0K Dec  1 23:31 .
drwxr-xr-x 10 root        root 4.0K Dec  1 23:31 ..
-rw-rw----  1 Debian-exim mail    0 Dec  1 23:31 aliases
-rw-rw----  1 Debian-exim mail    0 Dec  1 23:31 antispam
-rw-rw----  1 Debian-exim mail    0 Dec  1 23:31 antivirus
-rw-rw----  1 Debian-exim mail  887 Dec  1 23:31 dkim.pem
-rw-rw----  1 Debian-exim mail    0 Dec  1 23:31 fwd_only
-rw-rw----  1 dovecot     mail    0 Dec  1 23:31 passwd
also, keep in mind that this is a symink to your /home/$user folder:

Code: Select all

root@vm54:~# ls -lah /etc/exim4/domains/example.com
lrwxrwxrwx 1 root root 32 Dec  1 23:31 /etc/exim4/domains/example.com -> /home/example/conf/mail/example.com

Re: Permissions problem

Posted: Sun Dec 10, 2017 4:52 pm
by avetma
Thanks for a quick reply! Here they are:

Code: Select all

[root@myserver ~]# ls -lah /etc/exim/domains/myserver.com/
total 16K
drwxr-x--- 2 exim    exim    4.0K Dec 10 16:53 .
drwxr-xr-x 6 dovecot dovecot 4.0K Dec  8 12:42 ..
-rw-rw---- 1 exim    exim       0 Dec 10 16:53 aliases
-rw-rw---- 1 dovecot dovecot    0 Nov 24 21:51 antispam
-rw-rw---- 1 dovecot dovecot    0 Nov 24 21:51 antivirus
-rw-rw---- 1 dovecot dovecot  887 Nov 24 21:51 dkim.pem
-rw-rw---- 1 dovecot dovecot    0 Nov 24 21:51 fwd_only
-rw-rw---- 1 dovecot dovecot   72 Dec 10 16:55 passwd

Re: Permissions problem

Posted: Sun Dec 10, 2017 5:03 pm
by vanderheyde
I think that's gonna be the problem.

in my configuration, all the config files belong to the group mail, whereas yours belong to dovecot, resulting in exim not having any permissions. Can you try changing the group of those files?

Re: Permissions problem

Posted: Sun Dec 10, 2017 5:20 pm
by avetma
So, I changed it to this:

Code: Select all

[root@myserver ~]# ls -lah /etc/exim/domains/myserver.com/
total 16K
drwxr-x--- 2 exim    mail 4.0K Dec 10 16:53 .
drwxr-xr-x 6 root    root 4.0K Dec  8 12:42 ..
-rw-rw---- 1 exim    mail    0 Dec 10 16:53 aliases
-rw-rw---- 1 exim    mail    0 Nov 24 21:51 antispam
-rw-rw---- 1 exim    mail    0 Nov 24 21:51 antivirus
-rw-rw---- 1 exim    mail  887 Nov 24 21:51 dkim.pem
-rw-rw---- 1 exim    mail    0 Nov 24 21:51 fwd_only
-rw-rw---- 1 dovecot mail   72 Dec 10 16:55 passwd
And now I can't login to roundcube. "Login failed" is error I get.
/var/log/exim/main.log gives me nothing, but dovecot.log gives me this:

Code: Select all

Dec 10 18:18:29 auth: Error: passwd-file /etc/exim/domains/mydomain.com/passwd: stat(/etc/exim/domains/mydomain.com/passwd) failed: Permission denied (euid=97(dovecot) egid=97(dovecot) missing +x perm: /etc/exim/domains, euid is not dir owner)
Dec 10 18:18:29 auth: Info: passwd-file([email protected],5.2.64.201): no passwd file: /etc/exim/domains/mydomain.com/passwd
Dec 10 18:18:31 imap-login: Info: Disconnected (auth failed, 1 attempts): user=<[email protected]>, method=PLAIN, rip=5.2.64.201, lip=5.2.64.201, secured
I am new at this, so I'm sorry if these are newbie mistakes...

Re: Permissions problem

Posted: Sun Dec 10, 2017 5:24 pm
by vanderheyde
can you try changing only the group?

so:
chown dovecot:mail /etc/exim/domains/myserver.com/passwd (and the same for the other files that were originally owned by dovecot)

Re: Permissions problem

Posted: Sun Dec 10, 2017 5:48 pm
by avetma
Great, that worked! Thank you! I still cannot send mail from roundcube because of error "550 Relay Not Permitted", but I tested in Outlook and it worked just fine both receiving and sending mail. I will figure that out what's wrong with roundcube, thank you.

Re: Permissions problem

Posted: Sun Dec 10, 2017 5:58 pm
by vanderheyde
great!

let me know if you need an extra set of eyes :)

Re: Permissions problem

Posted: Sun Dec 10, 2017 6:22 pm
by avetma
Nah, just took care of it, couple of wrong parameters in roundcube config.inc, thanks.

I just hope I won't need to adjust permissions like this for every domain I create. Let's see. :)

Re: Permissions problem

Posted: Tue Apr 24, 2018 12:40 pm
by almorak
I got the same problem, but how to fix that "550 Relay Not Permitted" / Access denied - Invalid HELO name (See RFC2821 4.1.3))
Someone suggests to comment out the
# drop condition = ${if isip{$sender_helo_name}}
# message = Access denied - Invalid HELO name (See RFC2821 4.1.3)
and restart the exim

But I think it's not a good solution.