33 if (!u || !nr || !subject || !service) {
42 }
else if (!nr->
email) {
57 mail->
writepipe = fdopen(pipefds[1],
"w");
58 mail->
readpipe = fdopen(pipefds[0],
"r");
72 fprintf(mail->
pipe,
"To: \"%s\" <%s>\n", nr->
nick, nr->
email);
74 fprintf(mail->
pipe,
"Subject: %s\n", subject);
95 if (!u || !nc || !subject || !service) {
105 }
else if (!nc->
email) {
120 mail->
writepipe = fdopen(pipefds[1],
"w");
121 mail->
readpipe = fdopen(pipefds[0],
"r");
135 fprintf(mail->
pipe,
"To: \"%s\" <%s>\n", nc->
display,
138 fprintf(mail->
pipe,
"Subject: %s\n", subject);
175 mail->
writepipe = fdopen(pipefds[1],
"w");
176 mail->
readpipe = fdopen(pipefds[0],
"r");
189 fprintf(mail->
pipe,
"To: \"%s\" <%s>\n", nc->
display,
192 fprintf(mail->
pipe,
"Subject: %s\n",
213 if (!mail || !mail->
pipe) {
234 while ((ret = fgetc(mail->
readpipe)) != 255)
298 int i, j, has_period = 0, len;
301 static char specials[] =
302 {
'(',
')',
'<',
'>',
'@',
',',
';',
':',
'\\',
'\"',
'[',
']',
308 strscpy(copy, email,
sizeof(copy));
310 domain = strchr(copy,
'@');
317 if (*copy == 0 || *domain == 0)
321 for (i = 0; i < strlen(copy); i++) {
323 if (copy[i] <= 31 || copy[i] >= 127)
325 for (j = 0; j < 13; j++)
326 if (copy[i] == specials[j])
331 for (i = 0; i < (len = strlen(domain)); i++) {
332 if (domain[i] <= 31 || domain[i] >= 127)
334 for (j = 0; j < 13; j++)
335 if (domain[i] == specials[j])
337 if (domain[i] ==
'.') {
338 if (i == 0 || i == len - 1)
void MailEnd(MailInfo *mail)
#define getstring2(nc, index)
E char * strscpy(char *d, const char *s, size_t len)
E void notice_lang(char *source, User *dest, int message,...)
E void * scalloc(long elsize, long els)
E int is_services_root(User *u)
MailInfo * MailBegin(User *u, NickCore *nc, char *subject, char *service)
int MailValidate(const char *email)
MailInfo * MailRegBegin(User *u, NickRequest *nr, char *subject, char *service)
void MailReset(User *u, NickCore *nc)
MailInfo * MailMemoBegin(NickCore *nc)