<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:NewCenturySchlbk;
panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
h1
{margin-top:12.0pt;
margin-right:0cm;
margin-bottom:3.0pt;
margin-left:0cm;
page-break-after:avoid;
font-size:20.0pt;
font-family:NewCenturySchlbk;}
p.MsoIndex1, li.MsoIndex1, div.MsoIndex1
{margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:12.0pt;
margin-bottom:.0001pt;
text-indent:-12.0pt;
font-size:12.0pt;
font-family:"Times New Roman";}
p.MsoToc1, li.MsoToc1, div.MsoToc1
{margin-top:18.0pt;
margin-right:0cm;
margin-bottom:0cm;
margin-left:0cm;
margin-bottom:.0001pt;
font-size:14.0pt;
font-family:NewCenturySchlbk;
text-transform:uppercase;}
p.MsoIndexHeading, li.MsoIndexHeading, div.MsoIndexHeading
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:Arial;
font-weight:bold;}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
pre
{margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.EpostStil20
{font-family:Arial;
color:windowtext;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Hi,</span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>We run RT 3.0.10 and have found a script on this e-mail list
for auto generation of password for users who send a message to RT for the
first time. There seems to be a problem though, because we don’t receive
a reply message with the new generated password.</span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>This is the scrip we run:</span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'> </span></font></p>
<pre><font size=2 face="Courier New"><span style='font-size:10.0pt'>----------start code-------------</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>{</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> my $tmplName = 'RT_PasswordChange'; ## hardwired template name</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> my ($user) = $self->TransactionObj->CreatorObj;</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> if (($user->id != $RT::Nobody->id) && (!$user->Privileged) &&</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> $user->__Value('Password') eq '*NO-PASSWORD*' && $user->Name =~ /\@/) {</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> my ($stat, $pass) = $self->TransactionObj->CreatorObj->SetRandomPassword();</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> if ($stat) {</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> my $template = RT::Template->new( $user->CurrentUser );</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> $template->LoadGlobalTemplate($tmplName);</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> unless ($template->Id) {</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> $RT::Logger->crit( "$user tried to send ". $user->Name .</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> " a password reminder, but couldn't find tmpl: $tmplName");</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> die "failed to load $tmplName template";</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> }</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> my $notification = RT::Action::SendEmail->new(</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> TemplateObj => $template,</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> TransactionObj => $self->TransactionObj,</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> TicketObj => $self->TicketObj,</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> ScripObj => $self->ScripObj,</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> Argument => $pass);</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> @{ $notification->{'To'} } = ( $user->EmailAddress );</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> my ($ret) = $notification->Prepare();</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> $ret = $notification->Commit() if $ret;</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> $RT::Logger->crit("Set Password scrip: $user: SendEmail failed sending ".</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> $user->Name . " the password setting reminder.")</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> unless ($ret);</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> } else {</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> $RT::Logger->crit("Set Password Scrip: Failed to set password for: \"".</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> $user->Name."\", pass=".$pass);</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> }</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> }</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'> 1;</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>}</span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>----------------end scrip code-----------------</span></font></pre>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I hope someone can tell me what might be the problem or that
someone can send me a script that works with RT 3.0.10</span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>--</span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Hilde</span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'> </span></font></p>
</div>
</body>
</html>