view relayers - cpanel user and smtp

sorcier

Member
Apr 16, 2005
8
0
151
WHM has the option: view relayers

Previously all sending through smtp appeared with the real user (user1, user2... ). Now all the sending through smtp (tcp 25) appear with the user "cpanel". This is correct? It affects to the bandwidth measurements of each user?

Code:
Top Email Relayers

Below are list of users who have relayed mail. They are listed in the order by
number of messages sent. You can click on the user/domain to view who 
they sent the messages to. 

User 	    	Domain 			Messages Sent 	Total Bytes Sent
cpanel 						84 		96448516
conxxx	        conxxxx.com 			7		11157
freshxxx	freshxxxx.com 	   		7		16954
elaxxx 		ela.xxx 			5	 	3773
root 						5 		50689
fiduxxxxc 	fiduxxxx.com 			3		8063
.
.
.
.
These 84 (more less) emails are greater to megabayte and are of a single user "elaxxx" but they are seen like sended by cpanel and not like sended by "elaxxx".

The other 5 messages of "elaxxx" are through webmail (phpsuexec).

This is correct? It affects to the bandwidth measurements of each user?
 

Ali

Well-Known Member
Jul 12, 2003
52
0
156
Hi,

We are facing the same issue for over a month now. Anyone with a solution fix ?
 

swampy

Well-Known Member
Jan 30, 2004
148
0
166
I am also experiencing this also on one server where the domain name should be it is displaying the customers username not the domain name so when I click it I get Invalid user [user domain.com]

user+domain.com instead of domain.com
 

heinst

Registered
Oct 28, 2005
4
0
151
Fix for Top Email Relayers BUG

Today I found a solution for the problem

Change the group from mailnull user to the mail group

My passwd entry was:

mailnull:x:47:47::/var/spool/mqueue:/sbin/nologin

Now it's:

mailnull:x:47:12::/var/spool/mqueue:/sbin/nologin

where 12 is the gid from group mail

It happens that eximstats cannot read /etc/userdomains as this fille is owned by root.mail, and smtp records in /var/log/exim_mainlog dont contains the system user so a lookup must be used.
 

jackie46

BANNED
Jul 25, 2005
536
0
166
My problem with viewing relayers is that it always shows up as blank and no relayers are being displayed at all. All i see is;

User Domain Messages Sent Total Bytes Sent

and thats it.

I thought it was a bug in Release but after i upgraded all my other boxes to R i can view relayers, just not on this server. Its been like this for over 3 weeks. Whats the fix? It could be related but who knows.
 

dev_cw

Well-Known Member
Jun 30, 2004
59
1
158
I am trying the fix but I have noticed that my passwd is a bit different:

the entry for mailnull is:
mailnull:x:47:47::/var/spool/mqueue:/dev/null

Rather than the described:
mailnull:x:47:47::/var/spool/mqueue:/sbin/nologin

I am wondering if my setting is OK or should it end in "/sbin/nologin" like the example above.

Also does exim or eximstats need to be restarted for this fix to work?
 

Trigger

Well-Known Member
May 17, 2003
87
0
156
Brisbane
This fix did the trick for me, all email being sent through the server was being listed as cpanel rather than under the users account.

Big thanks to heinst for finding it out :)

How to implement the fix
Edit the passwd file
Code:
pico /etc/passwd
find the line for mailnull
Code:
mailnull:x:47:47::/var/spool/mqueue:/sbin/nologin
and edit it as below
Code:
mailnull:x:47:12::/var/spool/mqueue:/sbin/nologin
Save the changes
ctrl + x

Answer 'Y' to save changes

Hit 'Enter' to save as the original file name

Then you will need to restart eximstats for the changes to take effect
Code:
/scripts/restartsrv_eximstats
 

ThunderHostingDotCom

Well-Known Member
Nov 18, 2002
449
1
168
All over!
I changed the 2nd 47 to 12 & all seems fine but our /etc/passwd looks like this...
mailnull:x:47:47::/var/spool/mqueue:/dev/null

What is the difference between /sbin/nologin & /dev/null at the end? Should I change this to what was posted? How long will it take for this fix to work? Ours still shows the below...

User Domain Messages Sent Total Bytes Sent
cpanel 26 185831
nobody 20 21227
cxxx cxxx.com 1 720
 

mctDarren

Well-Known Member
Jan 6, 2004
665
8
168
New Jersey
cPanel Access Level
Root Administrator
Well now, my 'Top Email Relayers' on a box was showing empty, so I found this thread. Went to change my passwd file to 47:12 -- low and behold it was already set to 12. No one relayed mail from the box the last couple days? Methinks not!

