When using the smrsh feature of Sendmail, autoreply's
that were setup through usermin won't work because they
call ~username/.usermin/forward/autoreply.pl which
isn't symlinked in /etc/smrsh...
Would it be possible to have usermin setup the
autoreply in ~/.forward by calling
/usr/libexec/usermin/forward/autoreply.pl?
The admin could just setup the symlink in /etc/smrsh if
he wants to enable that feature...
Logged In: YES
user_id=129364
In the 1.040 release of usermin, a like from /etc/smrsh will
be added automatically when setting up autoreplies.
Logged In: NO
I cleaned this up (using WebMin 1.051) by patching
forward-lib.pl and save_alias.cgi, like so:
--- forward-lib.pl.original 2003-11-06
15:55:05.000000000 -0800
+++ forward-lib.pl 2003-12-16 15:36:52.000000000 -0800
@@ -8,10 +8,9 @@
if (-d $config{'smrsh_dir'}) {
local @uinfo = getpwnam($remote_user);
local $s;
- local $umcd =
"$uinfo[7]/$gconfig{'userconfig'}/$module_name";
foreach $s ('autoreply.pl', 'filter.pl') {
if (!-r "$config{'smrsh_dir'}/$s") {
- symlink("$umcd/$s",
+
symlink("/usr/libexec/usermin/forward/$s",
"$config{'smrsh_dir'}/$s");
}
}
@@ -219,10 +218,10 @@
sub alias_type
{
local @rv;
-if ($_[0] =~
/^|$user_module_config_directory\/autoreply.pl\s+(\S+)/) {
+if ($_[0] =~ /^|$config{'smrsh_dir'}\/autoreply.pl\s+(\S+)/) {
@rv = (5, $1);
}
-elsif ($_[0] =~
/^|$user_module_config_directory\/filter.pl\s+(\S+)/) {
+elsif ($_[0] =~ /^|$config{'smrsh_dir'}\/filter.pl\s+(\S+)/) {
@rv = (6, $1);
}
elsif ($_[0] =~ /^|(.*)$/) {
--- save_alias.cgi.original 2003-11-06
15:55:29.000000000 -0800
+++ save_alias.cgi 2003-12-16 15:29:06.000000000 -0800
@@ -54,15 +54,11 @@
elsif ($t == 4) { push(@values, "|$v"); }
elsif ($t == 5) {
# Setup autoreply script
- push(@values,
"|$user_module_config_directory/autoreply.pl $v $remote_user");
-
unlink("$user_module_config_directory/autoreply.pl");
- system("cp autoreply.pl
$user_module_config_directory");
+ push(@values,
"|$config{'smrsh_dir'}/autoreply.pl $v $remote_user");
}
elsif ($t == 6) {
# Setup filter script
- push(@values,
"|$user_module_config_directory/filter.pl $v $remote_user");
-
unlink("$user_module_config_directory/filter.pl");
- system("cp filter.pl
$user_module_config_directory");
+ push(@values,
"|$config{'smrsh_dir'}/filter.pl $v $remote_user");
}
elsif ($t == 7) {
push(@values, $config{'mail_system'}
? $mail_path : "\\$remote_user");
I hope this can be changed for future releases, or at least
that it will help someone else.
Logged In: NO
Line wrapping didn't come out very cleanly - contact
stevew@scitechsoft.com if you have questions or have a
better fix.
Logged In: NO
I should also point out that the existing code did not work,
because old/dead symlinks were not being updated in /etc/smrsh
Logged In: NO
In the next version of Usermin, I will change this code to
put the autoreply script in /etc/usermin/forward, which is
the only safe location... and to create symlinks.