How to add PHP mail script path into the email headers

postcd

Well-Known Member
Oct 22, 2010
720
20
68
Hello,

in sent email headers i have

X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - myhostname
X-AntiAbuse: Original Domain - gmail.com
X-AntiAbuse: Originator/Caller UID/GID - [566 574] / [47 12]
X-AntiAbuse: Sender Address Domain - myhostname
X-Get-Message-Sender-Via: myhostname: authenticated_id: cpaneluser/primary_hostname/system user

but please how to input also path from which email was sent? my aim is to somehow easilly discover which script sent spam
 

24x7server

Well-Known Member
Apr 17, 2013
1,911
97
78
India
cPanel Access Level
Root Administrator
Twitter

postcd

Well-Known Member
Oct 22, 2010
720
20
68
Try to install php modules Mailheaders on your server. You will install it with the easyapche.
Thx, i selected exactly this package to be installed yesterday, but it throw some message like that it is incompatible or something (was just a moment this message appeared) then easy apache rebuild happend. Now i see it unticked in EasyApache

I see i have ticked option "Save my profile with appropriate PHP 5 options set so that it is compatible with cpphp" and under it is:
"Enables:
CurlSSL
FTP
GD
Gettext
Iconv
Imap
Mbregex
Mbstring
Mysql
Mysql of the system
PGsql
Sockets
System Timezone
Zlib
Disables:
MailHeaders"

so kindly what should i do there please?
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Hello :)

You can browse to the "Mail" tab in "WHM Home » Service Configuration » Exim Configuration Manager" and enable the following options:

"EXPERIMENTAL: Rewrite From: header to match actual sender"
"Query Apache server status to determine the sender of email sent from processes running as nobody"

Thank you.
 

postcd

Well-Known Member
Oct 22, 2010
720
20
68
I see, i enabled that function and restarted exim but only line in sent email headers that is new is:
"X-From-Rewrite: unmodified, already matched"

but it do not tells me path to sending script, i only knows username from the:
"X-Get-Message-Sender-Via: myhostname: authenticated_id: cpaneluser/primary_hostname/system user"
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
You can't have the full MailHeaders module if you enable "Save my profile with appropriate PHP 5 options set so that it is compatible with cpphp". Thus, one alternative is to search the account of the username referenced for scripts with the ability to send out email to determine the culprit.

Thank you.
 

postcd

Well-Known Member
Oct 22, 2010
720
20
68
thanks, i wanted to enable "MailHeaders" in easy apache, but that option "Save my profile with appropriate PHP 5 options set ..." disables that. I want to ask if i should untick that "Save my profile ..." option in easyapache to prevent disabling that, what can be consequencesm is it bad idea? thank you
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Hello,

Per the option:

This option will make the following changes to your profile prior to the build: │ │ │
│ │ │ │ │ │
│ │ │Enables: │ │ │
│ │ │ CurlSSL │ │ │
│ │ │ FTP │ │ │
│ │ │ GD │ │ │
│ │ │ Gettext │ │ │
│ │ │ Iconv │ │ │
│ │ │ Imap │ │ │
│ │ │ Mbregex │ │ │
│ │ │ Mbstring │ │ │
│ │ │ Mysql │ │ │
│ │ │ PGsql │ │ │
│ │ │ Sockets │ │ │
│ │ │ System Timezone │ │ │
│ │ │ Zlib │ │ │
│ │ │ │ │ │
│ │ │ │ │ │
│ │ │Disables: │ │ │
│ │ │ MailHeaders │ │ │
│ │ │ Mysql of the system │ │ │
│ │ │ │ │ │
│ │ │ Are you sure you want to do this?
It's not enabled by default, so unless you specifically require compatibility with cpphp (e.g. for custom plugins) then you can disable the option.

Thank you.
 

postcd

Well-Known Member
Oct 22, 2010
720
20
68
Its offtopic, can you please link me to cpphp details, im not sure what it is and if i may need it in future. Really not sure if i can afford to untick that option in EasyApapche.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Its offtopic, can you please link me to cpphp details, im not sure what it is and if i may need it in future. Really not sure if i can afford to untick that option in EasyApapche.
It's simply the internal PHP that cPanel uses. It does not relate to the PHP version used by your websites in conjunction with Apache. Documentation on it is available at:

http://documentation.cpanel.net/display/ALD/cPanel+PHP
http://documentation.cpanel.net/display/ALD/Select+a+PHP+Binary

Thank you.