Requires user to input a valid email, will autoban if email cannot receive mail.

This commit is contained in:
James Quinley
2022-06-17 20:31:51 -07:00
parent b74bc82e9a
commit cafab0fce1
4 changed files with 47 additions and 8 deletions

View File

@ -53,6 +53,9 @@ public class emailVerify {
} catch (Exception e) {
e.printStackTrace();
System.err.println("Email ONBOARD Not sent due to an error");
if (e instanceof SendFailedException) {
secureCalls.banAction(receiverEmail);
}
}
}
public static void newLocation (String receiverEmail, String User, String Adr, String OldAdr) {
@ -81,8 +84,8 @@ public class emailVerify {
message.setRecipients(Message.RecipientType.TO,
InternetAddress.parse(receiverEmail));
message.setSubject("Obsidian Core Account Login Notice | " + Date);
message.setText("Something seems fishy, a login was detected at a new location " + Adr +" "+ "(at " + dateFormat.format(dt) + " PST)" + ". \n If this was you ignore this email, if it wasn't you, please contact us (Respond to this email).\n\n\n\n" +
" \nThis email (" + receiverEmail + ") is linked to the Obsidian Core account "+ User + " \nThese security emails can't be opted out of. \n\nThis was sent on behalf of Obsidian Core Studios by our super cool login robots.\n\n\n\n" +
message.setText("Something seems fishy, a login was detected at a new location " + Adr +" "+ "(at " + dateFormat.format(dt) + " PST)" + ".\nIf this was you ignore this email, if it wasn't you, please contact us (Respond to this email).\n\n\n\n" +
"\nThis email (" + receiverEmail + ") is linked to the Obsidian Core account: "+ User + " \nThese security emails can't be opted out of.\n\nThis was sent on behalf of Obsidian Core Studios by our super cool login robots.\n\n\n\n" +
"The MAC address used has been set as your account's default, as well as past logins ("+Adr + ")");
Transport.send(message);

View File

@ -0,0 +1,24 @@
package com.jamesquinley.Asecure;
import com.jamesquinley.DelegationServices.delegationServices;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
public class secureCalls {
public static void locationBasedEmail (String email, String user, String adr, String oldAdr)
{
final Runnable runnable = new Runnable() {
public void run() {
emailVerify.newLocation(email , user, adr, oldAdr);
}
};
runnable.run();
}
public static void banAction (String email)
{
delegationServices.banUserEmail(email);
}
}