Tronquer le sujet uniquement si besoin

tags/0.0.1
Daniel Berteaud 12 years ago
parent e26674e3af
commit 60441b6b0e
  1. 4
      root/usr/share/qpsmtpd/plugins/logging/log2sql

@ -140,12 +140,12 @@ $header->add("X-Sql-Log-ID",$mail_id);
my $subject = scalar $header->get("Subject"); my $subject = scalar $header->get("Subject");
chomp($subject); chomp($subject);
# Only keep the first 255 chars to be sure it can be inserted in the table # Only keep the first 255 chars to be sure it can be inserted in the table
$subject= substr $subject, 0, 254; $subject= substr $subject, 0, 254 if (length($subject) > 254);
my($statement) = "UPDATE ".$mail_table." SET subject=". my($statement) = "UPDATE ".$mail_table." SET subject=".
$dbh->quote($subject). $dbh->quote($subject).
",header_size=".$dbh->quote(length($header->as_string())). ",header_size=".$dbh->quote(length($header->as_string())).
",body_size=".$dbh->quote($transaction->body_size()). ",body_size=".$dbh->quote($transaction->data_size()).
" WHERE mail_id=".$mail_id; " WHERE mail_id=".$mail_id;
$self->log(LOGDEBUG,"data_post_handler statement:".$statement); $self->log(LOGDEBUG,"data_post_handler statement:".$statement);

Loading…
Cancel
Save