:: edit ::

whoops, quick check of mysql database finds that eximstats was not writing to the db and overhead was out of control. optimize of db and restart of eximstats looks to have worked. Helps to seach a BIT more I suppose... :)
 
Last edited:

heinst

Registered
Oct 28, 2005
4
0
151
Top Email Relayers: Same BUG, new reason!!! Fix at the end!

A few days ago, my server started having the same behavior as before:

almost all mails assigned to cpanel user!

After inquiring the /usr/local/cpanel/bin/eximstats i've noticed that the problem was on the function Cpanel::cPanelFunctions::userdomains() called in the subroutine checkuserdomains()

the reason is the following:

eximstatus uses a perl hash to map the domain to the system user in the format:

Code:
$userdomain{domain} = user
BUT!!!

Someone at Cpanel changed the Cpanel::cPanelFunctions::userdomains() to return a hash in the format:

Code:
$userdomain{user} = domain

I've made a small port from the Cpanel::cPanelFunctions::userdomains() to the sub checkuserdomains in eximstats.

Now my sub checkuserdomains() looks like:

Code:
sub checkuserdomains {
   my $mtime = (stat('/etc/userdomains'))[9];
   if ($mtime != $userdomains_mtime) {
      $userdomains_mtime = $mtime;

      if (-e '/etc/userdomains') {
          if (my $lockfile = SafeFile::safeopen(\*TUD, '<', '/etc/userdomains')) {
              while (my $line = readline(TUD)) {
                  chomp $line;
                  my ($domain,$account) = split(/\s*[:]\s*/,$line,2);
                  next if (! $account);
                  next if ($account eq 'nobody');
                  $userdomains{$domain} = $account;
              }
              SafeFile::safeclose(\*TUD,$lockfile);
          }
      }
   }
}

Now everything is working fine in Top Email Relayers.
 

sorcier

Member
Apr 16, 2005
8
0
151
sorcier said:
WHM has the option: view relayers

Previously all sending through smtp appeared with the real user (user1, user2... ). Now all the sending through smtp (tcp 25) appear with the user "cpanel". This is correct? It affects to the bandwidth measurements of each user?

Code:
Top Email Relayers

Below are list of users who have relayed mail. They are listed in the order by
number of messages sent. You can click on the user/domain to view who 
they sent the messages to. 

User 	    	Domain 			Messages Sent 	Total Bytes Sent
cpanel 						84 		96448516
conxxx	        conxxxx.com 			7		11157
freshxxx	freshxxxx.com 	   		7		16954
elaxxx 		ela.xxx 			5	 	3773
root 						5 		50689
fiduxxxxc 	fiduxxxx.com 			3		8063
.
.
.
.
These 84 (more less) emails are greater to megabayte and are of a single user "elaxxx" but they are seen like sended by cpanel and not like sended by "elaxxx".

The other 5 messages of "elaxxx" are through webmail (phpsuexec).

This is correct? It affects to the bandwidth measurements of each user?

Mentioning what originally I mentioned:

I see in the tables of EximStats that the problem is mainly with fixed_login. Some times it assigns the correct user to them and the other times it assigns them to user CPANEL.

The question:

Why the messages with fixed_login are property of Cpanel in many occasions and rare time they are property of its real users?
 

fcitrolo

Active Member
Dec 31, 2003
26
0
151
swampy said:
I am also experiencing this also on one server where the domain name should be it is displaying the customers username not the domain name so when I click it I get Invalid user [user domain.com]

user+domain.com instead of domain.com

I am having this exact problem, I tried searching but didn't come up with anything. Is there any solution to this?
 

dinfiesta

Well-Known Member
May 2, 2005
58
0
156
This fix did the trick for me, all email being sent through the server was being listed as cpanel rather than under the users account.

Big thanks to heinst for finding it out :)

How to implement the fix
Edit the passwd file
Code:
pico /etc/passwd
find the line for mailnull
Code:
mailnull:x:47:47::/var/spool/mqueue:/sbin/nologin
and edit it as below
Code:
mailnull:x:47:12::/var/spool/mqueue:/sbin/nologin
Save the changes
ctrl + x

Answer 'Y' to save changes

Hit 'Enter' to save as the original file name

Then you will need to restart eximstats for the changes to take effect
Code:
/scripts/restartsrv_eximstats
Thanks!
It worked!
 

ispro

Well-Known Member
Verifed Vendor
Apr 8, 2004
628
2
168
All our servers have 47.47 so I wonder what are security risks associated with setting it to 47.12 (e.g. group mail)?