Anope IRC Services  Version 1.8
Functions
mail.c File Reference
#include "services.h"
#include "language.h"
Include dependency graph for mail.c:

Go to the source code of this file.

Functions

MailInfoMailRegBegin (User *u, NickRequest *nr, char *subject, char *service)
 
MailInfoMailBegin (User *u, NickCore *nc, char *subject, char *service)
 
MailInfoMailMemoBegin (NickCore *nc)
 
void MailEnd (MailInfo *mail)
 
void MailReset (User *u, NickCore *nc)
 
int MailValidate (const char *email)
 

Function Documentation

MailInfo* MailBegin ( User u,
NickCore nc,
char *  subject,
char *  service 
)

Begins to send a mail. Must be followed by a MailEnd call. Returns NULL if the call failed. Error messages are automatically sent to the user.

Parameters
uthe User struct
ncNickCore Struct
subjectSubject of the email
serviceService to respond with
Returns
MailInfo struct

Definition at line 93 of file mail.c.

References nickcore_::display, DontQuoteAddresses, nickcore_::email, ForkForMail, is_services_root(), nickcore_::lastmail, user_::lastmail, mail, MailDelay, notice_lang(), mailinfo_::pipe, mailinfo_::readpipe, mailinfo_::recip, mailinfo_::recipient, scalloc(), mailinfo_::sender, SendFrom, SendMailPath, UseMail, and mailinfo_::writepipe.

Referenced by do_sendpass().

void MailEnd ( MailInfo mail)

Finish to send the mail. Cleanup everything.

Parameters
mailMailInfo Struct
Returns
void

Definition at line 206 of file mail.c.

References ForkForMail, nickrequest_::lastmail, nickcore_::lastmail, user_::lastmail, mailinfo_::pipe, mailinfo_::readpipe, mailinfo_::recip, mailinfo_::recipient, mailinfo_::sender, SendMailPath, and mailinfo_::writepipe.

Referenced by do_sendpass(), do_sendregmail(), and new_memo_mail().

MailInfo* MailMemoBegin ( NickCore nc)

new function to send memo mails

Parameters
ncNickCore Struct
Returns
MailInfo struct

Definition at line 153 of file mail.c.

References nickcore_::display, DontQuoteAddresses, nickcore_::email, ForkForMail, getstring2, mail, mailinfo_::pipe, mailinfo_::readpipe, mailinfo_::recip, mailinfo_::recipient, scalloc(), mailinfo_::sender, SendFrom, SendMailPath, UseMail, and mailinfo_::writepipe.

Referenced by new_memo_mail().

MailInfo* MailRegBegin ( User u,
NickRequest nr,
char *  subject,
char *  service 
)

Begins to send a mail. Must be followed by a MailEnd call. Returns NULL if the call failed. Error messages are automatically sent to the user.

Parameters
uthe User struct
nrNickReqest Struct
subjectSubject of the email
serviceService to respond with
Returns
MailInfo struct

Definition at line 29 of file mail.c.

References DontQuoteAddresses, nickrequest_::email, ForkForMail, user_::lastmail, mail, MailDelay, nickrequest_::nick, notice_lang(), mailinfo_::pipe, mailinfo_::readpipe, mailinfo_::recip, mailinfo_::recipient, scalloc(), mailinfo_::sender, SendFrom, SendMailPath, UseMail, and mailinfo_::writepipe.

Referenced by do_sendregmail().

void MailReset ( User u,
NickCore nc 
)

Resets the MailDelay protection.

Parameters
uthe User struct
ncNickCore Struct
Returns
void

Definition at line 276 of file mail.c.

References nickcore_::lastmail, and user_::lastmail.

int MailValidate ( const char *  email)

Checks whether we have a valid, common e-mail address. This is NOT entirely RFC compliant, and won't be so, because I said common cases. ;) It is very unlikely that e-mail addresses that are really being used will fail the check.

FIXME: rewrite this a bit cleaner.

Parameters
emailEmail to Validate
Returns
int

Definition at line 296 of file mail.c.

References BUFSIZE, and strscpy().

Referenced by do_register(), do_saset_email(), do_set_email(), and load_old_ns_dbase().