RE: [Emerald] FW: Mail Server Crash

Kelly Wright ( (no email) )
Sat, 13 Nov 1999 18:10:34 -0600

Our main domain "buz.net" is working with Emerald. We have about 100 more
domains we need to add so that the users in Emerald will be able to POP
their mail with the appropriate domain name. Not sure what we have to do.

I did a test on a seperate domain name. It bounces all mail back because it
can't find the user in the db. Does the script below fix that issue?

Kelly Wright (kelly@buz.net)
BuzNet Communications, Inc.
972-644-0440
http://www.buz.net

-----Original Message-----
From: emerald-request@iea-software.com
[mailto:emerald-request@iea-software.com]On Behalf Of Dale E. Reed Jr.
Sent: Saturday, November 13, 1999 6:09 PM
To: emerald@iea-software.com
Subject: Re: [Emerald] FW: Mail Server Crash

Kelly Wright wrote:
>
> WE had our diskdrive crash on NTMail. We were going to move to MailSite.
I
> have Mail site running on our primary domain name but can't get other
domain
> names to work with the Emerald db. Any ideas on what I need to do?

How are you doing the other domains? The original mailsite proc only
allowed the email field to be a user in the group's domain.

Here is an updated proc that has support for aliases, the email field,
and allows the user to receive email while they are expired, but not
read their email.

CREATE PROCEDURE VerifyMailUser @username varchar(32), @domain
varchar(32), @esid integer AS
CREATE TABLE #AccountIDs (AccountID INT)
INSERT INTO #AccountIDs
SELECT AccountID FROM SubAccounts sa WHERE Login = @username
UNION
SELECT AccountID FROM SubAccounts WHERE Email = @username
UNION
SELECT AccountID FROM SubAccounts WHERE Shell = @username
UNION
SELECT AccountID FROM SubAccounts WHERE Email = @username + '@' +
@domain

DELETE ai
FROM #AccountIDs ai, SubAccounts sa, MasterAccounts ma
WHERE ai.AccountID = sa.AccountID
AND sa.CustomerID = ma.CustomeriD
AND (sa.Active <> 1 OR ma.Active <> 1)

IF (SELECT COUNT(AccountID) FROM #AccountIDs) = 0
INSERT INTO #AccountIDs
SELECT AccountID FROM Aliases WHERE Alias = @username + '@' + @domain

Select Login, Shell, Email,@domain AS MailDomain,
CASE WHEN (ma.OverLimit > 0 AND ma.OverLimit > ma.Balance) OR
DateAdd(Day, (ma.Extension+ma.OverDue+1), maExpireDate) < GetDate()
THEN RIGHT(CONVERT(VARCHAR(10),RAND()),4) +
RIGHT(CONVERT(VARCHAR(10),RAND()),4)
ELSE sa.Password END AS Password, HomeDir
From MasterAccounts ma, SubAccounts sa, Groups g, AccountTypes at1
Where ma.CustomerID = sa.CustomerID
AND sa.AccountID IN (SELECT AccountID FROM #AccountIDs)
AND ma.GroupID = g.GroupID
AND g.DomainID IN (SELECT d.DomainID FROM Domains d WHERE d.MailDomain
= @domain)
AND at1.AccountType = sa.AccountType
AND at1.ExternalSystemID = @esid
DROP TABLE #AccountIDs
GO

--

Dale E. Reed Jr. Emerald and RadiusNT__________________________________________IEA Software, Inc. www.iea-software.com

For more information about this list (including removal) go to:http://www.iea-software.com/support/maillists/liststart

For more information about this list (including removal) go to:http://www.iea-software.com/support/maillists/liststart