procmail
[Top] [All Lists]

script an variable

1999-07-03 03:32:59
Hello,
within procmail, I catch the mail with a certain Subject, and I then
want to start a perl-script and hand over a variable to be processed.
For instance: a user has lost his password and when he leaves the
password-field blank, an eMail is sent to me, Subject: sendnewpasswd,
and the user's eMail-adress in the body.
I want to hand the eMail-adress over to a perl-script, which generates
the password (and sends it out to the user).

The following does not have anything to do with the procmail-list, but
perhaps someone has an idea?

-----------------------------------
What I do:
I run a closed list, where until today, the subscribers can subscribe
and unsubscribe themselves, change eMail-adress, all with a mouse-click.
(I have nothing else to do, than subscribe the user for the first time,
thanks Era and this list. I am very content with procmail. :-)))

At the same time, they can access perl-script-based service-pages.
All they have to do, is to enter their eMail-adress when entering.

The eMail-adress is compared with a file, that contains all ever
subscribed adresses. This general file is uploaded 6 times a day, and is
run on my dial-on-demand-server as a closed list too.

What I want to do:
I want to replace the "general file with all adresses" by an individual
password, depending on the eMail-adress and the month.

Two similar perl-routines are accessible.
the 1st is here, on my dial-on-demand-server and spreads the new passwd
to every subscriber on the 1st day of every month, 
the 2nd serves in the script in the web, to compare the
typed-in-password with the passwd generated from the
(typed-in-)eMail-adress and the month.

Does anyone have an idea for this routine?
The password of last month must not at all be similar to the one of this
month.
?:-}

Thank you,
Jost


sub printpass
{                                                                               
    
$heute = (Apfe,DOnn,sCHn,SOnn,karl,KrIs,jakO,agne,OMIs,diaN,jott,Papa)
[(localtime) [4]];         
                                                                                
                  
# $gefunden is the user's adress
$gefunden=~
tr/\@/A/;                                                                       
      
$gefunden=~
tr/\./B/;                                                                       
      
$gefunden=~
tr/\-/Z/;                                                                       
      
$gefunden=~
tr/\_/Y/;                                                                       
      
# as some adresses are very short, I make the string longer
$gefunden = join
'',$gefunden,$gefunden,$gefunden,$gefunden,$gefunden;                           
 
@y = split
//,$gefunden;                                                                   
       
$gefunden = join '',\
@y[2],@y[5],@y[8],@y[11],@y[14],@y[17],@y[20],@y[23],@y[27],@y[30];          
substr($gefunden, 0, 1) =
$heute;                                                                 
@z = split
//,$gefunden,11;                                                                
       
$passwort = \
@z[4](_dot_)(_at_)z[2](_dot_)@z[9](_dot_)(_at_)z[0](_dot_)@z[7](_dot_)(_at_)z[5](_dot_)@z[3](_dot_)(_at_)z[6](_dot_)@z[1](_dot_)(_at_)z[8](_dot_)@z[10];
                   
$passwort=substr($passwort,
4,8);                                                                 
print DAT "$passwort =
$email\n";                                                                 
}

<Prev in Thread] Current Thread [Next in Thread>
  • script an variable, Jost Schaper <=