Change a user's password in ejabberd over xmpp - xmpp

Is it possible for the admin to change a user's password through XMPP in ejabberd? After I logged in the admin account, I issued the following stanza:
<iq type="set" id="change6075" from="admin#example.com">
<query xmlns="jabber:iq:register">
<username>user1</username>
<password>code1</password>
</query>
</iq>
But it doesn't work, how can I modify a user's password over XMPP using the admin account?

You can change the user password with the help of mod_admin_extra command:
$ ejabberdctl change-password User Host newPassword

Related

Sendgrid setup on SQL Database Mail

I have been trying to setup sendgrid on SQL Database Mail but all the time it says Cannot send mail to mail server.
This is what i have done.
I have sendgrid accound with abc#mydomain.com and created api key and SG.xxxx password.
As this is prod setup instance, i had done domain level authentication and my webmaster updated CNAME as requested by sendgrid.
Tested using TELNET smtp.sendgrid.net 587 and authenticated with SG.xxxx password Base64 encoded and this was able to send email from abc#mydomain.com to xyz#mydomain.com
I setup profile with abc#mydomoain.com as SQL notification Profile and selected Basic Authentication and provided 'apikey' as username and 'SG.xxx' as password in Database Mail - 'Configure Database Mail' option in SQL SSMS. Unchecked - 'The server requires secure authentication (SSL) connection' Port 587
I tried to 'Send Test Mail' with 'abc#domain.com' to 'xyz#mydomain.com' but the Database Mail reflects as below screenshot error
I have tried using abc#mydomain.com and sendgrid account password in Database Mail Config wizard for Basic authentication, but sendgrid suggested they don't accept Basic authentication. Please help how and where should i pass the api key if not under Basic Authentication ?
I tried updating with msdb.dbo.sysmail_add_account_sp nad updating records but it too didn't resolve and send email from Database mail.
Any help/ guidance would be greatly appreciated or if you had faced this how have you resolved it.
Hi the solution is as follows
Create a dbmail profile
server name: smtp.sendgrid.net
port : 25
SMTP Authentication
Basic Auth
User name: apikey
Password: : {the api-key for your sendgrid account}
Thats it. Send a test email.
If it still doesn't work, if you are on AWS EC2 ensure that security group allows outbound port:25
Here is the link from sendgrid about apikey authentication.
https://docs.sendgrid.com/for-developers/sending-email/upgrade-your-authentication-method-to-api-keys

Elmah sending error mails with Sendgrid API Keys

Normally I use the SMTP settings in my web.config file with UN/PW to my Sendgrid account to send elmah error emails. But, with two factor authentication I don't believe sendgrid allows sending emails with basic authentication. Does, anyone know if there is a way to use the API key to authenticate the Elmah error emails?
<elmah>
<errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="DefaultConnection" />
<errorMail from="error#domain.com" to="email#gmail.com" subject="Exception (test)" smtpServer="smtp.sendgrid.net" smtpPort="587" userName="username" password="password" async="true" />
<security allowRemoteAccess="true" />
</elmah>
Thank you!
SendGrid doesn't offer auth through basic authentication when two-factor is enabled. From their documentation:
SendGrid no longer accepts Basic authentication (username and password) for API calls when two-factor authentication is enabled for a user. You can now only use two-factor authentication if you are authenticating with an API key. For more information, see Authentication.
I believe you might have a chance to get this working, though. Try setting the username in config to apikey and password to an API key you generate through SendGrid. Possible solution found here: https://sendgrid.com/docs/API_Reference/SMTP_API/integrating_with_the_smtp_api.html

Are IMAP/SMTP credentials always the same as the user's login credentials?

