[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cobalt-users] Neomail



>
>I use Neomail for my web mail needings in my RAQ4i server. I would like
>to ask this: I don't want my clients to choose from the 
>drop-down menu for their
>domain, in the [FROM] field. I just want to fill a simple text field.
>I don't want my clients to see the other domains that use 
>Neomail. How can I do it?
>I tried to change the code in the neomail-prefs.pl file but I 
>failed. Thank you.
>

I hacked my neomail to only show the domains that the user is setup to
receive mail on in the virtusertable file. First, look for the line '### Get
a list of valid style files', mine is on line 176 in the neomail-prefs.pl
file. Just above that line, insert the following:

# BEGIN HACK
####################################
$virtmaps = "/etc/virtusertable";

open (VIRTMAPS,$virtmaps);
@virtmaps = <VIRTMAPS>;
close (VIRTMAPS);
$founduser = 0;
foreach $line (@virtmaps) {
	($email,$to) = $line =~ /(.+)\s(.+)/o;
	if ($to eq $user) {
		$founduser = 1;
		$email =~ s/\s//g;
		if ($email !~ /^\#.*/ && $email ne "") {
			($domain) = $email =~ /.*\@(.*)$/o;
                        $domain =~ s/^www\.//o;
			if (!$domain) { $domain = $email; }
			if ($domain =~ /\n$/) { chop ($domain); }
			$domain =~ s/\s//g;
			foreach $name (@domainnames) {
				if ($name eq $domain) { $domainexists = 1; }
			}
			if (!$domainexists) { push(@domainnames,$domain); }
		}
	}
}
if ($founduser) { shift(@domainnames); }
####################################
# END HACK

Make sure to back up the existing file before trying it.....!!!!

--
Robert Fitzpatrick