Unable to authenticate iRedmail Ldap mail accounts with Redmine application - redmine

I have two different servers for iRedMail and Redmine applications. iRedMail is using OpenLDAP internally to create email accounts.
I would like to authenticate Redmine application with iRedMail OpenLDAP mail accounts.
I have done the below LDAP settings but Login fails in Redmine application when i try to login with iRedMail email and password and displays a message as "Invalid UserId and Password"
iRedMail LDAP skeleton
dc=example,dc=com
-- o=domains
---- domainName=example.com
------ ou=Users
---------mail=testuser1#example.com
---------mail=testuser2#example.com
DN for testuser1: mail=testuser1#example.com,ou=Users,domainName=example.com,o=domains,dc=example,dc=com
DN for testuser2: mail=testuser2#example.com,ou=Users,domainName=example.com,o=domains,dc=example,dc=com
Redmine application LDAP configuration
Name - LdapRedMail
Host - IpAddress
Port - 389
LDAPS - No
Account - cn=Manager,dc=example,dc=com
Password - ******
Base DN - domainName=example.com,o=domains,dc=example,dc=com
LDAP filter - (&(enabledService=mail)(enabledService=deliver)(enabledService=displayedInGlobalAddressBook)(|(objectClass=inetOrgPerson)(objectClass=mailUser)))
Attributes
Login attribute - mail
Firstname attribute - givenName
Lastname attribute - sN
Email attribute - mail
So would anyone help to resolve this issue?

After long search, i am able resolve the issue as shown below,
Name - LdapRedMail
Host - IpAddress
Port - 389
LDAPS - No
Account - cn=vmail,dc=example,dc=com
Password - <vmail password from settings.py>
Base DN - o=domains,dc=example,dc=com
LDAP filter - <empty>

Related

WSO2 Error: Unable to retrieve custom url info from APIM Admin API

I am using WSO2 3.2.0/docker-compose
And i have this setup for APIM (as reverse proxy using Nginx)
https://apim.mydomain.com/devportal
https://apim.mydomain.com/publisher
also i have this reverse proxy for the analytics dashboard:
https://apim-analytics.mydomain.com
however, when i open the dashboard i see this error in the web console and dark screen:
{"error":"Internal_Server_Error","description":"Error in login to the uri \u0027analytics-dashboard\u0027. Error: Unable to retrieve custom url info from APIM Admin API"}
i suspect the issue is here apim-analytics-dashboard/conf/dashboard/deployment.yaml (wrong configuration):
auth.configs:
type: apim
ssoEnabled: true
properties:
adminScope: apim_analytics:admin_carbon.super
allScopes: apim_analytics:admin openid apim:api_view apim:subscribe apim_analytics:monitoring_dashboard:own apim_analytics:monitoring_dashboard:edit apim_analytics:monitoring_dashboard:view apim_analytics:business_analytics:own apim_analytics:business_analytics:edit apim_analytics:business_analytics:view apim_analytics:api_analytics:own apim_analytics:api_analytics:edit apim_analytics:api_analytics:view apim_analytics:application_analytics:own apim_analytics:application_analytics:edit apim_analytics:application_analytics:view
adminUsername: admin
adminPassword: admin
kmDcrUrl: https://api-manager:9443/client-registration/v0.17/register
kmTokenUrlForRedirection: https://api-manager:9443/oauth2
kmTokenUrl: https://api-manager:9443/oauth2
kmUsername: admin
kmPassword: admin
portalAppContext: analytics-dashboard
businessRulesAppContext : business-rules
cacheTimeout: 30
baseUrl: https://apim-analytics.mydomain.com
grantType: authorization_code
publisherUrl: https://apim.mydomain.com/publisher
devPortalUrl: https://apim.mydomain.com/devportal
externalLogoutUrl: https://api-manager:9443/oidc/logout
adminServiceBaseUrl: https://api-manager:9443

WSO2 Analytics Hostname

