diff --git a/Changes b/Changes index d7ab406..6d68bf5 100644 --- a/Changes +++ b/Changes @@ -5,6 +5,8 @@ Add connection_time plugin + Add git information to version number when running from a git clone + Add rcpt_regexp plugin (Hanno Hecker) Add notes method to Qpsmtpd::Address objects (Jared Johnson) diff --git a/lib/Qpsmtpd.pm b/lib/Qpsmtpd.pm index b386616..a19e264 100644 --- a/lib/Qpsmtpd.pm +++ b/lib/Qpsmtpd.pm @@ -9,6 +9,14 @@ use Qpsmtpd::Constants; $VERSION = "0.80"; +my $git; + +if (-e ".git") { + local $ENV{PATH} = "/usr/bin:/usr/local/bin:/opt/local/bin/"; + $git = `git describe`; + $git && chomp $git; +} + my $hooks = {}; my %defaults = ( me => hostname, @@ -41,7 +49,7 @@ sub DESTROY { #warn $_ for DashProfiler->profile_as_text("qpsmtpd"); } -sub version { $VERSION }; +sub version { $VERSION . ($git ? "/$git" : "") }; sub TRACE_LEVEL { $TraceLevel }; # leave for plugin compatibility