Koozali.org: home of the SME Server

Did i receive the email?

Offline Gert

  • *****
  • 208
  • +0/-0
    • http://www.huge.co.za
Did i receive the email?
« on: September 13, 2007, 09:25:36 AM »
Hi

Is there a way i can see if the server received an email from a specific email address on a specific date. (24 May 2007)
there use to be a contrib for that but it only worked in sme6.x. Is there a log file or something i can search through?

Offline byte

  • *
  • 2,183
  • +2/-0
Re: Did i receive the email?
« Reply #1 on: September 13, 2007, 10:23:42 AM »
Hi

Is there a way i can see if the server received an email from a specific email address on a specific date. (24 May 2007)
there use to be a contrib for that but it only worked in sme6.x. Is there a log file or something i can search through?

You can normally log in the /var/log/qpsmtpd/current log or /var/log/qmail/current log but because these get rotated I doubt it will have the date you requested, only other option is if you enabled BCC copying feature which archives the emails then you could look there. BCC is not enabled but default BCC is disabled.
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Offline Gert

  • *****
  • 208
  • +0/-0
    • http://www.huge.co.za
Re: Did i receive the email?
« Reply #2 on: September 13, 2007, 11:48:42 AM »
Thanx for the reply. I did enable bcc in the beginning of this month. I suppose there is no other way. Thanx.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Did i receive the email?
« Reply #3 on: September 13, 2007, 01:03:27 PM »
You can normally log in the /var/log/qpsmtpd/current log or /var/log/qmail/current log but because these get rotated I doubt it will have the date you requested, only other option is if you enabled BCC copying feature which archives the emails then you could look there. BCC is not enabled but default BCC is disabled.
Although it rotates it should keep some history, I have a lot of older log files still available on my server.

How about this from the SME Server shell:
Code: [Select]
grep -i 'to email address' /var/log/qpsmtpd/\@* /var/log/qpsmtpd/currentOnce you located the proper logfile you can do the following:
Code: [Select]
grep -ih 'to email address' /path/to/logfile | tai64nlocal |  grep 'yyyy-mm-dd' (Replace the y, m and d values for the proper date values.)

Edit: removed duplicate pipe symbol in last command
« Last Edit: September 13, 2007, 02:25:28 PM by cactus »
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline byte

  • *
  • 2,183
  • +2/-0
Re: Did i receive the email?
« Reply #4 on: September 13, 2007, 01:20:05 PM »
I suppose there is no other way. Thanx.

Depending on size of your logs you may find it could go back to May, I've had a look at mine and mine go back to end of July and my mail server is a busy mail server, so if your server is less busy then you may be in luck by checking via server-manager and looking at the qmail section of the logs to see how far your's go back.
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Offline Gert

  • *****
  • 208
  • +0/-0
    • http://www.huge.co.za
Re: Did i receive the email?
« Reply #5 on: September 13, 2007, 02:21:28 PM »
Is this correct?

Code: [Select]
grep -ih 'to email address' /path/to/logfile | tai64nlocal |  | grep 'yyyy-mm-dd'

I found the log file. but how can i see the date? the log files does not seem to have dates in.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Did i receive the email?
« Reply #6 on: September 13, 2007, 02:24:19 PM »
Is this correct?

Code: [Select]
grep -ih 'to email address' /path/to/logfile | tai64nlocal |  | grep 'yyyy-mm-dd'

I found the log file. but how can i see the date? the log files does not seem to have dates in.
I copy pasted something and made a slight error I just saw, it should read like this:
Code: [Select]
grep -ih 'to email address' /path/to/logfile | tai64nlocal | grep 'yyyy-mm-dd'If you leave out the command after tai64nlocal you will see the lines with the date in local time format:
Code: [Select]
grep -ih 'to email address' /path/to/logfile | tai64nlocal
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline Gert

  • *****
  • 208
  • +0/-0
    • http://www.huge.co.za
Re: Did i receive the email?
« Reply #7 on: September 13, 2007, 02:43:58 PM »
thank you for the reply. Unfortunately for my the log files does not go that far back. At least i learned what tai64nlocal does.   :-P It is very helpfull.