Mail Queue Manager Exim problem

sassou2009

Active Member
May 25, 2009
28
0
51
hey,
i'm having a problem sending messages using webmail and php script (wordpress)

all emails stuck in the mail queue manager:
Mail Queue Manager
Code:
Delivery attempt for Message ID 1PzIJm-0003rl-Ak
Message 1PzIJm-0003rl-Ak is not frozen LOG: MAIN cwd=/usr/local/cpanel/whostmgr/docroot 4 args: /usr/sbin/exim -v -M 1PzIJm-0003rl-Ak delivering 1PzIJm-0003rl-Ak LOG: MAIN PANIC == [email protected] R=lookuphost T=remote_smtp defer (-1): failed to expand "interface" option for remote_smtp transport: failed to open /etc/mailips for linear search: Permission denied (euid=47 egid=12)
please Help :confused:
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
The error message indicates the file having the issue:

failed to open /etc/mailips for linear search: Permission denied
Check /etc/mailips permissions:

Code:
ls -lah /etc/mailips
It should show the following:

Code:
# ls -lah /etc/mailips
-rw-r----- 1 root mail 0 Mar 11 21:40 /etc/mailips
If it does not show root:mail for ownership, then fix that:

Code:
chown root:mail /etc/mailips
If it doesn't show 640 for file permissions, fix that:

Code:
chmod 640 /etc/mailips
If it does have the right ownership and permissions, then next check the file isn't set to be immutable:

Code:
lsattr /etc/mailips
It might look like the following:

Code:
# lsattr /etc/mailips
-------A----- /etc/mailips
An uppercase A is fine. If it has a lowercase i or a lowercase a, then it isn't fine, and those need removed:

Code:
chattr -ia /etc/mailips
 

sassou2009

Active Member
May 25, 2009
28
0
51
thank you very much it works now but i'm getting this error on local emails:

== [email protected] R=localuser T=local_delivery defer (-29): User 0 set for local_delivery transport is on the never_users list
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
That error is only for emails to the root user. Are any emails you send normally actually not working, because that email doesn't impact sending and receiving from normal email users. It's only the root user that is on the never users list and the root user shouldn't be sending and receiving emails normally.
 

acenetryan

Well-Known Member
PartnerNOC
Aug 21, 2005
197
1
168
I'm encountering the same issue as described by the OP.

Code:
2011-06-23 11:00:43 REDACTED == [email protected] R=lookuphost T=remote_smtp defer (-1): failed to expand "interface" option for remote_smtp transport: failed to open /etc/mailips for linear search: Permission denied (euid=47 egid=12)
I'm noticing this error when attempting to send mail through the PHP mail() function through jailshell. Permissions on /etc/mailips are correct.

I've reproduced this behavior on four separate servers.
 

acenetryan

Well-Known Member
PartnerNOC
Aug 21, 2005
197
1
168
The permissions are not the same when viewed through jailshell:

Code:
root@server [~]# su testuser
[email protected] [~]# whoami
testuser
[email protected] [~]# echo $SHELL
/usr/local/cpanel/bin/jailshell
[email protected] [~]# ls -l /etc/mailips
-rw-r----- 1 root root 4516 Jun 23 10:58 /etc/mailips
[email protected] [~]# exit
exit
root@server [~]# whoami
root
root@server [~]# ls -l /etc/mailips
-rw-r----- 1 root mail 4516 Jun 23 00:09 /etc/mailips
 

acenetryan

Well-Known Member
PartnerNOC
Aug 21, 2005
197
1
168
I opened a ticket on this and received the following reply:

Kenneth Smith said:
Hi,

This is happening because php's mail function runs whatever is defined in the sendmail_path, which is going to be /usr/sbin/sendmail by default. That binary SETUIDs it self to mailnull (exim user) but as you pointed out in the thread /etc/mailips is owned by root:root and is not world readable.

UID 47 is mailnull on most every system unless 47 just happen to be taken when cpanel was installed, so maillnull can't read /etc/mailips.

Right now the work around for you would be to give the user a real shell so you're not stuck with the modified permissions mailnull seems to be using when providing access to the file.

I'm opening a ticket with dev now to see if this was intentional for security or if it was overlooked and and should be fixed.

--
Kenneth Smith
Technical Analyst II
cPanel, Inc.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
This isn't technically the same issue as the original poster who was using webmail and WordPress, since those are not jailed shell command line attempts to send mail.

Basically in jailed shell, you have /home/username/virtfs setup as the location for hardlinked files. If you go to /home/testuser/virtfs/etc and list the mailips file, it does have a different date and ownership than the /etc/mailips file. You cannot send emails using PHP mail() function in a jailed shell environment of this nature. You will need to either make this user a non-jailed shell user (regular shell) or send the emails normally using the account (Webmail, email client, PHP mail() function in a script like WordPress) without being in jailed shell command line.

Edit: I didn't realize a reply had already been provided via a ticket as a ticket wasn't mentioned until after I had typed out and posted my reply.