Koozali.org: home of the SME Server

Qmail message IDs

Offline ddougan

  • *
  • 155
  • +0/-0
    • http://www.DouganConsulting.com
Qmail message IDs
« on: October 06, 2006, 07:17:00 PM »
I was looking in the qmail\current file this morning, investigating a possible mail delivery problem. I grep'd fpr a particular message id (msg 11632653), and found multiple instances of it in messages processed today.

Does qmail not use unique IDs? What would explain multiple (and quite definitely separate) instances of the same ID?

I'd appreciate any enlightenment... And I'll be happy to raise a bug if that is what it is.

Regards,

Des
Des Dougan

Offline mmccarn

  • *
  • 2,656
  • +10/-0
Qmail message IDs
« Reply #1 on: October 07, 2006, 05:15:20 PM »
I believe that the message ID in qmail is actually the i-node of the file containing the message.  This is part of why qmail is so efficient.

Quote from: "JonB"
You should look at using collapse_qpsmtpd_conn.pl to collapse the qpsmtpd log files. collapse_qpsmtpd_conn extracts commands and responses from qpsmtpd log files and prints a single line for each connection with the entire SMTP dialog. The output is intended to be easily filtered with grep or awk

I use it and pipe the results to the script that creates the chart.

You could use it to create a single log file with one line per connection/pid.

collapse_qpsmtpd_conn.pl /var/log/qpsmtpd/* > qpsmtpd.log

http://www.hjp.at/projekte/qpsmtpd/log-tools/

I use the "collapse_qpsmtpd_conn" script if I'm trying to track emails in the logs; just download the script and feed it your qpsmtpd logs.

I'd use something like:
mkdir -p /root/tools
cd /root/tools
wget http://www.hjp.at/projekte/qpsmtpd/log-tools/collapse_qpsmtpd_conn
chmod +x collapse_qpsmtpd_conn

./collapse_qpsmtpd_conn /var/log/qpsmtpd/current | less


- Michael

Offline ddougan

  • *
  • 155
  • +0/-0
    • http://www.DouganConsulting.com
Qmail message IDs
« Reply #2 on: October 08, 2006, 04:40:50 AM »
Thanks for the pointer. I'll have a look at it to see if it helps.

Regards,

Des
Des Dougan

Offline raem

  • *
  • 3,972
  • +4/-0
Qmail message IDs
« Reply #3 on: October 08, 2006, 07:06:07 AM »
mmccarn & JonB

How about  this variation on usage to allow display of the results in the server manager View log files panel.

Obviously choice of script location & name is personal, so change it as desired.

mkdir -p /opt/scripts/collapse_qpsmtpd_conn
cd /opt/scripts/collapse_qpsmtpd_conn
wget http://www.hjp.at/projekte/qpsmtpd/log-tools/collapse_qpsmtpd_conn
chmod u+x collapse_qpsmtpd_conn

Create a small script file to allow easy repeated log file creation (saves having to remember & type the commands later)

pico read-qpsmtpd

type in

./collapse_qpsmtpd_conn /var/log/qpsmtpd/* > /var/log/qpsmtpd-conn/current

Ctrl o to save
Ctrl x to exit

chmod u+x read-qpsmtpd

Then create a new log file location that can be easily accessed by server manager
mkdir -p /var/log/qpsmtpd-conn

Then run
./read-qpsmtpd

Then open server manager View log files
and select
qpsmtpd-conn/current

Remember to run
cd /opt/scripts/collapse_qpsmtpd_conn
./read-qpsmtpd
before looking at the log file again so it is updated with the latest activity

You can also save the output result to file (select download option) for easier analysis using another document viewing program to more easily view the wide screen format that is created.
...

Offline byte

  • *
  • 2,183
  • +2/-0
Qmail message IDs
« Reply #4 on: October 08, 2006, 03:38:56 PM »
Quote from: "RayMitchell"

Remember to run
cd /opt/scripts/collapse_qpsmtpd_conn
./read-qpsmtpd
before looking at the log file again so it is updated with the latest activity


Thanks for the nice tip there Ray, I personally would have it run the script for me via cron

Code: [Select]
*/30 * * * * /opt/scripts/collapse_qpsmtpd_conn/read-qpsmtpd

Which will run every 30 minutes.
--[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!