Skip to main content

Need to store all emails adresse sent / received in one file

Comments

3 comments

  • cPanelLauren
    Are you wanting to do this for all mail on the server or just for a specific account? The exim logs note every single mail transaction that occurs on the server and it's where Mail Delivery Reports pulls its data from. You can modify the number of days exim stats are stored in the database at WHM>>Server Configuration>>Tweak Settings and use the emailtrack_search WHMAPI1 function to get the data WHM API 1 Functions - emailtrack_search - Developer Documentation - cPanel Documentation
    0
  • foxmedo
    Thank you @cPanelLauren for your reply i need to stock the maximum of information who send email to who some users come to ask about the report for the last 3months of their employee so we need to be able to answer theme saying you received email from this adresse and you send to this adresses I have try with Mail Delivery Reports but when we filter and display 1000 in the first page we get empty result in second page 'No records found.' which is a bug i guess because in the first page we get 5000 result i have increase the The interval, in days, to retain Exim stats in the database to 30 days but the Mail Delivery Reports will not show more than 5000 records
    0
  • cPanelLauren
    The method I provided you should give this but it would need to be appended as time goes on, i.e., every 5 days run the report and send the new data to the file. Mail Delivery Reports specifically notes in the UI that it can only return the last 1000 results. The only other option would be to store the exim logs indefinitely, in which case you'd want to move them once they're rotated. That way you could just search the logs any time you needed an answer for this. So if I needed all mail sent to and from any email address in the exim logs you could check it like this: egrep '=>|<=' /var/log/exim_mainlog |sort -u -k4 |awk -F',' '{ x[$1]=$0 } END { for (i in x) print x }'
    (this just prints one line for transactions that happen on multiple lines with the same message ID - you're just limited by the records that are currently present in the exim logs
    0

Please sign in to leave a comment.