1

Simple question. How do i get information about spam score from an email? Spam assassins scores every email coming trough.

Content-Type: multipart/alternative; boundary=001a1147c0c49c760505349aecf2
X-Spam-Status: No, score=-2.5
X-Spam-Score: -24
X-Spam-Bar: --
X-Ham-Report: Spam detection software, running on the system "xxx.xx.xx",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 root\@localhost for details.

I would guess, I can access this info getting header imap_fetchheader, but all I get is

[date]
[subject] 
[message_id]
[toaddress] 
[to]
[fromaddress]
[from]
[reply_toaddress] 
[reply_to]
[senderaddress] 
[sender]

So i am still missing Spam score information. I need it to be able to send some of the emails coming, to spam box, and some to the inbox.

Kedor
  • 1,488
  • 5
  • 29
  • 53
  • 1
    Following the manual of php ["imap_fetchheader"](http://php.net/manual/en/function.imap-fetchheader.php) and some user provided snippets also targeting private headers (starting with `X-` as you are seeking should work. How do you call `imap_fetchheader` and how do you currently deal with the returned data? – Dilettant Jun 06 '16 at 12:51
  • That might be the answer I actually looked for. I mean I just missed something. I used `imap_rfc822_parse_headers` which was parsing it to an array, but ignoring information I needed. Now I see, it's there before.. So I will find a way to get out my score.. Thanks? I feel stupid, and would like to show my appreciation somehow :D – Kedor Jun 06 '16 at 13:01
  • Thanks that is important and welcome feedback :-) and your feelings are yours but most of my stumbling blocks along my way are tiny problems for others, that's why we ask. – Dilettant Jun 06 '16 at 13:27

0 Answers0