How to check a mail message UID exist or not using JavaMail? - jakarta-mail

Please help me out how to find the mail exists or not.
Description: I've deleted a mail but I've it's UID. Now how can I check whether a mail exists.
Thanks.

If you just marked it DELETED, you can still find it by searching for it by UID, see UIDFolder.getMessageByUID.
If it was deleted by moving it to a Trash folder, the UID won't help you. You'll need to search for it using some other attributes of the message such as the Message-Id.
If it was deleted and expunged, it's gone forever.

Related

How can i get elements in select using by example, whereDoesntHave in Laravel 8 and Filament?

I've three tables Users, company and user_company (pivot). I need to, for example, associate users to a company in a form using select that show me only the user are nit associated to this company.
Could anybody help me?
Thanks in advance
check the Filaments Documentation on the relationshipmanager AND
#Attaching and detaching records either manually or by --attach when creating the relationship manager
Ensure withPivot is included in the EloquentModel and check the getRelations in the modelresource
See docs #Populating automatically from a relationship
This works for me:
Forms\Components\Select::make('companyId')
->multiple()
->relationship('companies','company_name'),

Find When Object Got DROPped in Snowflake

We recently discovered that an external stage in our environment mysteriously disappeared, and don't know why. I assume someone must have run a DROP STAGE command at some point, but don't know who could have done that or when it occurred.
I have tried searching Query History for instances of LIKE '%drop stage%, but not getting any hits. I would guess since that is a DDL command, Query History is the wrong place to look. Is there a way to find out when the stage was dropped?
You can find the date when the stage was removed by querying the snowflake.account_usage.stages shared view. There is a deleted field associated with each object and this will be updated upon a drop/deletion of the stage.

Swift how to check if textfield exists in array at Index

I am new to programming...
I know this probably is the best way to do an Offline login page
but
MYSQL users db (consists of usernames, passwords, id) is 'downloaded' from a php script to iOS device.That part works, and the users print to the console.
What I am struggling with is, checking the textfield where the user enters their username to the 'usersArray' to see if it exists at index[0]
Any help is appreciated.
I'm not entirely sure what you are trying to do here but I think you are trying to take the value of a text field and see if that value appears in your usersArray. Provided this is the case try:
let exists = usersArray.contains(usernameTextField.text)
This will give you a Bool that indicates if the username exists in your array.
Side Note:
Hopefully you are only doing some general testing at the moment but in case you aren't… Please don't send passwords in plain text and absolutely don't download all usernames and passwords even in an encrypted format to a device! Aside from potentially taking up a large amount of space on the user's device you would be making it very easy for unscrupulous people to crack every user password in your database!

In a Silverstripe DB where can I find the Users table and Password?

I have a local Silverstripe instance but I cannot login and the owners are battling to find their login details. I have the DB so how can I find the Users table and edit it, or make myself an admin account? Thanks
Despite having solved your problem, you did not answer your own question :-). For Google's sake I will try...
The user table is called "Member". It has got the email address and the password in it. You can not manually change the password here, as it is hashed. What you can do is change the email address and use the "forgot password" functionality (in case the client can't do that himself), change the password for the client through the application backend (cms) and change the email address back to its original value. If you are wondering what the MemberPassword table does: AFAIK it only stores a copy of all used passwords by a user (password history)
When you want to make an account administrator, you should first take a look at the Group table and look for "administrators" in the "Code" Column. Take that ID (normally, this would be 2). After that, take a look in the Member table, and look for the user you want to make an admin. Take the ID here as well.
Next, open the Group_Member table and insert a new row (or change the existing if you want) and specify the group id under GroupID and the member id under MemberID.
Adding Security::setDefaultAdmin('admin','admin'); to the _config.php also works, but don't forget to remove it afterwards, just as any phpmyadmin or equivalent that you installed :-)
Just found this add Security::setDefaultAdmin('username', 'password'); to mysite/_config.php. Worked like a bomb!
Create a file _ss_environment.php in the webroot (or the folder above it) if it doesn't already exist. Add these two lines to the bottom:
define('SS_DEFAULT_ADMIN_USERNAME','admin');
define('SS_DEFAULT_ADMIN_PASSWORD','password');

Matching DB records to Active Directory entries?

I have been tasked with coming up with a solution where I am not sure if there is a solid answer:
How can I match username records from an application's database to users in our Active Directory?
I have two applications this needs to be done for - 1st application I only have firstname and lastname information. Second application i have the application's username, which is similar to activeD's but not a definate match. I also have firstname lastname info.
Now, simply put I can just write a script that matches all the records in ActiveD that match the firstname lastname in the application DB, but that is fraught with errors.
Having no unique identifier to begin with might make this an impossible task, but before I start to task someone else with manually comparing the data after running the script, I thought I would ask the delightful StackOverflow crew to chew on it. There are always methods I don't think of, after all.
So any brilliant ideas out there to accomplish this task?
Thanks guys
Once you get them matched up automatically and the exceptions by hand, make a custom attribute in Active directory where you can store the information to keep them matched up in the future.
You could store the Active Directory object GUID against the database record.
Well, the one thing that will be indeed unique in AD is the sAMAccountName for each user. If you find a way to associate your users in your two databases with a SAM Account Name, you should have no big trouble anymore to do an automatic sync check with AD.
That property is already available in AD, you don't need to add any additional artificial IDs, and it's much easier to read than a GUID.
Marc

Resources