[IRCServices] what do they think ?

Pinto, Joao Luis (J.) jpinto9 at visteon.com
Fri Oct 8 03:20:30 PDT 1999


I think putting the mailing job on services is not a very good idea, my idea
is services should dump the data for the mails on a temp file, and then a
script that would be on cron, would use thid temp file, send the mails and
clean the file :), a 10mins interval cron with be a good service.

João Luís Marques Pinto
PTlink Tech - Lamego at PTlink.net
http://www.PTlink.net  



-----Original Message-----
From: root of all evil [<A  HREF="mailto:climber at rionet.com.br">mailto:climber at rionet.com.br</A>]
Sent: quinta-feira, 7 de outubro de 1999 21:47
To: ircservices at ender.shadowfire.org
Subject: [IRCServices] what do they think ?


i had wrote this function on my services, it is working well, but i wold
like
to hear coments and sugestions on it

it send password information to the nick email (ni->email) and i changed the
do_register, so users must give a mail

the function is it : 

static void do_sendpass(User *u)
{
#ifndef USE_ENCRYPTION
    char *nick = strtok(NULL, " ");
    NickInfo *ni;
    FILE *tosend;
    FILE *lock;
#endif

#ifdef USE_ENCRYPTION
    notice(s_NickServ, u->nick, "SENDPASS not avaliable");
#else
      lock = fopen(".senpass.nick", "r");
      if (lock) {
        notice(s_NickServ, u->nick, "Sendpass is busy, try again later");
        fclose(lock);
        return ;                  
    }else if (!nick) {
            notice(s_NickServ, u->nick, "Sintax: /msg NickServ SENDPASS
nick");
	return ;
    } else if (!(ni = findnick(nick))) {
        notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick);
        return ;
    } else if (nick_is_services_admin(ni) && !is_services_root(u)) {  
        notice_lang(s_NickServ, u, PERMISSION_DENIED); 
        return ;
    } else if (!ni->email) {
        notice(s_NickServ, u->nick, "No email set");
        return ;
    } else if (!strchr(ni->email, '@')) {
        notice(s_NickServ, u->nick, "bad email");
        return ;
    } else if(strlen(ni->email)>50) {
        notice(s_NickServ, u->nick, "bad email");
        return ;
    } else {
            
       char illsend[256];
       strcpy(illsend,"/usr/sbin/sendmail ");
       strcat(illsend, ni->email);
       strcat(illsend," < .sendpass.nick");

        tosend = fopen(".sendpass.nick", "w");
          if (tosend) {
          fprintf(tosend, "From: brasirc at brasirc.com.br\n");
          fprintf(tosend, "Subject: [%s] Password\n", ni->nick);
          fprintf(tosend, "\n");
          fprintf(tosend, "Dear user\n");
          fprintf(tosend, "yor nick %s password is:%s\n", ni->nick,
ni->pass);
          fprintf(tosend, "if u need help  write to
ajuda at brasirc.com.br\n");  
          fprintf(tosend, "or join #BrasIRCOP\n");       
          fprintf(tosend, "\n"); 
          fprintf(tosend, "BrasIRC.com.br network");
          fprintf(tosend,".\n");   /* this get us out on sendmail */ 
          fclose(tosend);

          system(illsend);
          system("rm -f .sendpass.nick"); 

        log("%s: %s!%s@%s used SENDPASS on %s email: %s", s_NickServ,
u->nick,
u ->username, u->host, nick, ni->email);
         if (WallGetpass)             
         wallops(s_NickServ, "\2%s\2 used SENDPASS on \2%s\2, mail: %s",
u->nick, nick, ni->email);         
       } else {           notice(s_NickServ, u->nick, "Ooops, Something gone
wrong on SendPass");
          }     } 
} 
#endif

Fighter ircadmin irc.rionet.com.br
Brasirc.com.br Network 
---------------------------------------------------------------
To unsubscribe, send email to majordomo at ender.shadowfire.org
with "unsubscribe ircservices" in the body, without the quotes.
---------------------------------------------------------------
To unsubscribe, send email to majordomo at ender.shadowfire.org
with "unsubscribe ircservices" in the body, without the quotes.