I am trying to create an exim router where the from and the to headers are being fetched from a mysql database.
As I can not find much documentation about using such a forwarder for non-existing domains on the local server I am quite stuck.
I have the following router where only the receiving mail account is being matched at the moment:
virtual_user_fwd:
driver = redirect
verify = no
data = ${lookup mysql{SELECT adress FROM mail_forwards WHERE host = '${quote_mysql:$domain}' AND fwd IS NOT NULL} {${sg{$value}{\\n}{, }}}}
I need the next step: Somewhere/Somehow where I define the mail account where the mails are forwarded to.
Is there anyone who can help me get to the next step?
I have found a new way to create the mysql link
virtual_userforward:
driver = redirect
verify = no
data = ${lookup mysql { SELECT goto FROM mail_forwards WHERE adress='${local_part}#${domain}'}}
domains = *
This seems to work for the virtual test, however when testing an email I get an error 'unroutable adress'. Any ideas?
Related
i'm using three instances in my account lab. All of them :
1.-web app and a proxy (ubuntu image)
2.-keyrock 5 (keyrock-R5.1.0 image)
3.-spagobi (spagobi image)
i having troubles setting spagobi to validate with keyrock, as in this link: authentication on spagobi using keyrock
"error while trying to get access token from Oauth2 provider"
I followed the guide here:
http://spagobi.readthedocs.org/en/latest/admin/README/index.html
the only difference is REST_BASE_URL, i change port to 5000. (default is 4730)
I think the problem is that spagobi tries to access token without X-Auth-Token value on headers. But i don't know where can i set this on spagobi.
Anyone know this problem and how to solve it? or maybe i'm wrong?
my oauth2.config.properties:
# Informations about OAuth2 application
CLIENT_ID = ea74f4f72ee3438a82f1af785af0ecf1
SECRET = 21cf7df4633d4ff2b92251c266c00d09
APPLICATION_ID = ea74f4f72ee3438a82f1af785af0ecf1
# OAuth2 urls
AUTHORIZE_URL = http://example.es:8000/oauth2/authorize
ACCESS_TOKEN_URL = http://example.es:8000/oauth2/token
USER_INFO_URL = http://example.es:8000/user
REDIRECT_URI = http://example.es:8080/SpagoBI/servlet/AdapterHTTP?PAGE=LoginPage&NEW_SESSION=TRUE
# REST API urls
REST_BASE_URL = http://example.es:5000/v3/
TOKEN_PATH = auth/tokens
ROLES_PATH = OS-ROLES/roles
ORGANIZATIONS_LIST_PATH = OS-ROLES/organizations/role_assignments
ORGANIZATION_INFO_PATH = projects/
# Admin credentials
ADMIN_ID = fiware-example-admin
ADMIN_EMAIL = fiware#example.es
ADMIN_PASSWORD = 01189998819991197253
Sorry. My fault:
because we have not ready the real domain, i add in my /etc/hosts a local resolution. But in spagobi instance i dont do it.
the real problem is in screenshoot:
java.net.UnknownHostException
I solved it adding in /etc/hosts on spagobi instance the same ip.
Sorry for the inconvenience.
I have seen a number of posts relating to this issue, however, have still not found an answer that works for me. I'm trying to connect to an external MySQL database on Bluehost, from a Google Apps Script, using Jdbc.getConnection()
I've tried configuring a table with both MyISAM and InnoDB. In both cases I get the "Failed to connect to the database..." error. In one of the posts, I saw that someone had set their storage engine version to 5.5.25a. I looked for how to do that but couldn't find it in the phpMyAdmin interface that Bluehost provides. They also allow you to write SQL scripts but I couldn't find an SQL syntax example other than "ALTER TABLE [tablename] ENGINE=InnoDB", with no way to specify a version number.
In the code sample below, I don't provide a table name since the getConnection() function is failing anyway. If I can get the connection to work, I'll be good to go.
Here's my apps script code:
function myFunction() {
var address = '69.195.124.100:3306';
var user = 'nathany7_usr2';
var userPwd = 'vom4usr2';
var db = 'nathany7_test2db';
var dbUrl = 'jdbc:mysql://' + address + '/' + db;
try{
// Write one row of data to a table.
var conn = Jdbc.getConnection(dbUrl, user, userPwd);
...
// close database
conn.close();
}catch(e){
return e.message;
}
This is an old question but I just happened upon it now and think I might have the answer. Maybe it will be useful for someone else, if not for OP.
If I understand correctly you are trying to connect to a MySQL database running on your bluehost server from another server. By design, however, Bluehost will block all incoming database connections to it's server (a reasonable security measure methinks)
So you first have to follow the steps here ( https://my.bluehost.com/cgi/help/89 ) to allow the server you're executing the script on to pass the connection call through Bluehost's firewall.
My CodeIgniter app on Google App Engine is not able to connect to my database on Google Cloud SQL. I tried so many things.
My site loads when I leave database username, password & database name empty but, pages that have database calls show an error. It says that no database was selected.
I noticed that my database was not created and created a new database and a user with all privileges. I entered this details in my app and now, it doesn't even connect to the database server. No pages serve.
When I remove only the username & password fields in database.php, it connects to the database server but, doesn't connect to the database.
I checked the mysql database for users and my user has all privileges. I checked all spellings and it is correct. The app is working locally. HOW I CAN FIX THIS? i just can't get it to connect.
Out of the box CodeIgniter will not connect to a Google Cloud SQL instance, modifications to the CI database driver files are required, this is because CI expects that it’s choices are either to connect to localhost or to a remote tcpip host, the developers never anticipated that anybody would want to connect directly to a socket.
I chose to use the Mysqli driver instead of Mysql for performance reasons and here is how I did it:
Step 1) Edit the codeigniter/system/database/drivers/mysqli/mysqli_driver.php file and replace the db_connect function with the following code:
function db_connect()
{
if(isset($this->socket)){
return mysqli_connect(null, $this->username, null, $this->database, null, $this->socket);
}
elseif ($this->port != ”)
{
return mysqli_connect($this->hostname, $this->username, $this->password, $this->database, $this->port);
}
else
{
return mysqli_connect($this->hostname, $this->username, $this->password, $this->database);
}
}
Step 2) Alter your application’s config/database.php (or wherver you want to declare your database settings) - Depending on your application you may choose to add “database” to the autoload array in the yourapp/config/autoload.php or you may choose to manually call the load->database() function. This assumes your application name is “myappname”. Replace APPENGINE-ID and DATABASE-INSTANCE-ID and YOUR_DATABASE_NAME appropriately.
$db[‘myappname’][‘hostname’] = ‘localhost’;
$db[‘myappname’][‘username’] = ‘root’;
$db[‘myappname’][‘password’] = null;
$db[‘myappname’][‘database’] = ‘YOUR_DATABASE_NAME’;
$db[‘myappname’][‘dbdriver’] = ‘mysqli’;
$db[‘myappname’][‘pconnect’] = FALSE;
$db[‘myappname’][‘dbprefix’] = ‘’;
$db[‘myappname’][‘swap_pre’] = ‘’;
$db[‘myappname’][‘db_debug’] = FALSE;
$db[‘myappname’][‘cache_on’] = FALSE;
$db[‘myappname’][‘autoinit’] = FALSE;
$db[‘myappname’][‘char_set’] = ‘utf8’;
$db[‘myappname’][‘dbcollat’] = ‘utf8_general_ci’;
$db[‘myappname’][‘cachedir’] = ”;
$db[‘myappname’][‘socket’] = ‘/cloudsql/APPENGINE-ID:DATABASE-INSTANCE-ID’;
Viola, your CodeIgniter application should now be able to connect and talk to your Google Cloud MySQL database!
Now if you want to get really fancy and enable the database caching, either make alterations to the CI code to use memcache (fastest) or Google Cloud Storage (more guaranteed persistance) but I won’t cover that in this blog…
Answer courtesy of http://arlogilbert.com/post/67855755252/how-to-connect-a-codeigniter-project-to-google-cloud
Have you authorized your appengine app for access to the Cloud SQL instance? Go to the access control panel on the console for the instance (at https://cloud.google.com/console#/project/{project name}/sql/instances/{instance name}/access-control). Look for authorized app engine applications.
Otherwise, if you're connecting to the instance successfully, you'll have to choose the database from your code or configuration (depending on the app). For example, from the "running wordpress" guide (https://developers.google.com/appengine/articles/wordpress) you have to define DB_NAME. If you're handling the connections in your own code you'll need to use mysql_select_db.
From skimming the codeigniter docs, it looks like you need something like:
$config['database'] = "mydatabase";
I'm not familiar with this framework though, so check the docs yourself (http://ellislab.com/codeigniter/user-guide/database/configuration.html).
I know how to insert a new group via MySQL, and it works, to a degree. The problem is that the database changes are not loaded into memory if you insert the group manually. Sending a HUP signal to the process does work, but it is kludgy and a hack. I desire elegance :)
What I am looking to do, if possible is to make changes (additions/deletions/changes) to a group via MySQL, and then send an HTTP request to the openfire server to read the new changes. Or in the alternative, add/delete/modify groups similar to how the User Service works.
If anyone can help I would appreciate it.
It seems to me that if sending a HUP signal works for you, then that's actually quite a simple, elegant and efficient way to get Openfire to read your new group, particularly if you do it with the following command on the Openfire server (and assuming it's running a Linux/Unix OS):
pkill -f -HUP openfire
If you still want to send an HTTP request to prompt Openfire to re-read the groups, the following Python script should do the job. It is targeted at Openfire 3.8.2, and depends on Python's mechanize library, which in Ubuntu is installed with the python-mechanize package. The script logs into the Openfire server, pulls up the Cache Summary page, selects the Group and Group Metadata Cache options, enables the submit button and then submits the form to clear those two caches.
#!/usr/bin/python
import mechanize
import cookielib
# Customize to suit your setup
of_host = 'http://openfire.server:9090'
of_user = 'admin_username'
of_pass = 'admin_password'
# Initialize browser and cookie jar
br = mechanize.Browser()
br.set_cookiejar(cookielib.LWPCookieJar())
# Log into Openfire server
br.open(of_host + '/login.jsp')
br.select_form('loginForm')
br.form['username'] = of_user
br.form['password'] = of_pass
br.submit()
# Select which cache items to clear in the Cache Summary page
# On my server, 13 is Group and 14 is Group Metadata Cache
br.open(of_host + '/system-cache.jsp')
br.select_form('cacheForm')
br.form['cacheID'] = ['13','14']
# Activate the submit button and submit the form
c = br.form.find_control('clear')
c.readonly = False
c.disabled = False
r = br.submit()
# Uncomment the following line if you want to view results
#print r.read()
I have a report to which I have execute-only access - I don't have the access to the RDL file. This report exposes several parameters which I would like to set from URL.
I've successfully changed some parameters using the standard param=data form (as explained here: http://msdn.microsoft.com/en-us/library/ms153586.aspx). However, some parameters don't have the same parameter-prompt and parameter-name.
Unfortunately, to pass parameter values by URL I must know the name of the parameter and I don't see how I can deduct from the report and its parameters prompt text. I've tried to inspect the source and post-data but to no avail.
Anyone has an idea?
Thanks
P.S I also stumbled on this: http://odetocode.com/Articles/123.aspx. However, I wasn't able to connect to the web-services of my report server.
Ugh. I'm replying to myself, hopefully someone can learn from it:
I did it, eventually, using Reporting Services web service as described here and here. A point to remember here is that the name of the service has been changed (I believe from SQL server 2005 and onward) endpoint is ReportService2005.asmx.
After adding the web reference I was still having various problems. To summarize, this is the code that eventually worked for me (note: I am in domain and the IIS I'm connecting to requires domain windows auth).
ReportParameter[] parameters;
const string historyId = null;
const bool forRendering = true;
ParameterValue[] values = null;
DataSourceCredentials[] credentials = new DataSourceCredentials[] {};
ReportingService2005SoapClient c = new ReportingService2005SoapClient();
c.ClientCredentials.Windows.ClientCredential = new System.Net.NetworkCredential("USERNAME", "PASSWORD", "DOMAIN");
c.ClientCredentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Impersonation;
c.GetReportParameters
(
"/CycleStatus/Builds Score",
historyId,
forRendering,
values,
credentials,
out parameters
);
However, I was plagued by the following error:
"The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'"
To handle that you need to change, in your app.config the security node, like so:
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />
</security>
After that everything worked fine.