[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Header problem in commit-email.pl

From: Daniel Balog <db_at_it-netservice.de>
Date: Wed, 2 Jul 2008 11:39:04 +0200

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi there,

the following problem is related to the hook-script commit-email.pl, as
released in

$HeadURL:
http://svn.collab.net/repos/svn/branches/1.5.x/tools/hook-scripts/commit
-email.pl.in $
$LastChangedDate: 2008-04-01 17:12:17 +0200 (Di, 01. Apr 2008) $
$LastChangedBy: glasser $
$LastChangedRevision: 30155 $

I upgraded subversion from 1.4.6 to 1.5.0, since then the email header
created by the hook script is being broken and therefore the header
fields Date, To, From, Subject, Content-Type and
Content-Transfer-Encoding aren't recognized by sendmail anymore.

The cause is in the code block around line 563:

560: if (defined $stdout)
561: {
562: $formatted_date = strftime('%a %b %e %X %Y', localtime());
563: push(@head, "From $mail_from $formatted_date\n");
564: }

This push puts the string above the other header lines, thus "telling"
sendmail "header finishs, body starts". The original header lines
therefore are being treated as part of the mail body.

my hook-script call (post-commit) is

/usr/lib/subversion/hook-scripts/commit-email.pl "$REPOS" "$REV" \
    -l /var/log/svn-mail.log \
    --from '"itns SVN-Agent" <svnagent_at_it-netservice.de>' \
    -s "Commit in $REPOS: " db_at_itns.de `cat $REPOS/hooks/recipients.lst
2>/dev/null` \
    2>/dev/null

(recipients.lst contains whitespace separated additional email
recipients but doesn't exist in all repositories)

Why is (in my case) $stdout defined? Is there a problem with the parsing
of the command line parameters?

By commenting out lines 560-564 I can go around this issue but this
doesn't solve the real cause.

Friendly regards

Daniel Balog

-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0.3

iQA/AwUBSGtMtLHDYBUilH4zEQIWjwCcC5/UDyNqp+stxllUjSGF80kw2dEAn1bU
ZAJbpN/kD7F3IKNeN0XJ8fBT
=aVlC
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org

Received on 2008-07-02 22:31:03 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.