Greetings!
This question pertains to Normal (or Plain) IMAP/SMTP Authentication.
Can we be sure that a user's IMAP username is exactly the same as his full email address? Can the two be different? What about his SMTP username? Can he have different passwords for IMAP and SMTP?
To make things concrete, consider a webmail user, John Doe:
Email address: john.doe#example.com
Login password: foo.bar.baz
Given that John uses the above credentials to sign in with his webmail provider, here's a series of yes–no questions:
Can we be certain that John's IMAP username is john.doe#example.com?
1.1. Could it be john.doe, john or something else?
Can we be certain that John's IMAP password is foo.bar.baz?
Can we be certain that John's SMTP username is john.doe#example.com?
Can we be certain that John's SMTP password is foo.bar.baz?
Can we be certain that John's IMAP password is the same as his SMTP password?
Can we be certain that John's IMAP username is the same as his SMTP username?
I've been looking for these answers for a while now. If you can link to an RFC, that'd be awesome.
Thanks in advance. :)
SMTP and IMAP can be handled by disjoint programs, so no assurances there. Dovecot IMAP for example lets you freely choose to map username against mailbox name.
Certain - no, you can't be certain, as the server administrator can set any policy they like regarding these things.
However, RFC 6186 gives some suggestions. It suggests that mail user agents (MUAs) should first try using the full email address as the username for authentication (in this case john.doe#example.com), and if authentication fails, try again with the "local-part" as username (in this case john.doe). It also suggests that service providers should support authenticating with either of those usernames. This applies to both SMTP and IMAP authentication.
The RFC doesn't say anything about whether the username should be the same for SMTP and IMAP (so if the IMAP server wants the username john.doe#example.com and the SMTP server wants john.doe, that would still be within what the RFC suggests), and it doesn't say anything at all about passwords.
The RFC also suggests using DNS SRV records to find the hostname of the IMAP and SMTP servers given an email address. You can see this in action for Gmail using the dig command line tool:
$ dig +short -t srv _imaps._tcp.gmail.com
5 0 993 imap.gmail.com.
$ dig +short -t srv _submission._tcp.gmail.com
5 0 587 smtp.gmail.com.
That is, the IMAPS server is on imap.gmail.com, port 993, and the SMTP server for mail submission is on smtp.gmail.com, port 587.

SwiftMailer not send mail with Google App account

I'm using Symfony and I'm trying to send an email with swiftmailer. I have an account set up with google app (produccion#mydomain.com) and when I try to send shows me the following error:
Failed to authenticate on SMTP server with username
"produccion#mydomain.com" using 2 possible authenticators
I tried it with my personal gmail account and send the message correctly with the same settings. Just change the username and password.
# Swiftmailer Configuration
swiftmailer:
transport: smtp
host: smtp.gmail.com
username: produccion#mydomain.com #email#gmail.com
password: google_app_password #gmail_password
auth_mode: login
port: 587
encryption: tls
I've been searching the internet and I've found this page from Google, where I can change the access to less secure applications.
https://www.google.com/settings/security/lesssecureapps
In my gmail account this option is active, but if I turn shows me the same error when sending email.
I've been trying to change this setting in google app account but it tells me that this option is not available for google app.
Any idea to send emails from this account by google app? I have to set something else?
EDIT
It seems Gmail prefers OAuth, Swiftmailer supports this authentication mech but its not really documented.
https://developers.google.com/gmail/xoauth2_protocol
https://github.com/swiftmailer/swiftmailer/blob/5.x/lib/classes/Swift/Transport/Esmtp/Auth/XOAuth2Authenticator.php
Any idea how I use it in Symfony?
Have you tried setting the transport parameter to gmail as mentioned in the cookbook? http://symfony.com/doc/current/cookbook/email/gmail.html
# Swiftmailer Configuration
swiftmailer:
transport: gmail
username: your_gmail_username
password: your_gmail_password

login to roundcube without logging in to cpanel

I am trying to set up web mail for users on my server. I want them to be able to access RoundCube, but I have cPanel installed so the only way to access RoundCube is after logging in to cPanel. Since I do not want my users logging into cPanel? I could fake the session variables for a cPanel login, but I don't want my users to have access to anything in cPanel. Or should I try to install another webmail client? Will that even work?
No need to install other webmail on your server, your client access webmail withour login cpanel with your domain name or server IP and webmail port no as below:
yourdoaminname.com:2095
or
serverIP:2095
simply enter email address and password to login.