James apache database class - james

Hello I am trying to edit something in apache james and I need the whole message for that, as it enters the server, or going to be saved, and the other hand I need the point where it is requested from DB. But I am unable to find any anchor point. I found all the attributes except the body of message(Only in MailImpl.out.Stream here but I dont know how to access it).
The config is default found in https://github.com/apache/james-project and I am using SMTP to send and unsecure POP (110) to receive the mail

Related

Is it possible to configure an IMAP account in Thunderbird with a different domain on the address and the server?

I have an email address provided and managed by OVH (French ISP)
I'm trying to configure the account in Thunderbird (which I've been using with multiple accounts, including Gmail over IMAP, for years with great satisfaction). It's version 91.8.0 in Debian 11.3. No fancy tweaking or whatever.
I followed the instruction from my ISP (https://docs.ovh.com/fr/emails/configuration-email-configuration-pour-thunderbird/) - ok, it's a guide for the windows version, but that shouldn't be an issue.
The thing is, my address is like contact#somedomain.fr, but the mail server is ssl0.ovh.net.
I'm sure the password is correct, but when I go and validate the settings, Thunderbird tries to check the password, and it gets stuck there.
I noticed in the status bar that Thunderbird is actually trying to reach contact#somedomain.fr#ssl0.ovh.net... That must be (part of) the issue.
I tried to go to Advanced settings (so it creates the accounts and sends me to the account settings page), and there Thunderbird changes the actual server (which should be ssl0.ovh.net) to the email account's domain (somedomain.fr in my example)... Ain't that weird ? (also, it seems not to be able to determine the server type which remains empty, and most dropdown options, like authentication methods, are empty, or rather there are no labels).
Has anyone ever run into such an issue, and better yet, solved it ;-) ?
(not sure if the cross-domain tag is relevant)
Edit 2022-05-03 :
After many tests, still not working, but I have dug a little deeper.
I've set up the account manually with "Advanced configuration" so it doesn't try to check the password.
In the Folders panel, the account has no name and only a sub-folder named INBOX.
When I try to browse this INBOX folder, I get an error :
Unable to open the summary file for INBOX on contact#somedomain.fr. Perhaps there was an error on disk, or the full path is too long.
Running Thunderbird in full debug mode from CLI :
thunderbird --safe-mode --jsconsole --verbose
In the shell, from the verbose mode, I get this error repeatedly :
IPDL protocol error: Handler returned error code!
###!!! [Parent][DispatchAsyncMessage] Error: PClientManager::Msg_ForgetFutureClientSource Processing error: message was deserialized, but the handler returned false (indicating failure)
But I don't think this is related to my problem.
However in the JS console, I get an interesting message :
gloda.index_msg: Problem entering folder: INBOX, skipping. Error was: undefined:659: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIMsgFolder.msgDatabase]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: resource:///modules/gloda/IndexMsg.jsm :: _indexerEnterFolder :: line 659" data: no]
Now, where do I go from here ?

How do I find the ip address of a Google search page using Python