API Manager 3.0.0 and Analytics 3.0.0
Actually API-M I changed to hostname with any problems. When I change to hostname of Analytics some erros to login:
Only I change in [API-Analytics]/conf/dashboard/deployment.yaml
deployment.yaml
## Authentication configuration
auth.configs:
type: apim
ssoEnabled: true
properties:
adminScope: apim_analytics:admin_carbon.super
allScopes: apim_analytics:admin apim_analytics:product_manager apim_analytics:api_developer apim_analytics:app_developer apim_analytics:devops_engineer apim_analytics:analytics_viewer apim_analytics:$
adminServiceBaseUrl: https://myhostname:9443
adminUsername: admin
adminPassword: admin
kmDcrUrl: https://myhostname:9443/client-registration/v0.15/register
kmTokenUrlForRedirection: https://myhostname:9443/oauth2
kmTokenUrl: https://hostname:9443/oauth2
kmUsername: admin
kmPassword: admin
portalAppContext: analytics-dashboard
businessRulesAppContext : business-rules
cacheTimeout: 900
baseUrl: https://myhostname:9643
grantType: authorization_code
publisherUrl: https://myhostname:9443
#storeUrl: https://myhostname:9443
If I have this error in terminal, after to start dashboard server.
<ip adress> != <localhost>
But I change myhostname to localhost no sends this errors but in login page of Dashboard sends:
https://localhost:9443/oauth2/authorize?response_type=code&client_id=VACHtG8hNxzG2au1EcA3sNmmXooa&scope=apim_analytics%3Aadmin%20apim_analytics%3Aproduct_manager%20apim_analytics%3Aapi_developer%20apim_analytics%3Aapp_developer%20apim_analytics%3Adevops_engineer%20apim_analytics%3Aanalytics_viewer%20apim_analytics%3Aeveryone%20openid%20apim%3Aapi_view%20apim%3Asubscribe&redirect_uri=https%3A%2F%2Flocalhost%3A9643%2Flogin%2Fcallback%2Fanalytics-dashboard%2Flogin
So, how fix or changed hostanem correctly?
Edit:
I change only kmTokenUrlForRedirection,kmTokenUrl and baseUrl from deplymento.yaml and dashboard page I have:
I search the error and found this link https://apim.docs.wso2.com/en/latest/troubleshooting/troubleshooting-invalid-callback-error/
But I try put somo regexp similar to:
regexp
regexp=(https://myhostname:9643/analytics-dashboard/login|https://myhostname:6443/analytics-dashboard/logout)
But nothing.
My new question is:
Where is a correct form of regexp of dashboard?
Change your analytics_dashboard sp's regex to following and try.
regexp=(https://myhostname:9643/login/callback/analytics-dashboard/login|https://myhostname:9643/analytics-dashboard)

Redmine don't send e-mail, execution expired error

I'm having problems using email in redmine. This is my redmine Environment versions:
Environment:
Redmine version 2.4.2.stable
Ruby version 1.9.3-p484 (2013-11-22) [x86_64-linux]
Rails version 3.2.16
Environment production
Database adapter MySQL
SCM:
Git 1.9.1
Filesystem
Redmine plugins:
no plugin installed
I configured the configuration.yml file like this:
production:
email_delivery:
delivery_method: :smtp
smtp_settings:
enable_starttls_auto: true
address: "smtp.office365.com"
port: 587
domain: "mydomain.com.br"
authentication: :login
user_name: "user#mydomain.com.br"
password: "mypassword"
attachments_storage_path: /home/redmin/Downloads/redmine-2.3.2/files
autologin_cookie_name:
autologin_cookie_path:
autologin_cookie_secure:
scm_subversion_command: svn
scm_mercurial_command:
scm_git_command: /usr/bin/git
scm_cvs_command:
scm_bazaar_command:
scm_darcs_command:
scm_stderr_log_file:
database_cipher_key:
rmagick_font_path:
So, i access redmine in browser and click in button "Send Test Email" but i got the following error: execution expired after a lot of time loading page.
In my production.log file i got a success message without any error, but e-mail never arrive:
Sent email "Redmine test" (30215ms)
to: target#gmail.com
Edit 1:
If i change the devlivery_method to ":sendmail" the test works but email never arrives.

It's slow to send email by the default EmailBackend of django 1.11 using Microsoft business email account

I'm using the default EmailBackend of Django 1.11, I just simply called the send_mail method as the ref. document said, here are my settings of the SMTP server:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp-mail.outlook.com'
EMAIL_PORT = '587'
EMAIL_USE_TLS = True
EMAIL_HOST_USER = 'oalite#xxx.com'
EMAIL_HOST_PASSWORD = 'xxxxx'
EMAIL_SUBJECT_PREFIX = '[OALite Admin]'
Here is my log outputted by smtplib.py:
reply: b'250-CHUNKING\r\n'
reply: b'250 SMTPUTF8\r\n'
reply: retcode (250); Msg: b'SG2PR06CA0180.outlook.office365.com Hello [85.203.47.85]\nSIZE 157286400\nPIPELINING\nDSN\nENHANCEDSTATUSCODES\nAUTH LOGIN XOAUTH2\n8BITMIME\nBINARYMIME\nCHUNKING\nSMTPUTF8'
send: 'AUTH LOGIN b2FBaXRl0GlyaXhpLmNvb0==\r\n'
reply: b'334 UGFzc3dvcmQ6\r\n'
reply: retcode (334); Msg: b'UGFzc3dvcmQ6'
send: 'QEdBbH1w0DJuSwY=\r\n
>>>>>>>>>>>>>>>>>> halted here for about 15s to wait the reply <<<<<<<<<<<<<<<<<<<
reply: b'235 2.7.0 Authentication successful target host BLUPR04MB420.namprd04.prod.outlook.com\r\n'
reply: retcode (235); Msg: b'2.7.0 Authentication successful target host BLUPR04MB420.namprd04.prod.outlook.com'
send: 'mail FROM:<oalite#xxx.com> size=943\r\n'
reply: b'250 2.1.0 Sender OK\r\n'
reply: retcode (250); Msg: b'2.1.0 Sender OK'
send: 'rcpt TO:<user.foo#xxx.com>\r\n'
reply: b'250 2.1.5 Recipient OK\r\n'
Please note that I was using the business email account of Microsoft, the domain xxx.com actually is our company domain name.
I have no idea why it took 15s to authenticate, it's very fast to send emails using the outlook desktop app with the same account. Is it faster to use Exchange protocol then to use SMTP protocol?
Thanks for your help!
A few options for quickly sending outgoing mail from views, when authentication is slow:
Use celery to offload mail sending to an offline task.
Install a local (forwarding) mail server on your host. On linux this can be accomplished easily with postfix. You can configure the mail server to connect to your business email account.
Both :-)
There seems to be a REST API to connect to outlook.com - so you can also write your own mail backend for sending mail via HTTP.

How do I send email using php via wamp?

I want to use wamp as my development server and I'm trying to send email via my email => gmail, hotmail, yahoo. I'm trying to implement a simple email php application.
Is it possible to do it in wamp?
Is it possible to do it without changing php.ini and instead use ini_set();
I have tried changing my php.ini
using my yahoo mail
SMTP = smtp.mail.yahoo.com
; http://php.net/smtp-port
smtp_port = 587
auth_user = me#yahoo.com
auth_pass = password
and got this error message "Warning: mail() [function.mail]: SMTP server response: 530 authentication required - for help go to http://help.yahoo.com/help/us/mail/pop/pop-11.html in C:\wamp\www\9dot_disc_alt\abc.php on line 12"
using gmail
SMTP = smtp.gmail.com
; http://php.net/smtp-port
smtp_port = 587
auth_user = me#gmail.com
auth_pass = password
SMTP server response: 530 5.7.0 Must issue a STARTTLS command first. pc6sm6631754pbc.47 in C:\wamp\www\9dot_disc_alt\abc.php on line 12
Here's my current code:
$to = "me#yahoo.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "me#my.com";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
Sir/Ma'am your answers would be of great help and be very much appreciated. Thank you++
When you use wamp, your SMTP must be your FAI, for example if you have free :
=>SMTP = smtp.free.fr (or .com)
EDIT : You can try this : http://glob.com.au/sendmail/, i's a simple windows console application that emulates sendmail's for wamp for example ;)
I found an online article that allows me to send emails using wamp + php mailer
http://nikunj-solutions.blogspot.com/2011/08/send-email-using-wamp-server.html