QMail Log Dates (human readable)

While searching in qmail’s send logs, I found the line I needed but there was a problem… The date seems to be there, embedded in a complicated hexadecimal string and I need it.

I searched a bit in the forums and did not find it at first so I googled a bit and found that line of code which helped me a lot (among perl scripts)

If you want to convert dates from the current logs go to the /var/log/* (where * means either send, smtp, smtp2, pop3, pop3-ssl, imap4, imap4-ssl) and run this command:

cat ./current | tai64nlocal > current-merged-log

Otherwise, you can convert all rotated logs in the right order with this command:

sort -m @* | tai64nlocal > old-merged-log

Hope this helps someone as much as it helped me! And feel free to reply with a better answer if there is one! :slight_smile:

That’s about it - If I’m just looking at the log itself for an error or something then I’ll just ‘cat /var/log/<mail server type>/current’ | tai64nlocal .