Project:Mail Logger
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

Hi,

Thanks for this module, I think its usefull.

"Reroute Email" module has a little strange effect when it is installed with the "Maiul Logger" module :

http://screencast.com/t/1WFP3RLTWGXa

2 Emails were actualy sent but mail Logger saw 4 emails go by.

Regards, Tom

PS. Feature request : cleanup emails older than x days.

Comments

#1

Title:Working together with the "Reroute Email"module» Empty record logged
Category:task» bug report

The same thing happens to me too.
Emails get logged correctly but an other empty record is also inserted in the database.

You can see the attachements for screenshots of the mail logger and the database records.

I have no idea why this is happening, but I don't have the "Reroute Email" module.

Regards

AttachmentSize
mail_logger.jpg 10.11 KB
mail_logger_db.jpg 26.76 KB

#2

too

#3

Version:6.x-1.0» 6.x-1.x-dev

This problem still appears in dev today. Also: I noticed that while table on /admin/reports/mail-logger is empty, the table mail_logger is not. In the DB there is a header "N;", similar to screenshot above.

The problem doesn't happen with every mail, but every time I send my simplenews newsletter.

It looks like header gets split somehow. Maybe this also explains why some mails get corrupted, see http://drupal.org/node/388164. I am only guessing.

#4

If some one provides a patch i'll commit.

#5

I am not convinced anymore that this is mail_logger's fault. I don't see how:

db_query("INSERT INTO {mail_logger} (
  `mlid` , `mailkey` , `to` , `subject` , `body` , `from` , `headers`, `date_sent`, `language`
  ) VALUES (
  NULL, '%s', '%s', '%s', '%s', '%s', '%s', %d, '%s' )", $args);

could possibly update more than one entry in the db. That would mean that
mail_logger_mail_alter(&$message)
gets called two times per mail, and this means that the logger should faithfully report it.

Also to produce such an incomplete mail would never result in any mail actually sent, since it is only produces a header, no $to, $from, $body etc. So it would NOT be really an obvious error which breaks any functionality. Let me see if I find a log of MTA.

EDIT: understanding qmail will take me some time...

#6

I don't know if it is relevant by I get this behavour (double entry) when I enable the mimemail module and check the "Use mime mail for all messages", although the mail is send as plain text.
The mimemail module has some code in the function mimemail (line 161) were it calls mail_alter for each other module that implements it.
Trying to comment out this for loop (lines 161 through 164), the mail logger worked correctly. The mail still goes out correctly as plain text.

I have no idea what other implications this might have, but it is something I just noticed. Maybe someone else with better understanding of the mimemail module could help.

I also found this:
http://drupal.org/node/263142