New to Python programming and trying to solve a coding project.
I am trying to write a piece of code that will access a subpage within a website. I'm able to access the main page of the site using it's ip to .connect, and then using .sendall and .recv to get the main page's basic info.
Now I wan't to move on and capture a search page.
In this specific example: If you type keywords into the address bar (using Chrome at this moment), you get a page of search results. I'm trying to capture the raw data of that page and dump it into a file. I can access the main page ip address for Google using .gethostbyname, but the url for the search page is a string of words. I haven't a clue how to write code that will allow access that page, or to send the search words to trigger the same response from Google, allowing me to capture that data as an answer to .sendall.
Is there a way for me to access this page, which was obviously created and sent back to my web browser, using Python? If I can't by using a simple .connect and .recv code, is there another/bette way?
All recommendations appreciated. Never posted code, so excuse any etiquette errors:
import socket
import sys
try:
mysock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
except socket.error:
print("Failed to create socket.")
sys.exit()
try:
host = (socket.gethostbyname("www.google.com"), 80)
except socket.gaierror:
print("Failed to get host")
sys.exit()
print (host)
print(type(host))
mysock.connect(host)
message = b"GET / HTTP/1.1\r\n\r\n"
try:
mysock.sendall(message)
except socket.error:
print("Failed to send")
sys.exit()
data = mysock.recv(5000)
mysock.close()
When you initially create a connection socket, your operating system reserves a "file" space (in quotes on purpose, not going to go into it now), that you create on your machine. The operating system then designates a port on your system for the file space that you made, and gives you back a file descriptor, describing its location. This port is where you send and receive data.
When you run the connect method to connect to some Google URL, the socket library automatically decides that you should use a specific protocol to make the connection, and does some initial communication with the server to create a flow. This flow is where you will send one request, split up into packets of the same size, and receive a response from the server in the same way.
To create the request, which is basically just a string sent initially to Google's servers that tells them what you want and, more importantly, how you want it, we need to do make something extra called an SSL request. If you'll notice, the correct URL to Google is https://google.com and not http://google.com (although the latter redirects), because you want to negotiate a specific private key to encrypt your communication and hide it from others who might see it. Once you have done your connect magic, you send this SSL request with the send method, normally the request is automatically created by the Python library. you then receive your response, which is the response headers (values mapped to one another giving you some initial info on what you are getting), and then your body, which is HTML code.
Let's delve into the request a bit more. When you submit a search to Google, the search is saved in the URL that you requested. as #user2357112 said, a search for new apple iphone becomes https://www.google.com/search?q=new+apple+iphone&.... Everything before the equals sign is a GET parameter and everything after it is its value. For your purposes, you only care about the q= portion, which represents the search keywords you entered into the search bar. Everything else should remain the same, separated by ampersands (&).
Once you have sent a request to that URL and gotten your HTML response, you have to parse it to get the search results. Please make a separate question for that if you have to, since each post should only have one question to answer.

nest api - cryptic error message when creating client with product data write permissions

I'm attempting to create a google nest client to write electricity monitor data to the Nest for display in the energy history plot, but although I'm able to create a test client with thermostat read permissions, when I attempt to create a new client with product data write permissions I get an error message saying "scopes.justification exceeds required maximum length of 140". I don't see any fields with more than 140 characters and an email to the Nest team has been unanswered for several days.
I should say I'm leaving the OAuth redirect field blank because I'm still trying to learn exactly how OAuth is meant to work and if the redirect is a site I need to write and host or what, but it appears to be optional and one can edit client details later or use a PIN so doesn't seem that's the issue, but I could be wrong.
Anyone had this issue or able to provide some tips?

xPage application - using document.removeFromFolder and document.putInFolder throws error

I have a xPage application which shows list of emails of the currently logged user. Using some button user can remove selected email from inbox and put it into another folder.
UI works fine except the fact that document.removeFromFolder and document.putInFolder in my JAVA backend class throws an error "Notes error: You are not authorized to perform that operation ($Inbox)" . There is the same error for removing or putting document from/into inbox/another folder. But ACL is correct, user can create emails, delete them ...
Has anyone some hint whats wrong here?
Here is the error message I'm getting(just a small part):
JavaScriptMethodBinding.invoke(JavaScriptMethodBinding.java:111)
...
32 more
Caused by: NotesException: Notes error: You are not
authorized to perform t hat operation
(($Inbox))
at
lotus.domino.local.Document.removeFromFolder(Unknown Source)
There are a number of checkpoints to watch out for:
If you use "session as signer that signer needs to have access to the mail file
If application and NSF are on different servers you need a setting in the server document needs to include a trust relation for these servers. That's the server document - Security - left column, bottom: Trusted servers.
I presume the servers have ACL access
Hope that helps

Post Username & Password To Protected Folder/Site

I'm trying to post a username & password from an HTML form to a protected folder on a website? Is this possible? I thought I just pass in a syntax in the URL like the below but not having any success
http://username:password#theurlofthesite.co.uk
I'm still getting the alert pop up asking for the username and password? I need to be able to auto log the person in..
Hope someone can help? Thanks
If you login via a HTML form, then this won't work. This is only for HTTP authentication, which is something else completely different.
I don't think many (any?) browsers support being opened to post data. Which leaves you hoping that the site accepts GET based logins (and they should be shot if they do.).
The address part of the URL is parsed by your web server, so the code which handles the HTML form never sees it.
If you want to pass parameters to a form, you must use url?field=value&field2=value2. This only works with forms that use the GET action. For POST, you need a program to generate an encoded document and upload that.
In both cases, your user name and password are broadcasted as plain text on the Internet, so the account will be hacked within a few hours. To put it more clearly: There is no way to "protect" the data in this folder this way. This is like adding a door with four locks to your house and keep the keys on a nail in a post on the street next to the door.
I did exactly what I did in the question and it works on all browser except Safari on a Mac

Resources