Re: [Emerald] verifymailuser Emerald and mailsite

PowerNet ( (no email) )
Wed, 30 Jun 1999 09:43:33 -0400

We had the same problem last week.
Here is the new SQL procedure you should need.
Run this and it should work.
This came from shawn at IEA

if exists (select * from sysobjects where id =3D=
object_id('dbo.VerifyMailUser') and sysstat & 0xf =3D 4)
drop procedure dbo.VerifyMailUser
GO

CREATE PROCEDURE VerifyMailUser @username varchar(32), @domain varchar(32),=
@esid integer AS
Select CASE WHEN sa.Email LIKE '%_@_%' THEN
SUBSTRING(sa.Email,1,CHARINDEX('@',sa.Email)-1) ELSE sa.Login END AS Login
, Shell, Email, d.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),@@IDLE) + CONVERT(VARCHAR(5),@@SPID) +=
CONVERT(VARCHAR(5),@@CPU_BUSY) + CONVERT(VARCHAR(5),Password) ,15)
ELSE sa.Password END AS Password, HomeDir
From MasterAccounts ma, SubAccounts sa, Groups g, Domains d, AccountTypes=
at1
Where ma.CustomerID =3D sa.CustomerID
AND ma.GroupID =3D g.GroupID
AND g.DomainID =3D d.DomainID
AND at1.AccountType =3D sa.AccountType
AND at1.ExternalSystemID =3D @esid
AND d.MailDomain =3D @domain
AND ma.Active =3D 1
AND sa.Active =3D 1
AND ( ((Login=3D@username OR Shell=3D@username) AND=
d.MailDomain=3D@domain)
OR Email =3D @username + "@" + @domain )

UNION

Select Login, Shell, Email=3Da.Alias, d.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),@@IDLE) + CONVERT(VARCHAR(5),@@SPID) +=
CONVERT(VARCHAR(5),@@CPU_BUSY) + CONVERT(VARCHAR(5),Password) ,15)
ELSE sa.Password END AS Password, HomeDir
From MasterAccounts ma, SubAccounts sa, Groups g, Domains d, Aliases a,=
AccountTypes at1
Where ma.CustomerID =3D sa.CustomerID
AND ma.GroupID =3D g.GroupID
AND g.DomainID =3D d.DomainID
AND sa.AccountID =3D a.AccountID
AND ma.Active =3D 1
AND sa.Active =3D 1
AND at1.AccountType =3D sa.AccountType
AND at1.ExternalSystemID =3D @esid
AND a.Alias =3D @username + "@" + @domain
GO

GRANT EXECUTE ON dbo.VerifyMailUser TO EmeraldApps
GO

*********** REPLY SEPARATOR ***********

On 6/29/99, at 5:43 PM, Christian Lawrence wrote:

>We have just upgraded to 2.5 from 2.2 and everything is working except the
>emerald mailsite compatibility. I enter the user data into emerald,
>username test and then I go into mailsite and try to enter a database
>mailbox. I can view the accounts but when I try to add them to mailsite,
>they do not show up. I have contacted mailsite and they went through and
>checked to make sure that everything was working in mailsite. Mailsite
>worked fine with ver. 2.2. I believe I am running emerald 2.5.278 and
>mailsite 3.3.1. When I do a EXEC verifymailuser 'test', 'domain.com', '1'
>It shows me a statement saying 0 rows affected.
>When I issue that command with a old account I get the user's information.
>I am curious to know what this might mean and how do I fix it?
>thanks
>
>
>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