diff --git a/lib/Qpsmtpd/Utils.pm b/lib/Qpsmtpd/Utils.pm new file mode 100644 index 0000000..7ddc801 --- /dev/null +++ b/lib/Qpsmtpd/Utils.pm @@ -0,0 +1,15 @@ +package Qpsmtpd::Utils; +use strict; + +sub tildeexp { + my $path = shift; + $path =~ s{^~([^/]*)} { + $1 + ? (getpwnam($1))[7] + : ( $ENV{HOME} || $ENV{LOGDIR} || (getpwuid($>))[7]) + }ex; + return $path; +} + + +1;