summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@drink-coca-cola.info>2010-05-09 19:02:50 -0400
committerAdam <Adam@anope.org>2010-06-18 21:01:09 -0400
commit4e1286ca109d079f32d32f07c344a1ab93899032 (patch)
treeef55488a4cc068f8954a8862ab2e67f2d1872281
parent4149afd45d2c0b9f464d1b4434f7bdaa61873d44 (diff)
Rewrote the mail system to use threading
-rw-r--r--docs/Changes.lang19
-rw-r--r--include/extern.h9
-rw-r--r--include/mail.h24
-rw-r--r--include/services.h1
-rw-r--r--include/threadengine.h9
-rw-r--r--lang/cat.l49
-rw-r--r--lang/de.l53
-rw-r--r--lang/en_us.l56
-rw-r--r--lang/es.l59
-rw-r--r--lang/fr.l59
-rw-r--r--lang/gr.l53
-rw-r--r--lang/hun.l53
-rw-r--r--lang/it.l59
-rw-r--r--lang/nl.l59
-rw-r--r--lang/pl.l71
-rw-r--r--lang/pt.l59
-rw-r--r--lang/ru.l59
-rw-r--r--lang/tr.l49
-rw-r--r--src/Makefile4
-rw-r--r--src/core/ns_register.c40
-rw-r--r--src/core/ns_resetpass.c80
-rw-r--r--src/core/ns_sendpass.c43
-rw-r--r--src/mail.c283
-rw-r--r--src/mail.cpp151
-rw-r--r--src/memoserv.c29
-rw-r--r--src/threadengine_pthread.cpp24
-rw-r--r--src/threadengine_win32.cpp24
27 files changed, 638 insertions, 840 deletions
diff --git a/docs/Changes.lang b/docs/Changes.lang
index 5d576780f..8a9900381 100644
--- a/docs/Changes.lang
+++ b/docs/Changes.lang
@@ -8,12 +8,31 @@ Anope Version 1.9.3
NICK_UNGROUP_SUCCESSFUL
NICK_UNGROUP_SUCCESSFUL
NICK_HELP_CMD_UNGROUP
+ NICK_REG_MAIL
+ NICK_MAIL_TEXT
+ NICK_SENDPASS
*** Mod Strings:
NICK_GLIST_REPLY
+ NICK_RESETPASS_MESSAGE
*** Del Strings:
NICK_GLIST_REPLY_ADMIN
+ NICK_REG_MAIL_HEAD
+ NICK_REG_MAIL_LINE_1
+ NICK_REG_MAIL_LINE_2
+ NICK_REG_MAIL_LINE_3
+ NICK_REG_MAIL_LINE_4
+ NICK_REG_MAIL_LINE_5
+ MEMO_MAIL_TEXT1
+ MEMO_MAIL_TEXT2
+ MEMO_MAIL_TEXT3
+ NICK_SENDPASS_HEAD
+ NICK_SENDPASS_HEAD_1
+ NICK_SENDPASS_HEAD_2
+ NICK_SENDPASS_HEAD_3
+ NICK_SENDPASS_HEAD_4
+ NICK_SENDPASS_HEAD_5
Anope Version 1.9.2
--------------------
diff --git a/include/extern.h b/include/extern.h
index 7998b7c74..ed3323c3b 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -211,15 +211,6 @@ E void log_perror(const char *fmt, ...) FORMAT(printf,1,2);
E void fatal(const char *fmt, ...) FORMAT(printf,1,2);
E void fatal_perror(const char *fmt, ...) FORMAT(printf,1,2);
-/**** mail.c ****/
-
-E MailInfo *MailBegin(User *u, NickCore *nc, char *subject, char *service);
-E MailInfo *MailRegBegin(User *u, NickRequest *nr, char *subject, char *service);
-E MailInfo *MailMemoBegin(NickCore * nc);
-E void MailEnd(MailInfo *mail);
-E void MailReset(User *u, NickCore *nc);
-E int MailValidate(const char *email);
-
/**** main.c ****/
E const char version_number[];
diff --git a/include/mail.h b/include/mail.h
new file mode 100644
index 000000000..d64e36f30
--- /dev/null
+++ b/include/mail.h
@@ -0,0 +1,24 @@
+
+extern CoreExport bool Mail(User *u, NickRequest *nr, const std::string &service, const std::string &subject, const std::string &message);
+extern CoreExport bool Mail(User *u, NickCore *nc, const std::string &service, const std::string &subject, const std::string &message);
+extern CoreExport bool Mail(NickCore *nc, const std::string &subject, const std::string &message);
+extern CoreExport bool MailValidate(const std::string &email);
+
+class MailThread : public Thread
+{
+ private:
+ const std::string MailTo;
+ const std::string Addr;
+ const std::string Subject;
+ const std::string Message;
+
+ bool Success;
+ public:
+ MailThread(const std::string &mailto, const std::string &addr, const std::string &subject, const std::string &message) : Thread(), MailTo(mailto), Addr(addr), Subject(subject), Message(message), Success(false)
+ {
+ }
+
+ ~MailThread();
+
+ void Run();
+};
diff --git a/include/services.h b/include/services.h
index 9b660f3a2..a26802983 100644
--- a/include/services.h
+++ b/include/services.h
@@ -901,6 +901,7 @@ struct Uplink;
class ServerConfig;
#include "extern.h"
+#include "mail.h"
#include "servers.h"
#include "config.h"
diff --git a/include/threadengine.h b/include/threadengine.h
index e2125c6bd..ab668ea50 100644
--- a/include/threadengine.h
+++ b/include/threadengine.h
@@ -36,10 +36,7 @@ class Thread : public Extensible
private:
/* Set to true to tell the thread to finish and we are waiting for it */
bool Exit;
-
- /** Join to the thread, sets the exit state to true
- */
- void Join();
+
public:
/* Handle for this thread */
ThreadHandle Handle;
@@ -52,6 +49,10 @@ class Thread : public Extensible
*/
virtual ~Thread();
+ /** Join to the thread, sets the exit state to true
+ */
+ void Join();
+
/** Sets the exit state as true informing the thread we want it to shut down
*/
void SetExitState();
diff --git a/lang/cat.l b/lang/cat.l
index 48cb0bbbc..40fc7e58d 100644
--- a/lang/cat.l
+++ b/lang/cat.l
@@ -866,18 +866,15 @@ NICK_SENDPASS_UNAVAILABLE
La comanda SENDPASS no esta disponible per l'us d'encriptació.
NICK_SENDPASS_SUBJECT
Clau pel Nickname (%s)
-NICK_SENDPASS_HEAD
- Hola,
-NICK_SENDPASS_LINE_1
- El teu has demanat rebre la clau pel nickname %s via e-mail.
-NICK_SENDPASS_LINE_2
- La clau es %s Per raons de seguretat hauries de canviar-la quant rebis aquest mail.
-NICK_SENDPASS_LINE_3
- Si no saps per que aquest mail t'ha estat enviat, per favor ignora'l.
-NICK_SENDPASS_LINE_4
- Per favor NO RESPONGUIS a aquest EMAIL!
-NICK_SENDPASS_LINE_5
- Administradors de %s.
+NICK_SENDPASS
+ Hi,
+
+ You have requested to receive the password of nickname %s by e-mail.
+ The password is %s. For security purposes, you should change it as soon as you receive this mail.
+
+ If you don't know why this mail was sent to you, please ignore it silently.
+
+ %s administrators.
NICK_SENDPASS_OK
La clau de %s ha estat enviada.
@@ -891,9 +888,8 @@ NICK_RESETPASS_MESSAGE
You have requested to have the password for %s reset.
To reset your password, type %R%s CONFIRM %s
- If you don't know why this mail is sent to you, please ignore it silently.
- PLEASE DON'T ANSWER TO THIS MAIL!
+ If you don't know why this mail was sent to you, please ignore it silently.
%s administrators.
NICK_RESETPASS_COMPLETE
@@ -944,17 +940,14 @@ NICK_ENTER_REG_CODE
A passcode has been sent to %s, please type %R%s confirm <passcode> to complete registration
NICK_REG_MAIL_SUBJECT
Nickname Registration (%s)
-NICK_REG_MAIL_HEAD
+NICK_REG_MAIL
Hi,
-NICK_REG_MAIL_LINE_1
- You have requested to register the following nickname %s.
-NICK_REG_MAIL_LINE_2
+
+ You have requested to register the nickname %s on %s.
Please type " %R%s confirm %s " to complete registration.
-NICK_REG_MAIL_LINE_3
- If you don't know why this mail is sent to you, please ignore it silently.
-NICK_REG_MAIL_LINE_4
- PLEASE DON'T ANSWER TO THIS MAIL!
-NICK_REG_MAIL_LINE_5
+
+ If you don't know why this mail was sent to you, please ignore it silently.
+
%s administrators.
NICK_GETPASS_PASSCODE_IS
Passcode for %s is %s.
@@ -2040,12 +2033,14 @@ MEMO_INFO_X_NOTIFY_SIGNON
# Standard responses
MEMO_MAIL_SUBJECT
New memo
-MEMO_MAIL_TEXT1
+NICK_MAIL_TEXT
Hi %s
-MEMO_MAIL_TEXT2
+
You've just received a new memo from %s. This is memo number %d.
-MEMO_MAIL_TEXT3
- Memo Text:
+
+ Memo text:
+
+ %s
###########################################################################
#
diff --git a/lang/de.l b/lang/de.l
index 70849c49e..663e6079e 100644
--- a/lang/de.l
+++ b/lang/de.l
@@ -885,18 +885,15 @@ NICK_SENDPASS_UNAVAILABLE
SENDPASS Befehl nicht verfügbar, da die Verschlüsselung aktiviert ist.
NICK_SENDPASS_SUBJECT
Nick-Passwort (%s)
-NICK_SENDPASS_HEAD
+NICK_SENDPASS
Hi,
-NICK_SENDPASS_LINE_1
- Du wolltest dir dein Passwort von dem Nicknamen %s via eMail schicken lassen.
-NICK_SENDPASS_LINE_2
- Das Passwort ist %s Aus Sicherheitsgründen solltest du das Passwort nach Erhalt dieser eMail ändern.
-NICK_SENDPASS_LINE_3
- Wenn du nicht weisst, warum du diese Mail erhalten hast, ignoriere sie bitte.
-NICK_SENDPASS_LINE_4
- BITTE NICHT AUF DIESE NACHRICHT ANTWORTEN!
-NICK_SENDPASS_LINE_5
- %s Administratoren.
+
+ You have requested to receive the password of nickname %s by e-mail.
+ The password is %s. For security purposes, you should change it as soon as you receive this mail.
+
+ If you don't know why this mail was sent to you, please ignore it silently.
+
+ %s administrators.
NICK_SENDPASS_OK
Das Passwort von %s wurde per eMail verschickt.
@@ -910,9 +907,8 @@ NICK_RESETPASS_MESSAGE
You have requested to have the password for %s reset.
To reset your password, type %R%s CONFIRM %s
- If you don't know why this mail is sent to you, please ignore it silently.
- PLEASE DON'T ANSWER TO THIS MAIL!
+ If you don't know why this mail was sent to you, please ignore it silently.
%s administrators.
NICK_RESETPASS_COMPLETE
@@ -957,18 +953,15 @@ NICK_ENTER_REG_CODE
Ein Password wurde zu %s gesendet, bitte tippe %R%s confirm <passcode> um die Registrierung abzuschließen.
NICK_REG_MAIL_SUBJECT
Nickname Registrierung (%s)
-NICK_REG_MAIL_HEAD
+NICK_REG_MAIL
Hi,
-NICK_REG_MAIL_LINE_1
- Du hast die Registrierung des Nicknamen %s angefordert.
-NICK_REG_MAIL_LINE_2
- Bitte tippe " %R%s confirm %s " zum Abschluß der Registrierung ein.
-NICK_REG_MAIL_LINE_3
- Wenn du nicht weisst, warum du diese Mail erhalten hast, ignoriere sie bitte.
-NICK_REG_MAIL_LINE_4
- BITTE NICHT AUF DIESE NACHRICHT ANTWORTEN!
-NICK_REG_MAIL_LINE_5
- Die %s Administratoren.
+
+ You have requested to register the nickname %s on %s.
+ Please type " %R%s confirm %s " to complete registration.
+
+ If you don't know why this mail was sent to you, please ignore it silently.
+
+ %s administrators.
NICK_GETPASS_PASSCODE_IS
Passcode für %s ist %s.
NICK_FORCE_REG
@@ -2037,13 +2030,15 @@ MEMO_INFO_X_NOTIFY_SIGNON
# Memo2Mail
MEMO_MAIL_SUBJECT
Neue Memo
-MEMO_MAIL_TEXT1
+NICK_MAIL_TEXT
Hi %s
-MEMO_MAIL_TEXT2
- Du hast gerade eine neue Memo von %s erhalten. Dies ist Memo Nummer %d.
-MEMO_MAIL_TEXT3
- Memo Text:
+ You've just received a new memo from %s. This is memo number %d.
+
+ Memo text:
+
+ %s
+
# Standard responses
MEMO_RSEND_PLEASE_WAIT
Bitte warte %d Sekunden bevor der RSEND Befehl wieder funktioniert.
diff --git a/lang/en_us.l b/lang/en_us.l
index 11cfffc84..42cdc9865 100644
--- a/lang/en_us.l
+++ b/lang/en_us.l
@@ -850,17 +850,14 @@ NICK_SENDPASS_UNAVAILABLE
SENDPASS command unavailable because encryption is in use.
NICK_SENDPASS_SUBJECT
Nickname password (%s)
-NICK_SENDPASS_HEAD
+NICK_SENDPASS
Hi,
-NICK_SENDPASS_LINE_1
+
You have requested to receive the password of nickname %s by e-mail.
-NICK_SENDPASS_LINE_2
- The password is %s for security purposes, you should change it as soon as you receive this mail.
-NICK_SENDPASS_LINE_3
- If you don't know why this mail is sent to you, please ignore it silently.
-NICK_SENDPASS_LINE_4
- PLEASE DON'T ANSWER TO THIS MAIL!
-NICK_SENDPASS_LINE_5
+ The password is %s. For security purposes, you should change it as soon as you receive this mail.
+
+ If you don't know why this mail was sent to you, please ignore it silently.
+
%s administrators.
NICK_SENDPASS_OK
Password of %s has been sent.
@@ -872,12 +869,12 @@ NICK_RESETPASS_SUBJECT
Reset password request for %s
NICK_RESETPASS_MESSAGE
Hi,
-
+
You have requested to have the password for %s reset.
To reset your password, type %R%s CONFIRM %s
- If you don't know why this mail is sent to you, please ignore it silently.
- PLEASE DON'T ANSWER TO THIS MAIL!
-
+
+ If you don't know why this mail was sent to you, please ignore it silently.
+
%s administrators.
NICK_RESETPASS_COMPLETE
Password reset email for %s has been sent.
@@ -919,24 +916,21 @@ NICK_IS_PREREG
This nick is awaiting an e-mail verification code before completing registration.
NICK_ENTER_REG_CODE
A passcode has been sent to %s, please type %R%s confirm <passcode> to complete registration
+NICK_GETPASS_PASSCODE_IS
+ Passcode for %s is %s.
+NICK_FORCE_REG
+ Nickname %s confirmed
NICK_REG_MAIL_SUBJECT
Nickname Registration (%s)
-NICK_REG_MAIL_HEAD
+NICK_REG_MAIL
Hi,
-NICK_REG_MAIL_LINE_1
- You have requested to register the following nickname %s.
-NICK_REG_MAIL_LINE_2
+
+ You have requested to register the nickname %s on %s.
Please type " %R%s confirm %s " to complete registration.
-NICK_REG_MAIL_LINE_3
- If you don't know why this mail is sent to you, please ignore it silently.
-NICK_REG_MAIL_LINE_4
- PLEASE DON'T ANSWER TO THIS MAIL!
-NICK_REG_MAIL_LINE_5
+
+ If you don't know why this mail was sent to you, please ignore it silently.
+
%s administrators.
-NICK_GETPASS_PASSCODE_IS
- Passcode for %s is %s.
-NICK_FORCE_REG
- Nickname %s confirmed
# Confirm responses
NICK_CONFIRM_NOT_FOUND
@@ -1994,12 +1988,14 @@ MEMO_INFO_X_NOTIFY_SIGNON
# Memo2Mail responses
MEMO_MAIL_SUBJECT
New memo
-MEMO_MAIL_TEXT1
+NICK_MAIL_TEXT
Hi %s
-MEMO_MAIL_TEXT2
+
You've just received a new memo from %s. This is memo number %d.
-MEMO_MAIL_TEXT3
- Memo Text:
+
+ Memo text:
+
+ %s
# RSEND responses
MEMO_RSEND_PLEASE_WAIT
diff --git a/lang/es.l b/lang/es.l
index 9a91be68a..f1e4a6f64 100644
--- a/lang/es.l
+++ b/lang/es.l
@@ -870,18 +870,15 @@ NICK_SENDPASS_UNAVAILABLE
El comando SENDPASS no esta disponible por el uso de encriptacion.
NICK_SENDPASS_SUBJECT
Clave para el Nickname (%s)
-NICK_SENDPASS_HEAD
- Hola,
-NICK_SENDPASS_LINE_1
- Tu has pedido recibir la clave para el nickname %s por e-mail.
-NICK_SENDPASS_LINE_2
- La clave es %s Por razones de seguridad deberas cambiarla en cuanto recibas este mail.
-NICK_SENDPASS_LINE_3
- Si no sabes porque este mail ha sido enviado a ti, por favor ignoralo.
-NICK_SENDPASS_LINE_4
- POR FAVOR NO RESPONDER A ESTE EMAIL!
-NICK_SENDPASS_LINE_5
- Administradores de %s.
+NICK_SENDPASS
+ Hi,
+
+ You have requested to receive the password of nickname %s by e-mail.
+ The password is %s. For security purposes, you should change it as soon as you receive this mail.
+
+ If you don't know why this mail was sent to you, please ignore it silently.
+
+ %s administrators.
NICK_SENDPASS_OK
La clave de %s ha sido enviada.
@@ -895,9 +892,8 @@ NICK_RESETPASS_MESSAGE
You have requested to have the password for %s reset.
To reset your password, type %R%s CONFIRM %s
- If you don't know why this mail is sent to you, please ignore it silently.
- PLEASE DON'T ANSWER TO THIS MAIL!
+ If you don't know why this mail was sent to you, please ignore it silently.
%s administrators.
NICK_RESETPASS_COMPLETE
@@ -942,18 +938,15 @@ NICK_ENTER_REG_CODE
El password ha sido enviado a %s, tipea %R%s confirm <password> para completar el registro.
NICK_REG_MAIL_SUBJECT
Registro de Nick (%s)
-NICK_REG_MAIL_HEAD
- Hola,
-NICK_REG_MAIL_LINE_1
- Tu has pedido registrar el nickname %s.
-NICK_REG_MAIL_LINE_2
- Tipea " %R%s confirm %s " para completar el registro.
-NICK_REG_MAIL_LINE_3
- Si no sabes por que has recibido este email, por favor ignorarlo.
-NICK_REG_MAIL_LINE_4
- NO RESPONDAS A ESTE MAIL!
-NICK_REG_MAIL_LINE_5
- Administradores de %s.
+NICK_REG_MAIL
+ Hi,
+
+ You have requested to register the nickname %s on %s.
+ Please type " %R%s confirm %s " to complete registration.
+
+ If you don't know why this mail was sent to you, please ignore it silently.
+
+ %s administrators.
NICK_GETPASS_PASSCODE_IS
El password para %s es %s.
NICK_FORCE_REG
@@ -2032,12 +2025,14 @@ MEMO_INFO_X_NOTIFY_SIGNON
# Standard responses
MEMO_MAIL_SUBJECT
Nuevo memo
-MEMO_MAIL_TEXT1
- Hola %s
-MEMO_MAIL_TEXT2
- Acabas de recibir un nuevo memo de %s. Es el memo numero %d.
-MEMO_MAIL_TEXT3
- Texto del Memo:
+NICK_MAIL_TEXT
+ Hi %s
+
+ You've just received a new memo from %s. This is memo number %d.
+
+ Memo text:
+
+ %s
# Standard responses
MEMO_RSEND_PLEASE_WAIT
diff --git a/lang/fr.l b/lang/fr.l
index 23b7bc8aa..8172746ad 100644
--- a/lang/fr.l
+++ b/lang/fr.l
@@ -877,18 +877,15 @@ NICK_SENDPASS_UNAVAILABLE
La commande SENDPASS est indisponible car le cryptage est utilisé.
NICK_SENDPASS_SUBJECT
Mot de passe du pseudo %s
-NICK_SENDPASS_HEAD
- Bonjour,
-NICK_SENDPASS_LINE_1
- Vous avez demandé à recevoir le mot de passe du pseudo %s par e-mail.
-NICK_SENDPASS_LINE_2
- Le mot de passe est %s . Pour des raisons de sécurité, vous devriez le changer dès que vous lisez cet e-mail.
-NICK_SENDPASS_LINE_3
- Si vous ne savez pas de quoi il retourne dans cet e-mail, il s'agit probablement d'une erreur, nous vous prions de nous excuser et vous demandons d'ignorer cet e-mail.
-NICK_SENDPASS_LINE_4
- NE REPONDEZ PAS À CE MAIL!
-NICK_SENDPASS_LINE_5
- Les administrateurs de %s.
+NICK_SENDPASS
+ Hi,
+
+ You have requested to receive the password of nickname %s by e-mail.
+ The password is %s. For security purposes, you should change it as soon as you receive this mail.
+
+ If you don't know why this mail was sent to you, please ignore it silently.
+
+ %s administrators.
NICK_SENDPASS_OK
Le mot de passe de %s a été envoyé.
@@ -902,9 +899,8 @@ NICK_RESETPASS_MESSAGE
You have requested to have the password for %s reset.
To reset your password, type %R%s CONFIRM %s
- If you don't know why this mail is sent to you, please ignore it silently.
- PLEASE DON'T ANSWER TO THIS MAIL!
+ If you don't know why this mail was sent to you, please ignore it silently.
%s administrators.
NICK_RESETPASS_COMPLETE
@@ -955,18 +951,15 @@ NICK_ENTER_REG_CODE
Un passcode a été envoyé à %s, merci de taper %R%s confirm <passcode> une fois que vous l'aurez reçu pour compléter l'enregistrement.
NICK_REG_MAIL_SUBJECT
Enregistrement d'un pseudo (%s)
-NICK_REG_MAIL_HEAD
- Bonjour,
-NICK_REG_MAIL_LINE_1
- Vous venez de demander l'enregistrement du pseudo %s.
-NICK_REG_MAIL_LINE_2
- Veuillez tapez " %R%s confirm %s " sur IRC afin de valider l'enregistrement.
-NICK_REG_MAIL_LINE_3
- Si vous ne savez pas pourquoi vous avez reçu cet email, ignorez-le.
-NICK_REG_MAIL_LINE_4
- NE REPONDEZ PAS À CE MESSAGE.
-NICK_REG_MAIL_LINE_5
- Les administrateurs de %s.
+NICK_REG_MAIL
+ Hi,
+
+ You have requested to register the nickname %s on %s.
+ Please type " %R%s confirm %s " to complete registration.
+
+ If you don't know why this mail was sent to you, please ignore it silently.
+
+ %s administrators.
NICK_GETPASS_PASSCODE_IS
Le passcode pour %s est %s.
NICK_FORCE_REG
@@ -2047,12 +2040,14 @@ MEMO_INFO_X_NOTIFY_SIGNON
# Standard responses
MEMO_MAIL_SUBJECT
Nouveau mémo
-MEMO_MAIL_TEXT1
- Bonjour %s,
-MEMO_MAIL_TEXT2
- Vous venez de recevoir un mémo de %s. Le numéro de ce mémo est %d.
-MEMO_MAIL_TEXT3
- Mémo:
+NICK_MAIL_TEXT
+ Hi %s
+
+ You've just received a new memo from %s. This is memo number %d.
+
+ Memo text:
+
+ %s
###########################################################################
#
diff --git a/lang/gr.l b/lang/gr.l
index 15a40c8e0..8ab9a5fda 100644
--- a/lang/gr.l
+++ b/lang/gr.l
@@ -865,18 +865,15 @@ NICK_SENDPASS_UNAVAILABLE
Ç SENDPASS åíôïëÞ äåí åßíáé äéáèÝóéìç ãéáôß ÷ñçóéìïðïéåßôáé ç êùäéêïðïßçóç.
NICK_SENDPASS_SUBJECT
Ï êùäéêüò ôïõ øåõäþíõìïõ (%s)
-NICK_SENDPASS_HEAD
- ÃåéÜ,
-NICK_SENDPASS_LINE_1
- Åßóáé óôçí ëßóôá ãéá íá ëÜâåéò ôïí êùäéêü ôïõ øåõäþíõìïý óïõ %s ìÝóù e-mail.
-NICK_SENDPASS_LINE_2
- Ï êùäéêü óïõ åßíáé %s Ãéá ðåñéóóüôåñç áóöÜëåéá, èá ðñÝðåé íá áëëÜîåéò üóï óýíôïìá ãßíåôáé ôïí êùäéêü óïõ áöïý ëÜâåéò ôïí êùäéêü óïõ óå e-mail.
-NICK_SENDPASS_LINE_3
- Áí äåí ãíùñßæåéò ãéáôß áõôü ôï e-mail óôÜëèçêå óå óÝíá, ðáñáêáëþ áãíüçóÝ ôï ÷ùñßò åñùôÞóåéò êëð.
-NICK_SENDPASS_LINE_4
- ÐÁÑÁÊÁËÙ ÌÇÍ ÁÐÁÍÔÇÓÅÉÓ ÓÅ ÁÕÔÏ ÔÏ E-MAIL!
-NICK_SENDPASS_LINE_5
- %s åðéêåöáëåßò õðçñåóéþí.
+NICK_SENDPASS
+ Hi,
+
+ You have requested to receive the password of nickname %s by e-mail.
+ The password is %s. For security purposes, you should change it as soon as you receive this mail.
+
+ If you don't know why this mail was sent to you, please ignore it silently.
+
+ %s administrators.
NICK_SENDPASS_OK
Ï êùäéêüò ôïõ %s Ý÷åé óôáëèåß.
@@ -890,10 +887,9 @@ NICK_RESETPASS_MESSAGE
You have requested to have the pasword for %s reset.
To reset your password, type %R%s CONFIRM %s
- If you don't know why this mail is sent to you, please ignore it silently.
-
- PLEASE DON'T ANSWER TO THIS MAIL!
-
+
+ If you don't know why this mail was sent to you, please ignore it silently.
+
%s administrators.
NICK_RESETPASS_COMPLETE
Password reset email for %s has been sent.
@@ -943,17 +939,14 @@ NICK_ENTER_REG_CODE
A passcode has been sent to %s, please type %R%s confirm <passcode> to complete registration
NICK_REG_MAIL_SUBJECT
Nickname Registration (%s)
-NICK_REG_MAIL_HEAD
+NICK_REG_MAIL
Hi,
-NICK_REG_MAIL_LINE_1
- You have requested to register the following nickname %s.
-NICK_REG_MAIL_LINE_2
+
+ You have requested to register the nickname %s on %s.
Please type " %R%s confirm %s " to complete registration.
-NICK_REG_MAIL_LINE_3
- If you don't know why this mail is sent to you, please ignore it silently.
-NICK_REG_MAIL_LINE_4
- PLEASE DON'T ANSWER TO THIS MAIL!
-NICK_REG_MAIL_LINE_5
+
+ If you don't know why this mail was sent to you, please ignore it silently.
+
%s administrators.
NICK_GETPASS_PASSCODE_IS
Passcode for %s is %s.
@@ -2042,12 +2035,14 @@ MEMO_INFO_X_NOTIFY_SIGNON
# Standard responses
MEMO_MAIL_SUBJECT
New memo
-MEMO_MAIL_TEXT1
+NICK_MAIL_TEXT
Hi %s
-MEMO_MAIL_TEXT2
+
You've just received a new memo from %s. This is memo number %d.
-MEMO_MAIL_TEXT3
- Memo Text:
+
+ Memo text:
+
+ %s
###########################################################################
#
diff --git a/lang/hun.l b/lang/hun.l
index 815e5b57b..1e277bd25 100644
--- a/lang/hun.l
+++ b/lang/hun.l
@@ -862,18 +862,15 @@ NICK_SENDPASS_UNAVAILABLE
SENDPASS nem elérhetõ, amíg az encryption használatban van.
NICK_SENDPASS_SUBJECT
Nicknév jelszó (%s)
-NICK_SENDPASS_HEAD
+NICK_SENDPASS
Hi,
-NICK_SENDPASS_LINE_1
- Azt kérted, hogy a %s nicknév jelszavát küldjük el e-mailben.
-NICK_SENDPASS_LINE_2
- A jelszavad %s Ezt a biztosnág miatt meg kell váltóztatni, miután megkaptad ezt a levelet.
-NICK_SENDPASS_LINE_3
- Ha nem tudod miért kaptad ezt a levelet, akkor kérlek hagyd figyelmen kivül!
-NICK_SENDPASS_LINE_4
- ERRE A LEVÉLRE NE VÁLASZOLJ!!!
-NICK_SENDPASS_LINE_5
- %s adminisztrátorok.
+
+ You have requested to receive the password of nickname %s by e-mail.
+ The password is %s. For security purposes, you should change it as soon as you receive this mail.
+
+ If you don't know why this mail was sent to you, please ignore it silently.
+
+ %s administrators.
NICK_SENDPASS_OK
%s nick jelszava elküldve.
@@ -887,9 +884,8 @@ NICK_RESETPASS_MESSAGE
You have requested to have the password for %s reset.
To reset your password, type %R%s CONFIRM %s
- If you don't know why this mail is sent to you, please ignore it silently.
- PLEASE DON'T ANSWER TO THIS MAIL
+ If you don't know why this mail was sent to you, please ignore it silently.
%s administrators.
NICK_RESETPASS_COMPLETE
@@ -934,18 +930,15 @@ NICK_ENTER_REG_CODE
A kód a %s címre lett küldve, írd be %R%s confirm <kód> a regisztráció befejezéséhez.
NICK_REG_MAIL_SUBJECT
Nicknév Regisztráció (%s)
-NICK_REG_MAIL_HEAD
+NICK_REG_MAIL
Hi,
-NICK_REG_MAIL_LINE_1
- Te kérelmeztad a %s nick regisztrálását.
-NICK_REG_MAIL_LINE_2
- Írd be: " %R%s confirm %s ", hogy befejezd a regisztrációt.
-NICK_REG_MAIL_LINE_3
- Ha nem tudod miért kaptad a levelet, kérlek hagyd figyelmen kívül!
-NICK_REG_MAIL_LINE_4
- NE VÁLASZOLJ A LEVÉLRE!
-NICK_REG_MAIL_LINE_5
- %s adminisztrátorok.
+
+ You have requested to register the nickname %s on %s.
+ Please type " %R%s confirm %s " to complete registration.
+
+ If you don't know why this mail was sent to you, please ignore it silently.
+
+ %s administrators.
NICK_GETPASS_PASSCODE_IS
Kód a %s nickhez: %s.
NICK_FORCE_REG
@@ -2027,12 +2020,14 @@ MEMO_INFO_X_NOTIFY_SIGNON
# Memo2Mail válaszok
MEMO_MAIL_SUBJECT
Új memo
-MEMO_MAIL_TEXT1
+NICK_MAIL_TEXT
Hi %s
-MEMO_MAIL_TEXT2
- Kaptál egy új memo üzenetet %s nicktõl. Ez a memo a %d sorszámú.
-MEMO_MAIL_TEXT3
- Memo Szöveg:
+
+ You've just received a new memo from %s. This is memo number %d.
+
+ Memo text:
+
+ %s
# RSEND válaszok
MEMO_RSEND_PLEASE_WAIT
diff --git a/lang/it.l b/lang/it.l
index 493e651ee..86b16f786 100644
--- a/lang/it.l
+++ b/lang/it.l
@@ -852,18 +852,15 @@ NICK_SENDPASS_UNAVAILABLE
Il comando SENDPASS non è disponibile perché è in uso la criptazione dei dati.
NICK_SENDPASS_SUBJECT
Password del nick (%s)
-NICK_SENDPASS_HEAD
- Salve,
-NICK_SENDPASS_LINE_1
- Hai richiesto di ricevere via e-mail la password del nick %s.
-NICK_SENDPASS_LINE_2
- La password è %s Per ragioni di sicurezza, ti invitiamo a cambiarla il più presto possibile con il comando "/ns set password".
-NICK_SENDPASS_LINE_3
- Se non sai perché hai ricevuto questa mail, ignorala.
-NICK_SENDPASS_LINE_4
- IMPORTANTE! Non rispondere a questa mail!
-NICK_SENDPASS_LINE_5
- Gli amministratori di %s.
+NICK_SENDPASS
+ Hi,
+
+ You have requested to receive the password of nickname %s by e-mail.
+ The password is %s. For security purposes, you should change it as soon as you receive this mail.
+
+ If you don't know why this mail was sent to you, please ignore it silently.
+
+ %s administrators.
NICK_SENDPASS_OK
La password di %s è stata inviata.
@@ -877,9 +874,8 @@ NICK_RESETPASS_MESSAGE
You have requested to have the password for %s reset.
To reset your password, type %R%s CONFRM %s
- If you don't know why this mail is sent to you, please ignore it silently.
- PLEASE DON'T ANSWER TO THIS MAIL!
+ If you don't know why this mail was sent to you, please ignore it silently.
%s administrators.
NICK_RESETPASS_COMPLETE
@@ -924,18 +920,15 @@ NICK_ENTER_REG_CODE
Un codice di attivazione è stato inviato a %s. Digita %R%s CONFIRM <codice> per completare la registrazione.
NICK_REG_MAIL_SUBJECT
Registrazione del nick (%s)
-NICK_REG_MAIL_HEAD
- Salve,
-NICK_REG_MAIL_LINE_1
- Hai richiesto la registrazione del nick %s.
-NICK_REG_MAIL_LINE_2
- Digita " %R%s CONFIRM %s " (senza virgolette) per completare la registrazione.
-NICK_REG_MAIL_LINE_3
- Se non sai perché hai ricevuto questa e-mail, ignorala.
-NICK_REG_MAIL_LINE_4
- NON RISPONDERE A QUESTA MAIL!
-NICK_REG_MAIL_LINE_5
- Gli amministratori di %s.
+NICK_REG_MAIL
+ Hi,
+
+ You have requested to register the nickname %s on %s.
+ Please type " %R%s confirm %s " to complete registration.
+
+ If you don't know why this mail was sent to you, please ignore it silently.
+
+ %s administrators.
NICK_GETPASS_PASSCODE_IS
Il codice di attivazione per %s is %s.
NICK_FORCE_REG
@@ -2000,12 +1993,14 @@ MEMO_INFO_X_NOTIFY_SIGNON
# Memo2Mail responses
MEMO_MAIL_SUBJECT
Nuovo memo
-MEMO_MAIL_TEXT1
- Ciao %s
-MEMO_MAIL_TEXT2
- Hai appena ricevuto un nuovo memo da %s. Questo è il memo numero %d.
-MEMO_MAIL_TEXT3
- Testo del memo:
+NICK_MAIL_TEXT
+ Hi %s
+
+ You've just received a new memo from %s. This is memo number %d.
+
+ Memo text:
+
+ %s
# RSEND responses
MEMO_RSEND_PLEASE_WAIT
diff --git a/lang/nl.l b/lang/nl.l
index 3c7c86e46..b63e98377 100644
--- a/lang/nl.l
+++ b/lang/nl.l
@@ -869,18 +869,15 @@ NICK_SENDPASS_UNAVAILABLE
SENDPASS commando is onbeschikbaar omdat encryptie aanstaat.
NICK_SENDPASS_SUBJECT
Nick wachtwoord (%s)
-NICK_SENDPASS_HEAD
- Hoi,
-NICK_SENDPASS_LINE_1
- Je hebt het wachtwoord van nick %s via e-mail aangevraagd.
-NICK_SENDPASS_LINE_2
- Het wachtwoord is %s Wegens veiligheidsredenen kun je dit het beste zo snel mogelijk veranderen.
-NICK_SENDPASS_LINE_3
- Als je niet weet waarom deze email gestuurd is, negeer deze dan.
-NICK_SENDPASS_LINE_4
- ANTWOORD NIET OP DEZE E-MAIL!
-NICK_SENDPASS_LINE_5
- %s beheerders.
+NICK_SENDPASS
+ Hi,
+
+ You have requested to receive the password of nickname %s by e-mail.
+ The password is %s. For security purposes, you should change it as soon as you receive this mail.
+
+ If you don't know why this mail was sent to you, please ignore it silently.
+
+ %s administrators.
NICK_SENDPASS_OK
Wachtwoord %s is verstuurd.
@@ -893,9 +890,8 @@ NICK_RESETPASS_MESSAGE
You have requested to have the password for %s reset.
To reset your password, type %R%s CONFIRM %s
- If you don't know why this mail is sent to you, please ignore it silently.
- PLEASE DON'T ANSWER TO THIS MAIL
+ If you don't know why this mail was sent to you, please ignore it silently.
%s administrators.
@@ -941,18 +937,15 @@ NICK_ENTER_REG_CODE
Een verificatiecode is verstuurd naar %s. Type %R%s confirm <verificatiecode> om de registratie te voltooien.
NICK_REG_MAIL_SUBJECT
Nickname Registratie (%s)
-NICK_REG_MAIL_HEAD
- Hoi,
-NICK_REG_MAIL_LINE_1
- Je hebt een aanvraag ingediend om de nickname %s te registreren.
-NICK_REG_MAIL_LINE_2
- Type " %R%s confirm %s " om de registratie te voltooien.
-NICK_REG_MAIL_LINE_3
- Als je niet weet waarom deze e-mail naar je gestuurd is, negeer deze dan.
-NICK_REG_MAIL_LINE_4
- REAGEER NIET OP DEZE MAIL!
-NICK_REG_MAIL_LINE_5
- %s administrators.
+NICK_REG_MAIL
+ Hi,
+
+ You have requested to register the nickname %s on %s.
+ Please type " %R%s confirm %s " to complete registration.
+
+ If you don't know why this mail was sent to you, please ignore it silently.
+
+ %s administrators.
NICK_GETPASS_PASSCODE_IS
Verificatiecode voor %s is %s.
NICK_FORCE_REG
@@ -2025,12 +2018,14 @@ MEMO_INFO_X_NOTIFY_SIGNON
# Standard responses
MEMO_MAIL_SUBJECT
Nieuwe memo
-MEMO_MAIL_TEXT1
- Hoi %s
-MEMO_MAIL_TEXT2
- Je hebt zojuist een memo ontvangen van %s. Het gaat om memo nummer %d.
-MEMO_MAIL_TEXT3
- Inhoud van de memo:
+NICK_MAIL_TEXT
+ Hi %s
+
+ You've just received a new memo from %s. This is memo number %d.
+
+ Memo text:
+
+ %s
###########################################################################
#
diff --git a/lang/pl.l b/lang/pl.l
index d91c2a375..4898de720 100644
--- a/lang/pl.l
+++ b/lang/pl.l
@@ -1096,24 +1096,15 @@ NICK_SENDPASS_UNAVAILABLE
NICK_SENDPASS_SUBJECT
Has³o do nicka %s
-NICK_SENDPASS_HEAD
- Witaj!
-
-NICK_SENDPASS_LINE_1
- Za¿±da³e¶(a¶) wys³ania has³a do nicka %s na e-mail.
-
-NICK_SENDPASS_LINE_2
- Twoje has³o to: %s
- Dla w³asnego bezpieczeñstwa nale¿y to has³o natychmiast zmieniæ na inne.
-
-NICK_SENDPASS_LINE_3
- Je¶li nie wiesz dlaczego ta wiadomo¶æ dotar³a do Ciebie zignoruj j±. Je¶li ta sytuacja bêdzie siê powtarzaæ skontaktuj siê z administratorem sieci.
-
-NICK_SENDPASS_LINE_4
- PROSZÊ NIE ODPOWIADAÆ NA T¡ WIADOMO¦Æ!
-
-NICK_SENDPASS_LINE_5
- Administratorzy sieci %s.
+NICK_SENDPASS
+ Hi,
+
+ You have requested to receive the password of nickname %s by e-mail.
+ The password is %s. For security purposes, you should change it as soon as you receive this mail.
+
+ If you don't know why this mail was sent to you, please ignore it silently.
+
+ %s administrators.
NICK_SENDPASS_OK
Has³o do nicka %s zosta³o wys³ane.
@@ -1128,9 +1119,8 @@ NICK_RESETPASS_MESSAGE
You have requested to have the password for %s reset.
To reset your password, type %R%s CONFIRM %s
- If you don't know why this mail is sent to you, please ignore it silently.
- PLEASE DON'T ANSWER TO THIS MAIL!
+ If you don't know why this mail was sent to you, please ignore it silently.
%s administrators.
NICK_RESETPASS_COMPLETE
@@ -1189,22 +1179,15 @@ NICK_ENTER_REG_CODE
NICK_REG_MAIL_SUBJECT
Rejestracja nicka %s
-NICK_REG_MAIL_HEAD
- Witaj!
-
-NICK_REG_MAIL_LINE_1
- Chcesz zarejestrowaæ nastêpuj±cy nick: %s.
-
-NICK_REG_MAIL_LINE_2
- Proszê napisaæ %R%s CONFIRM %s aby dokoñczyæ rejestracjê.
-
-NICK_REG_MAIL_LINE_3
- Je¶li nie wiesz dlaczego ta wiadomo¶æ dotar³a do Ciebie zignoruj j±. Je¶li sytuacja bêdzie siê powtarzaæ skontaktuj siê z administratorem sieci.
-NICK_REG_MAIL_LINE_4
- PROSZÊ NIE ODPOWIADAÆ NA T¡ WIADOMO¦Æ!
-
-NICK_REG_MAIL_LINE_5
- Administratorzy sieci %s.
+NICK_REG_MAIL
+ Hi,
+
+ You have requested to register the nickname %s on %s.
+ Please type " %R%s confirm %s " to complete registration.
+
+ If you don't know why this mail was sent to you, please ignore it silently.
+
+ %s administrators.
NICK_GETPASS_PASSCODE_IS
Kod rejestracyjny dla %s to %s.
@@ -2640,14 +2623,14 @@ MEMO_INFO_X_NOTIFY_SIGNON
MEMO_MAIL_SUBJECT
Nowa wiadomo¶æ
-MEMO_MAIL_TEXT1
- Witaj %s!
-
-MEMO_MAIL_TEXT2
- W³a¶nie nadesz³a now± wiadomo¶æ od %s, ma numer %d.
-
-MEMO_MAIL_TEXT3
- Tre¶æ wiadomo¶ci:
+NICK_MAIL_TEXT
+ Hi %s
+
+ You've just received a new memo from %s. This is memo number %d.
+
+ Memo text:
+
+ %s
# RSEND responses
MEMO_RSEND_PLEASE_WAIT
diff --git a/lang/pt.l b/lang/pt.l
index e1fc58e23..a26479ce3 100644
--- a/lang/pt.l
+++ b/lang/pt.l
@@ -871,18 +871,15 @@ NICK_SENDPASS_UNAVAILABLE
Comando SENDPASS não disponível: modo de encriptação ativado.
NICK_SENDPASS_SUBJECT
Senha do nick (%s)
-NICK_SENDPASS_HEAD
- Olá,
-NICK_SENDPASS_LINE_1
- Você pediu para que a senha do nick %s fosse enviada por e-mail.
-NICK_SENDPASS_LINE_2
- A senha é %s. Por motivos de segurança, recomendamos que você mude sua senha após ler este e-mail.
-NICK_SENDPASS_LINE_3
- Se você não souba porque este e-mail lhe foi enviado, por favor ignore-o.
-NICK_SENDPASS_LINE_4
- NÃO RESPONDA A ESTE E-MAIL!
-NICK_SENDPASS_LINE_5
- Administradores %s.
+NICK_SENDPASS
+ Hi,
+
+ You have requested to receive the password of nickname %s by e-mail.
+ The password is %s. For security purposes, you should change it as soon as you receive this mail.
+
+ If you don't know why this mail was sent to you, please ignore it silently.
+
+ %s administrators.
NICK_SENDPASS_OK
Senha para %s foi enviada.
@@ -896,9 +893,8 @@ NICK_RESETPASS_MESSAGE
You have requested to have the password for %s reset.
To reset your password, type %R%s CONFIRM %s
- If you don't know why this mail is sent to you, please ignore it silently.
- PLEASE DON'T ANSWER TO THIS MAIL!
+ If you don't know why this mail was sent to you, please ignore it silently.
%s administrators.
NICK_RESETPASS_COMPLETE
@@ -943,18 +939,15 @@ NICK_ENTER_REG_CODE
O passcode foi enviado para %s, por favor digite %R%s confirm <passcode> para completar o registro.
NICK_REG_MAIL_SUBJECT
Registro de nick (%s)
-NICK_REG_MAIL_HEAD
- Olá,
-NICK_REG_MAIL_LINE_1
- Você solicitou o registro do seguinte nick: %s.
-NICK_REG_MAIL_LINE_2
- Por favor digite %R%s confirm %s para completar o registro.
-NICK_REG_MAIL_LINE_3
- Se você não sabe porque este e-mail lhe foi enviado, por favor ignore-o com sigilo.
-NICK_REG_MAIL_LINE_4
- POR FAVOR NÃO RESPONDA A ESTE E-MAIL!
-NICK_REG_MAIL_LINE_5
- Administradores %s.
+NICK_REG_MAIL
+ Hi,
+
+ You have requested to register the nickname %s on %s.
+ Please type " %R%s confirm %s " to complete registration.
+
+ If you don't know why this mail was sent to you, please ignore it silently.
+
+ %s administrators.
NICK_GETPASS_PASSCODE_IS
Passcode para %s é %s.
NICK_FORCE_REG
@@ -2018,12 +2011,14 @@ MEMO_INFO_X_NOTIFY_SIGNON
# Memo2Mail responses
MEMO_MAIL_SUBJECT
Novo memo
-MEMO_MAIL_TEXT1
- Olá %s
-MEMO_MAIL_TEXT2
- Você recebeu um novo memo de %s. Este é seu memo número %d.
-MEMO_MAIL_TEXT3
- Mensagem do memo:
+NICK_MAIL_TEXT
+ Hi %s
+
+ You've just received a new memo from %s. This is memo number %d.
+
+ Memo text:
+
+ %s
# RSEND responses
MEMO_RSEND_PLEASE_WAIT
diff --git a/lang/ru.l b/lang/ru.l
index 0902d689a..257b29292 100644
--- a/lang/ru.l
+++ b/lang/ru.l
@@ -853,18 +853,15 @@ NICK_SENDPASS_UNAVAILABLE
Êîìàíäà SENDPASS íåäîñòóïíà, òàê êàê âêëþ÷åíî øèôðîâàíèå ïàðîëåé.
NICK_SENDPASS_SUBJECT
Ïàðîëü äëÿ íèêà %s
-NICK_SENDPASS_HEAD
- Äîáðîãî âðåìåíè ñóòîê, ìíîãîóâàæàåìûé/àÿ!
-NICK_SENDPASS_LINE_1
- Áûë ïîëó÷åí çàïðîñ íà âîññòàíîâëåíèå ïàðîëÿ îò âàøåãî íèêà %s
-NICK_SENDPASS_LINE_2
- Âàø ïàðîëü %s * Äëÿ áîëüøåé áåçîïàñíîñòè, ðåêîìåíäóåòñÿ èçìåíèòü åãî êàê ìîæíî ñêîðåå.
-NICK_SENDPASS_LINE_3
- Åñëè âû íå çàïðàøèâàëè ýòî ïèñüìî, ïðîñòî ïðîèãíîðèðóéòå åãî.
-NICK_SENDPASS_LINE_4
- ÏÎÆÀËÓÉÑÒÀ, ÍÅ ÎÒÂÅ×ÀÉÒÅ ÍÀ ÝÒÎ ÏÈÑÜÌÎ!
-NICK_SENDPASS_LINE_5
- Àäìèíèñòðàöèÿ ñåòè %s.
+NICK_SENDPASS
+ Hi,
+
+ You have requested to receive the password of nickname %s by e-mail.
+ The password is %s. For security purposes, you should change it as soon as you receive this mail.
+
+ If you don't know why this mail was sent to you, please ignore it silently.
+
+ %s administrators.
NICK_SENDPASS_OK
Ïàðîëü äëÿ íèêà %s áûë âûñëàí íà åãî email-àäðåñ.
@@ -878,9 +875,8 @@ NICK_RESETPASS_MESSAGE
You have requested to have the password for %s reset.
To reset your password, type %R%s CONFIRM %s
- If you don't know why this mail is sent to you, please ignore it silently.
- PLEASE DON'T ANSWER TO THIS MAIL!
+ If you don't know why this mail was sent to you, please ignore it silently.
%s administrators.
NICK_RESETPASS_COMPLETE
@@ -925,18 +921,15 @@ NICK_ENTER_REG_CODE
Auth-êîä áûë âûñëàí íà %s, äëÿ çàâåðøåíèÿ ðåãèñòðàöèè èñïîëüçóéòå êîìàíäó %R%s confirm auth-êîä
NICK_REG_MAIL_SUBJECT
Ðåãèñòðàöèÿ íèêà %s
-NICK_REG_MAIL_HEAD
- Äîáðîãî âðåìåíè ñóòîê, ìíîãîóâàæàåìûé/àÿ!
-NICK_REG_MAIL_LINE_1
- Âû çàïðîñèëè ðåãèñòðàöèþ íèêà %s
-NICK_REG_MAIL_LINE_2
- Äëÿ çàâåðøåíèÿ ïðîöåññà ðåãèñòðàöèè íèêà, âîñïîëüçóéòåñü êîìàíäîé %R%s CONFIRM %s
-NICK_REG_MAIL_LINE_3
- Åñëè âû íå çàïðàøèâàëè ýòî ïèñüìî - ïðîñòî ïðîèãíîðèðóéòå åãî.
-NICK_REG_MAIL_LINE_4
- ÏÎÆÀËÓÉÑÒÀ, ÍÅ ÎÒÂÅ×ÀÉÒÅ ÍÀ ÝÒÎ ÏÈÑÜÌÎ!
-NICK_REG_MAIL_LINE_5
- Àäìèíèñòðàöèÿ ñåòè %s.
+NICK_REG_MAIL
+ Hi,
+
+ You have requested to register the nickname %s on %s.
+ Please type " %R%s confirm %s " to complete registration.
+
+ If you don't know why this mail was sent to you, please ignore it silently.
+
+ %s administrators.
NICK_GETPASS_PASSCODE_IS
Ïàðîëü äëÿ íèêà %s - %s.
NICK_FORCE_REG
@@ -1995,13 +1988,15 @@ MEMO_INFO_X_NOTIFY_SIGNON
# Memo2Mail responses
MEMO_MAIL_SUBJECT
Íîâîå ìåìî-ñîîáùåíèå
-MEMO_MAIL_TEXT1
- Çäðàñòâóéòå %s.
-MEMO_MAIL_TEXT2
- Âû ïîëó÷èëè íîâîå ìåìî-ñîîáùåíèå îò %s. Íîìåð ñîîáùåíèÿ: %d.
-MEMO_MAIL_TEXT3
- Òåêñò ñîîáùåíèÿ:
+NICK_MAIL_TEXT
+ Hi %s
+
+ You've just received a new memo from %s. This is memo number %d.
+ Memo text:
+
+ %s
+
# RSEND responses
MEMO_RSEND_PLEASE_WAIT
Ïîæàëóéñòà, ïîäîæäèòå %d ñåêóíä ïåðåä ïîâòîðíûì èñïîëüçîâàíèåì êîìàíäû RSEND.
diff --git a/lang/tr.l b/lang/tr.l
index fe6db966d..30e9a6860 100644
--- a/lang/tr.l
+++ b/lang/tr.l
@@ -872,18 +872,15 @@ NICK_SENDPASS_UNAVAILABLE
SENDPASS komutu devre dýþý çünkü þifreleme(encryption) devrede.
NICK_SENDPASS_SUBJECT
Nick þifresi (%s)
-NICK_SENDPASS_HEAD
- Selam,
-NICK_SENDPASS_LINE_1
- %s nickinizin þifresinin e-mail adresinize yollanmasýný istemiþsiniz.
-NICK_SENDPASS_LINE_2
- Nickinizin Þifresi %s Güvenlik nedenlerinden dolayý, bu maili aldýktan sonra deðiþtirseniz iyi olur.
-NICK_SENDPASS_LINE_3
- Eðer bu mailin neden size gönderildiðini bilmiyorsanýz, maili ciddiye almayýn.
-NICK_SENDPASS_LINE_4
- LÜTFEN BU MAÝLE CEVAP VERMEYÝN!
-NICK_SENDPASS_LINE_5
- %s yönetimi.
+NICK_SENDPASS
+ Hi,
+
+ You have requested to receive the password of nickname %s by e-mail.
+ The password is %s. For security purposes, you should change it as soon as you receive this mail.
+
+ If you don't know why this mail was sent to you, please ignore it silently.
+
+ %s administrators.
NICK_SENDPASS_OK
%s nickinin þifresi gönderildi.
@@ -897,9 +894,8 @@ NICK_RESETPASS_MESSAGE
You have requested to have the password for %s reset.
To reset your password, type %R%s CONFIRM %s
- If you don't know why this mail is sent to you, please ignore it silently.
- PLEASE DON'T ANSWER TO THIS MAIL!
+ If you don't know why this mail was sent to you, please ignore it silently.
%s administrators.
NICK_RESETPASS_COMPLETE
@@ -950,17 +946,14 @@ NICK_ENTER_REG_CODE
A passcode has been sent to %s, please type %R%s confirm <passcode> to complete registration
NICK_REG_MAIL_SUBJECT
Nickname Registration (%s)
-NICK_REG_MAIL_HEAD
+NICK_REG_MAIL
Hi,
-NICK_REG_MAIL_LINE_1
- You have requested to register the following nickname %s.
-NICK_REG_MAIL_LINE_2
+
+ You have requested to register the nickname %s on %s.
Please type " %R%s confirm %s " to complete registration.
-NICK_REG_MAIL_LINE_3
- If you don't know why this mail is sent to you, please ignore it silently.
-NICK_REG_MAIL_LINE_4
- PLEASE DON'T ANSWER TO THIS MAIL!
-NICK_REG_MAIL_LINE_5
+
+ If you don't know why this mail was sent to you, please ignore it silently.
+
%s administrators.
NICK_GETPASS_PASSCODE_IS
Passcode for %s is %s.
@@ -2036,12 +2029,14 @@ MEMO_INFO_X_NOTIFY_SIGNON
# Standard responses
MEMO_MAIL_SUBJECT
New memo
-MEMO_MAIL_TEXT1
+NICK_MAIL_TEXT
Hi %s
-MEMO_MAIL_TEXT2
+
You've just received a new memo from %s. This is memo number %d.
-MEMO_MAIL_TEXT3
- Memo Text:
+
+ Memo text:
+
+ %s
###########################################################################
#
diff --git a/src/Makefile b/src/Makefile
index 3e66abc3d..c82f9f5b4 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -9,7 +9,7 @@ INCLUDES = ../include/commands.h ../include/defs.h ../include/language.h \
../include/messages.h ../include/services.h \
../include/timers.h ../include/extern.h \
../include/modules.h ../include/slist.h ../include/hashcomp.h \
- ../include/threadengine.h
+ ../include/threadengine.h ../include/mail.h
MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \
'LDFLAGS=${LDFLAGS}' 'INSTDIR=${INSTDIR}' 'INSTALL=${INSTALL}' \
@@ -51,7 +51,7 @@ ircd.o: ircd.c $(INCLUDES)
hostserv.o: hostserv.c $(INCLUDES)
language.o: language.c $(INCLUDES)
log.o: log.c $(INCLUDES)
-mail.o: mail.c $(INCLUDES)
+mail.o: mail.cpp $(INCLUDES)
main.o: main.c $(INCLUDES)
memory.o: memory.c $(INCLUDES)
memoserv.o: memoserv.c $(INCLUDES)
diff --git a/src/core/ns_register.c b/src/core/ns_register.c
index 9074f109f..89495eb57 100644
--- a/src/core/ns_register.c
+++ b/src/core/ns_register.c
@@ -14,7 +14,7 @@
#include "module.h"
-int do_sendregmail(User *u, NickRequest *nr);
+static bool SendRegmail(User *u, NickRequest *nr);
class CommandNSConfirm : public Command
{
@@ -279,7 +279,7 @@ class CommandNSRegister : public CommandNSConfirm
FOREACH_MOD(I_OnMakeNickRequest, OnMakeNickRequest(nr));
if (Config.NSEmailReg)
{
- if (!do_sendregmail(u, nr))
+ if (SendRegmail(u, nr))
{
notice_lang(Config.s_NickServ, u, NICK_ENTER_REG_CODE, email, Config.s_NickServ);
Alog() << Config.s_NickServ << ": sent registration verification code to " << nr->email;
@@ -337,7 +337,7 @@ class CommandNSResend : public Command
notice_lang(Config.s_NickServ, u, MAIL_LATER);
return MOD_CONT;
}
- if (!do_sendregmail(u, nr))
+ if (!SendRegmail(u, nr))
{
nr->lastmail = time(NULL);
notice_lang(Config.s_NickServ, u, NICK_REG_RESENT, nr->email);
@@ -375,6 +375,7 @@ class NSRegister : public Module
ModuleManager::Attach(I_OnNickServHelp, this);
}
+
void OnNickServHelp(User *u)
{
notice_lang(Config.s_NickServ, u, NICK_HELP_CMD_REGISTER);
@@ -386,33 +387,14 @@ class NSRegister : public Module
}
};
-/*************************************************************************/
-
-int do_sendregmail(User *u, NickRequest *nr)
+static bool SendRegmail(User *u, NickRequest *nr)
{
- MailInfo *mail = NULL;
- char buf[BUFSIZE];
-
- if (!nr && !u)
- return -1;
- snprintf(buf, sizeof(buf), getstring(NICK_REG_MAIL_SUBJECT), nr->nick);
- mail = MailRegBegin(u, nr, buf, Config.s_NickServ);
- if (!mail)
- return -1;
- fprintf(mail->pipe, "%s", getstring(NICK_REG_MAIL_HEAD));
- fprintf(mail->pipe, "\n\n");
- fprintf(mail->pipe, getstring(NICK_REG_MAIL_LINE_1), nr->nick);
- fprintf(mail->pipe, "\n\n");
- fprintf(mail->pipe, getstring(NICK_REG_MAIL_LINE_2), Config.s_NickServ, nr->passcode.c_str());
- fprintf(mail->pipe, "\n\n");
- fprintf(mail->pipe, "%s", getstring(NICK_REG_MAIL_LINE_3));
- fprintf(mail->pipe, "\n\n");
- fprintf(mail->pipe, "%s", getstring(NICK_REG_MAIL_LINE_4));
- fprintf(mail->pipe, "\n\n");
- fprintf(mail->pipe, getstring(NICK_REG_MAIL_LINE_5), Config.NetworkName);
- fprintf(mail->pipe, "\n.\n");
- MailEnd(mail);
- return 0;
+ char subject[BUFSIZE], message[BUFSIZE];
+
+ snprintf(subject, sizeof(subject), getstring(NICK_REG_MAIL_SUBJECT), nr->nick);
+ snprintf(message, sizeof(message), getstring(NICK_REG_MAIL), nr->nick, Config.NetworkName, Config.s_NickServ, nr->passcode.c_str(), Config.NetworkName);
+
+ return Mail(u, nr, Config.s_NickServ, subject, message);
}
MODULE_INIT(NSRegister)
diff --git a/src/core/ns_resetpass.c b/src/core/ns_resetpass.c
index c47fa0308..fc904d66c 100644
--- a/src/core/ns_resetpass.c
+++ b/src/core/ns_resetpass.c
@@ -14,6 +14,8 @@
#include "module.h"
+static bool SendResetEmail(User *u, NickAlias *na);
+
class CommandNSResetPass : public Command
{
public:
@@ -33,41 +35,11 @@ class CommandNSResetPass : public Command
notice_lang(Config.s_NickServ, u, NICK_X_FORBIDDEN, na->nick);
else
{
- char buf[BUFSIZE], message[BUFSIZE];
- snprintf(buf, sizeof(buf), getstring(na, NICK_RESETPASS_SUBJECT), na->nick);
-
- MailInfo *mail = MailBegin(u, na->nc, buf, Config.s_NickServ);
- if (!mail)
- return MOD_CONT;
-
- char passcode[20];
- int min = 1, max = 62;
- int chars[] = {
- ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
- 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
- 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
- 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y',
- 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'
- };
-
- int idx;
- for (idx = 0; idx < 20; ++idx)
- passcode[idx] = chars[1 + static_cast<int>((static_cast<float>(max - min)) * getrandom16() / 65536.0) + min];
- passcode[idx] = '\0';
-
- snprintf(message, sizeof(message), getstring(na, NICK_RESETPASS_MESSAGE), na->nick, Config.s_NickServ, passcode, Config.NetworkName);
- fprintf(mail->pipe, "%s", message);
- fprintf(mail->pipe, "\n.\n");
- MailEnd(mail);
-
- na->nc->Shrink("ns_resetpass_code");
- na->nc->Shrink("ns_resetpass_time");
-
- na->nc->Extend("ns_resetpass_code", new ExtensibleItemPointerArray<char>(sstrdup(passcode)));
- na->nc->Extend("ns_resetpass_time", new ExtensibleItemRegular<time_t>(time(NULL)));
-
- Alog() << Config.s_NickServ << ": " << u->GetMask() << " used RESETPASS on " << na->nick << " (" << na->nc->display << ")";
- notice_lang(Config.s_NickServ, u, NICK_RESETPASS_COMPLETE, na->nick);
+ if (SendResetEmail(u, na))
+ {
+ Alog() << Config.s_NickServ << ": " << u->GetMask() << " used RESETPASS on " << na->nick << " (" << na->nc->display << ")";
+ notice_lang(Config.s_NickServ, u, NICK_RESETPASS_COMPLETE, na->nick);
+ }
}
return MOD_CONT;
@@ -110,14 +82,13 @@ class NSResetPass : public Module
EventReturn OnPreCommand(User *u, const std::string &service, const ci::string &command, const std::vector<ci::string> &params)
{
- time_t t;
- char *c;
-
if (service == Config.s_NickServ && command == "CONFIRM" && !params.empty())
{
NickAlias *na = findnick(u->nick);
- if (na && na->nc->GetExtArray("ns_resetpass_code", c) && na->nc->GetExtRegular<time_t>("ns_resetpass_time", t))
+ time_t t;
+ std::string c;
+ if (na && na->nc->GetExtRegular("ns_resetpass_code", c) && na->nc->GetExtRegular("ns_resetpass_time", t))
{
if (t < time(NULL) - 3600)
{
@@ -167,4 +138,35 @@ class NSResetPass : public Module
}
};
+static bool SendResetEmail(User *u, NickAlias *na)
+{
+ char subject[BUFSIZE], message[BUFSIZE], passcode[20];
+
+ snprintf(subject, sizeof(subject), getstring(na, NICK_RESETPASS_SUBJECT), na->nick);
+
+ int min = 1, max = 62;
+ int chars[] = {
+ ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
+ 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
+ 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
+ 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y',
+ 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'
+ };
+
+ int idx;
+ for (idx = 0; idx < 20; ++idx)
+ passcode[idx] = chars[1 + static_cast<int>((static_cast<float>(max - min)) * getrandom16() / 65536.0) + min];
+ passcode[idx] = '\0';
+
+ snprintf(message, sizeof(message), getstring(na, NICK_RESETPASS_MESSAGE), na->nick, Config.s_NickServ, passcode, Config.NetworkName);
+
+ na->nc->Shrink("ns_resetpass_code");
+ na->nc->Shrink("ns_resetpass_time");
+
+ na->nc->Extend("ns_resetpass_code", new ExtensibleItemRegular<std::string>(passcode));
+ na->nc->Extend("ns_resetpass_time", new ExtensibleItemRegular<time_t>(time(NULL)));
+
+ return Mail(u, na->nc, Config.s_NickServ, subject, message);
+}
+
MODULE_INIT(NSResetPass)
diff --git a/src/core/ns_sendpass.c b/src/core/ns_sendpass.c
index 0ce8f6c5c..ffa4b6ece 100644
--- a/src/core/ns_sendpass.c
+++ b/src/core/ns_sendpass.c
@@ -14,6 +14,8 @@
#include "module.h"
+static bool SendPassMail(User *u, NickAlias *na, const std::string &pass);
+
class CommandNSSendPass : public Command
{
public:
@@ -34,34 +36,14 @@ class CommandNSSendPass : public Command
notice_lang(Config.s_NickServ, u, NICK_X_FORBIDDEN, na->nick);
else
{
- char buf[BUFSIZE];
std::string tmp_pass;
if (enc_decrypt(na->nc->pass,tmp_pass) == 1)
{
- MailInfo *mail;
-
- snprintf(buf, sizeof(buf), getstring(na, NICK_SENDPASS_SUBJECT), na->nick);
- mail = MailBegin(u, na->nc, buf, Config.s_NickServ);
- if (!mail)
- return MOD_CONT;
-
- fprintf(mail->pipe, "%s", getstring(na, NICK_SENDPASS_HEAD));
- fprintf(mail->pipe, "\n\n");
- fprintf(mail->pipe, getstring(na, NICK_SENDPASS_LINE_1), na->nick);
- fprintf(mail->pipe, "\n\n");
- fprintf(mail->pipe, getstring(na, NICK_SENDPASS_LINE_2), tmp_pass.c_str());
- fprintf(mail->pipe, "\n\n");
- fprintf(mail->pipe, "%s", getstring(na, NICK_SENDPASS_LINE_3));
- fprintf(mail->pipe, "\n\n");
- fprintf(mail->pipe, "%s", getstring(na, NICK_SENDPASS_LINE_4));
- fprintf(mail->pipe, "\n\n");
- fprintf(mail->pipe, getstring(na, NICK_SENDPASS_LINE_5), Config.NetworkName);
- fprintf(mail->pipe, "\n.\n");
-
- MailEnd(mail);
-
- Alog() << Config.s_NickServ << ": " << u->GetMask() << " used SENDPASS on " << nick;
- notice_lang(Config.s_NickServ, u, NICK_SENDPASS_OK, nick);
+ if (SendPassMail(u, na, tmp_pass))
+ {
+ Alog() << Config.s_NickServ << ": " << u->GetMask() << " used SENDPASS on " << nick;
+ notice_lang(Config.s_NickServ, u, NICK_SENDPASS_OK, nick);
+ }
}
else
notice_lang(Config.s_NickServ, u, NICK_SENDPASS_UNAVAILABLE);
@@ -102,10 +84,21 @@ class NSSendPass : public Module
ModuleManager::Attach(I_OnNickServHelp, this);
}
+
void OnNickServHelp(User *u)
{
notice_lang(Config.s_NickServ, u, NICK_HELP_CMD_SENDPASS);
}
};
+static bool SendPassMail(User *u, NickAlias *na, const std::string &pass)
+{
+ char subject[BUFSIZE], message[BUFSIZE];
+
+ snprintf(subject, sizeof(subject), getstring(na, NICK_SENDPASS_SUBJECT), na->nick);
+ snprintf(message, sizeof(message), getstring(na, NICK_SENDPASS), na->nick, pass.c_str(), Config.NetworkName);
+
+ return Mail(u, na->nc, Config.s_NickServ, subject, message);
+}
+
MODULE_INIT(NSSendPass)
diff --git a/src/mail.c b/src/mail.c
deleted file mode 100644
index ef3d6cd4d..000000000
--- a/src/mail.c
+++ /dev/null
@@ -1,283 +0,0 @@
-/* Mail utility routines.
- *
- * (C) 2003-2010 Anope Team
- * Contact us at team@anope.org
- *
- * Please read COPYING and README for further details.
- *
- * Based on the original code of Epona by Lara.
- * Based on the original code of Services by Andy Church.
- *
- *
- */
-
-#include "services.h"
-#include "language.h"
-
-/*************************************************************************/
-
-/**
- * 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.
- * @param u the User struct
- * @param nr NickReqest Struct
- * @param subject Subject of the email
- * @param service Service to respond with
- * @return MailInfo struct
- */
-MailInfo *MailRegBegin(User * u, NickRequest * nr, char *subject,
- char *service)
-{
- int timeToWait = 0;
- if (!u || !nr || !subject || !service) {
- return NULL;
- }
-
- if (!Config.UseMail) {
- notice_lang(service, u, MAIL_DISABLED);
- } else if ((time(NULL) - u->lastmail < Config.MailDelay)) {
- timeToWait = Config.MailDelay - (time(NULL) - u->lastmail);
- notice_lang(service, u, MAIL_DELAYED, timeToWait);
- } else if (!nr->email) {
- notice_lang(service, u, MAIL_INVALID, nr->nick);
- } else {
- MailInfo *mail;
-
- mail = new MailInfo;
- mail->sender = u;
- mail->recipient = NULL;
- mail->recip = nr;
-
- if (!(mail->pipe = popen(Config.SendMailPath, "w"))) {
- delete mail;
- notice_lang(service, u, MAIL_LATER);
- return NULL;
- }
-
- fprintf(mail->pipe, "From: %s\n", Config.SendFrom);
- if (Config.DontQuoteAddresses) {
- fprintf(mail->pipe, "To: %s <%s>\n", nr->nick, nr->email);
- } else {
- fprintf(mail->pipe, "To: \"%s\" <%s>\n", nr->nick, nr->email);
- }
- fprintf(mail->pipe, "Subject: %s\n", subject);
- return mail;
- }
-
- return NULL;
-}
-
-/*************************************************************************/
-
-/**
- * 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.
- * @param u the User struct
- * @param nc NickCore Struct
- * @param subject Subject of the email
- * @param service Service to respond with
- * @return MailInfo struct
- */
-MailInfo *MailBegin(User * u, NickCore * nc, char *subject, char *service)
-{
- if (!u || !nc || !subject || !service) {
- return NULL;
- }
-
- if (!Config.UseMail) {
- notice_lang(service, u, MAIL_DISABLED);
- } else if (((time(NULL) - u->lastmail < Config.MailDelay)
- || (time(NULL) - nc->lastmail < Config.MailDelay))
- && !(u->Account() && u->Account()->IsServicesOper())) {
- notice_lang(service, u, MAIL_DELAYED, Config.MailDelay);
- } else if (!nc->email) {
- notice_lang(service, u, MAIL_INVALID, nc->display);
- } else {
- MailInfo *mail;
-
- mail = new MailInfo;
- mail->sender = u;
- mail->recipient = nc;
- mail->recip = NULL;
-
- if (!(mail->pipe = popen(Config.SendMailPath, "w"))) {
- delete mail;
- notice_lang(service, u, MAIL_LATER);
- return NULL;
- }
-
- fprintf(mail->pipe, "From: %s\n", Config.SendFrom);
- if (Config.DontQuoteAddresses) {
- fprintf(mail->pipe, "To: %s <%s>\n", nc->display, nc->email);
- } else {
- fprintf(mail->pipe, "To: \"%s\" <%s>\n", nc->display,
- nc->email);
- }
- fprintf(mail->pipe, "Subject: %s\n", subject);
-
- return mail;
- }
-
- return NULL;
-}
-
-/*************************************************************************/
-
-/**
- * new function to send memo mails
- * @param nc NickCore Struct
- * @return MailInfo struct
- */
-MailInfo *MailMemoBegin(NickCore * nc)
-{
-
- if (!nc)
- return NULL;
-
- if (!Config.UseMail || !nc->email) {
- return NULL;
-
- } else {
- MailInfo *mail;
-
- mail = new MailInfo;
- mail->sender = NULL;
- mail->recipient = nc;
- mail->recip = NULL;
-
- if (!(mail->pipe = popen(Config.SendMailPath, "w"))) {
- delete mail;
- return NULL;
- }
-
- fprintf(mail->pipe, "From: %s\n", Config.SendFrom);
- if (Config.DontQuoteAddresses) {
- fprintf(mail->pipe, "To: %s <%s>\n", nc->display, nc->email);
- } else {
- fprintf(mail->pipe, "To: \"%s\" <%s>\n", nc->display,
- nc->email);
- }
- fprintf(mail->pipe, "Subject: %s\n",
- getstring(MEMO_MAIL_SUBJECT));
- return mail;
- }
-}
-
-/*************************************************************************/
-
-/**
- * Finish to send the mail. Cleanup everything.
- * @param mail MailInfo Struct
- * @return void
- */
-void MailEnd(MailInfo * mail)
-{
- /* - param checking modified because we don't
- have an user sending this mail.
- Certus, 02.04.2004 */
-
- if (!mail || !mail->pipe) { /* removed sender check */
- return;
- }
-
- if (!mail->recipient && !mail->recip) {
- return;
- }
-
- pclose(mail->pipe);
-
- if (mail->sender) /* added sender check */
- mail->sender->lastmail = time(NULL);
-
- if (mail->recipient)
- mail->recipient->lastmail = time(NULL);
- else
- mail->recip->lastmail = time(NULL);
-
-
- delete mail;
-}
-
-/*************************************************************************/
-
-/**
- * Resets the MailDelay protection.
- * @param u the User struct
- * @param nc NickCore Struct
- * @return void
- */
-void MailReset(User * u, NickCore * nc)
-{
- if (u)
- u->lastmail = 0;
- if (nc)
- nc->lastmail = 0;
-}
-
-/*************************************************************************/
-
-/**
- * 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.
- * @param email Email to Validate
- * @return int
- */
-int MailValidate(const char *email)
-{
- int has_period = 0, len;
- char copy[BUFSIZE], *domain;
-
- static char specials[] =
- { '(', ')', '<', '>', '@', ',', ';', ':', '\\', '\"', '[', ']',
- ' '
- };
-
- if (!email)
- return 0;
- strlcpy(copy, email, sizeof(copy));
-
- domain = strchr(copy, '@');
- if (!domain)
- return 0;
- *domain = '\0';
- domain++;
-
- /* Don't accept NULL copy or domain. */
- if (*copy == 0 || *domain == 0)
- return 0;
-
- /* Check for forbidden characters in the name */
- for (unsigned int i = 0; i < strlen(copy); i++) {
-
- if (copy[i] <= 31 || copy[i] >= 127)
- return 0;
- for (unsigned int j = 0; j < 13; j++)
- if (copy[i] == specials[j])
- return 0;
- }
-
- /* Check for forbidden characters in the domain, and if it seems to be valid. */
- for (int i = 0; i < (len = strlen(domain)); i++) {
- if (domain[i] <= 31 || domain[i] >= 127)
- return 0;
- for (unsigned int j = 0; j < 13; j++)
- if (domain[i] == specials[j])
- return 0;
- if (domain[i] == '.') {
- if (i == 0 || i == len - 1)
- return 0;
- has_period = 1;
- }
- }
-
- if (!has_period)
- return 0;
-
- return 1;
-}
diff --git a/src/mail.cpp b/src/mail.cpp
new file mode 100644
index 000000000..9e1c60c6b
--- /dev/null
+++ b/src/mail.cpp
@@ -0,0 +1,151 @@
+#include "services.h"
+#include "language.h"
+
+MailThread::~MailThread()
+{
+ if (Success)
+ Alog() << "Successfully delivered mail for " << MailTo << " (" << Addr << ")";
+ else
+ Alog() << "Error delivering mail for " << MailTo << " (" << Addr << ")";
+}
+
+void MailThread::Run()
+{
+ FILE *pipe = popen(Config.SendMailPath, "w");
+
+ if (!pipe)
+ {
+ return;
+ }
+
+ fprintf(pipe, "From: %s\n", Config.SendFrom);
+ if (Config.DontQuoteAddresses)
+ fprintf(pipe, "To: %s <%s>\n", MailTo.c_str(), Addr.c_str());
+ else
+ fprintf(pipe, "To: \"%s\" <%s>\n", MailTo.c_str(), Addr.c_str());
+ fprintf(pipe, "Subject: %s\n", Subject.c_str());
+ fprintf(pipe, "%s", Message.c_str());
+ fprintf(pipe, "\n.\n");
+
+ pclose(pipe);
+
+ Success = true;
+}
+
+bool Mail(User *u, NickRequest *nr, const std::string &service, const std::string &subject, const std::string &message)
+{
+ if (!u || !nr || subject.empty() || service.empty() || message.empty())
+ return false;
+
+ time_t t = time(NULL);
+
+ if (!Config.UseMail)
+ notice_lang(service.c_str(), u, MAIL_DISABLED);
+ else if (t - u->lastmail < Config.MailDelay)
+ notice_lang(service.c_str(), u, MAIL_DELAYED, t - u->lastmail);
+ else if (!nr->email)
+ notice_lang(service.c_str(), u, MAIL_INVALID, nr->nick);
+ else
+ {
+ u->lastmail = nr->lastmail = t;
+ threadEngine.Start(new MailThread(nr->nick, nr->email, subject, message));
+ return true;
+ }
+
+ return false;
+}
+
+bool Mail(User *u, NickCore *nc, const std::string &service, const std::string &subject, const std::string &message)
+{
+ if (!u || !nc || subject.empty() || service.empty() || message.empty())
+ return false;
+
+ time_t t = time(NULL);
+
+ if (!Config.UseMail)
+ notice_lang(service.c_str(), u, MAIL_DISABLED);
+ else if (t - u->lastmail < Config.MailDelay)
+ notice_lang(service.c_str(), u, MAIL_DELAYED, t - u->lastmail);
+ else if (!nc->email)
+ notice_lang(service.c_str(), u, MAIL_INVALID, nc->display);
+ else
+ {
+ u->lastmail = nc->lastmail = t;
+ threadEngine.Start(new MailThread(nc->display, nc->email, subject, message));
+ return true;
+ }
+
+ return false;
+}
+
+bool Mail(NickCore *nc, const std::string &subject, const std::string &message)
+{
+ if (!Config.UseMail || !nc || !nc->email || subject.empty() || message.empty())
+ return false;
+
+ nc->lastmail = time(NULL);
+ threadEngine.Start(new MailThread(nc->display, nc->email, subject, message));
+
+ return true;
+}
+
+/**
+ * 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.
+ *
+ * @param email Email to Validate
+ * @return bool
+ */
+bool MailValidate(const std::string &email)
+{
+ bool has_period = false;
+ char copy[BUFSIZE];
+
+ static char specials[] = {
+ '(', ')', '<', '>', '@', ',', ';', ':', '\\', '\"', '[', ']', ' '
+ };
+
+ if (email.empty())
+ return false;
+ strlcpy(copy, email.c_str(), sizeof(copy));
+
+ char *domain = strchr(copy, '@');
+ if (!domain)
+ return false;
+ *domain++ = '\0';
+
+ /* Don't accept NULL copy or domain. */
+ if (!*copy || !*domain)
+ return false;
+
+ /* Check for forbidden characters in the name */
+ for (unsigned int i = 0; i < strlen(copy); i++)
+ {
+ if (copy[i] <= 31 || copy[i] >= 127)
+ return false;
+ for (unsigned int j = 0; j < 13; j++)
+ if (copy[i] == specials[j])
+ return false;
+ }
+
+ /* Check for forbidden characters in the domain */
+ for (unsigned int i = 0; i < strlen(domain); i++)
+ {
+ if (domain[i] <= 31 || domain[i] >= 127)
+ return false;
+ for (unsigned int j = 0; j < 13; j++)
+ if (domain[i] == specials[j])
+ return false;
+ if (domain[i] == '.')
+ {
+ if (i == 0 || i == strlen(domain) - 1)
+ return false;
+ has_period = true;
+ }
+ }
+
+ return has_period;
+}
+
diff --git a/src/memoserv.c b/src/memoserv.c
index 5236345f9..4ab9c76ff 100644
--- a/src/memoserv.c
+++ b/src/memoserv.c
@@ -18,7 +18,7 @@
/* *INDENT-OFF* */
E void moduleAddMemoServCmds();
-static void new_memo_mail(NickCore *nc, Memo *m);
+static bool SendMemoMail(NickCore *nc, Memo *m);
E void rsend_notify(User *u, Memo *m, const char *chan);
/*************************************************************************/
@@ -300,7 +300,7 @@ void memo_send(User * u, const char *name, const char *text, int z)
/* if (MSNotifyAll) */
/* let's get out the mail if set in the nickcore - certus */
if (nc->HasFlag(NI_MEMO_MAIL))
- new_memo_mail(nc, m);
+ SendMemoMail(nc, m);
} else {
Channel *c;
@@ -356,32 +356,17 @@ int delmemo(MemoInfo * mi, int num)
/*************************************************************************/
-static void new_memo_mail(NickCore * nc, Memo * m)
+static bool SendMemoMail(NickCore *nc, Memo *m)
{
- MailInfo *mail = NULL;
+ char message[BUFSIZE];
- if (!nc || !m)
- return;
+ snprintf(message, sizeof(message), getstring(NICK_MAIL_TEXT), nc->display, m->sender.c_str(), m->number, m->text);
- mail = MailMemoBegin(nc);
- if (!mail) {
- return;
- }
- fprintf(mail->pipe, getstring(MEMO_MAIL_TEXT1), nc->display);
- fprintf(mail->pipe, "\n");
- fprintf(mail->pipe, getstring(MEMO_MAIL_TEXT2), m->sender.c_str(),
- m->number);
- fprintf(mail->pipe, "\n\n");
- fprintf(mail->pipe, "%s", getstring(MEMO_MAIL_TEXT3));
- fprintf(mail->pipe, "\n\n");
- fprintf(mail->pipe, "%s", m->text);
- fprintf(mail->pipe, "\n");
- MailEnd(mail);
- return;
+ return Mail(nc, getstring(MEMO_MAIL_SUBJECT), message);
}
-
/*************************************************************************/
+
/* Send receipt notification to sender. */
void rsend_notify(User * u, Memo * m, const char *chan)
diff --git a/src/threadengine_pthread.cpp b/src/threadengine_pthread.cpp
index 199bd0860..9d9bf160d 100644
--- a/src/threadengine_pthread.cpp
+++ b/src/threadengine_pthread.cpp
@@ -1,14 +1,5 @@
#include "services.h"
-/** Join to the thread, sets the exit state to true
- */
-void Thread::Join()
-{
- SetExitState();
- pthread_join(Handle, NULL);
- delete this;
-}
-
/* Threadengine attributes used by this thread engine */
static pthread_attr_t threadengine_attr;
@@ -19,6 +10,11 @@ static void *entry_point(void *parameter)
{
Thread *thread = static_cast<Thread *>(parameter);
thread->Run();
+ if (!thread->GetExitState())
+ {
+ thread->Join();
+ }
+ delete thread;
pthread_exit(0);
}
@@ -39,6 +35,14 @@ ThreadEngine::~ThreadEngine()
pthread_attr_destroy(&threadengine_attr);
}
+/** Join to the thread, sets the exit state to true
+ */
+void Thread::Join()
+{
+ SetExitState();
+ pthread_join(Handle, NULL);
+}
+
/** Start a new thread
* @param thread A pointer to a newley allocated thread
*/
@@ -47,7 +51,7 @@ void ThreadEngine::Start(Thread *thread)
if (pthread_create(&thread->Handle, &threadengine_attr, entry_point, thread))
{
delete thread;
- throw CoreException("Unable to create thread");
+ throw CoreException("Unable to create thread: " + std::string(strerror(errno)));
}
}
diff --git a/src/threadengine_win32.cpp b/src/threadengine_win32.cpp
index d3c0303f5..5ee2f4596 100644
--- a/src/threadengine_win32.cpp
+++ b/src/threadengine_win32.cpp
@@ -1,14 +1,5 @@
#include "services.h"
-/** Join to the thread, sets the exit state to true
- */
-void Thread::Join()
-{
- SetExitState();
- WaitForSingleObject(Handle, INFINITE);
- delete this;
-}
-
/** Entry point for the thread
* @param paramter A Thread* cast to a void*
*/
@@ -16,6 +7,11 @@ static DWORD WINAPI entry_point(void *parameter)
{
Thread *thread = static_cast<Thread *>(parameter);
thread->Run();
+ if (!thread->GetExitState())
+ {
+ thread->Join();
+ }
+ delete thread;
return 0;
}
@@ -31,6 +27,14 @@ ThreadEngine::~ThreadEngine()
{
}
+/** Join to the thread, sets the exit state to true
+ */
+void Thread::Join()
+{
+ SetExitState();
+ WaitForSingleObject(Handle, INFINITE);
+}
+
/** Start a new thread
* @param thread A pointer to a newley allocated thread
*/
@@ -41,7 +45,7 @@ void ThreadEngine::Start(Thread *thread)
if (!thread->Handle)
{
delete thread;
- throw CoreException("Unable to create thread");
+ throw CoreException("Unable to create thread: " + std::string(dlerror()));
}
}