Mahara is not sending welcome email - email

I am trying to figure out why my Mahara is not sending welcome emails or emails when a user grants access to other users. User registration works normally and users receive welcome emails, but when I as an administrator try to add the new user it works but I get the message Error sending welcome email and the user does not receive the email.
Resetting the password via email works fine.
Error message I get:
EmailException: Couldn't send email to "Name Surname" with subject You have been given access to 1 portfolio by "Name Surname". Error from phpmailer was: SMTP Error: Could not authenticate. in /var/www/mahara/web/lib/user.php:920
Stack trace:
#0 /var/www/mahara/web/notification/email/lib.php(104): email_user()
#1 /var/www/mahara/web/lib/mahara.php(1819): PluginNotificationEmail::notify_user()
#2 /var/www/mahara/web/lib/activity.php(996): call_static_method()
#3 /var/www/mahara/web/lib/activity.php(1055): ActivityType->notify_user()
#4 /var/www/mahara/web/lib/activity.php(89): ActivityType->notify_users()
#5 /var/www/mahara/web/lib/activity.php(231): handle_activity()
#6 /var/www/mahara/web/lib/cron.php(201): activity_process_queue()
#7 {main}
It should not be the authentication problem, the server is normally sending emails (when users manually registers or reset their password).

Related

Can't Resolve NoReverseMatch Error "NoReverseMatch at /accounts/signup/"

I have been working on an archiving web app in django. I needed to create an email verification for users at signup (registration). But I'm encountering a problem with URL redirection of the email html. Here are my codes below. Kindly requesting help?????
views.py
urls.py
account_activation_email.html
Error page
I was expecting an email to be sent and when the activation link clicked, a login page appears telling the user has been successfully activated

Error when sending email with Accounts.sendVerificationEmail()

Thank you for reading my message, here is my problem :
I recently started using email package, I defined MAIL_URL and sent emails with Email.send() successfully.
But now I want to send verification emails and I got errors. Here is my code :
On server
Meteor.methods({
'sendVerificationEmail'(){
Accounts.sendVerificationEmail(Meteor.userId());
}
});
On client
Meteor.call('sendVerificationEmail');
I got the following error :
With a few research I found this :
This message means that the email you sent was blocked by the
recipient's email hosting server, and returned to you
I tried Accounts.sendVerificationEmail() with users who have different emails (gmail, disposable email, email of my personal website) and I always have the same error.
The strange thing is that Email.send() works perfectly...
Thanks in advance for your help.
EDIT :
The email address I'm using to send those emails is using the domain rezarahemtola.com
Here is the result of dig rezarahemtola.com ns that Scott Stensland asked me to run in his answer :
You need to look at the dns hosting provider for your domain name ... like example.com ... assure you have added an MX Record Type ... it typically uses a value as
10 example.com
you can get a hint as to where your dns hosting is by issuing
dig example.com ns
to display its Name Server ( ns )
Posting the solution for anyone facing the same problem :
As I said Email.send() was working correctly but got an error with Accounts.sendVerificationEmail, Accounts.sendResetPasswordEmail etc.
Looks like Meteor can't retrieve automatically the sender address when using those methods, so you should set it like that :
Accounts.emailTemplates.from = "Your_Name <your_email#example.com>";
You can also check the docs about it.

Office 365/Exchange Online Mail rule triggers twice when 2 internal recipients receive mail

I am having an issue where we have a rule set up to catch all mail coming in from a specific address and BCC the email off to 2 external addresses.
The rule is set up like this
If the message...
Is received from 'email#example.com'
Do the following...
Blind carbon copy(Bcc) the message to 'external#domain1.com' and 'external#domain2.com'
The email from email#example.com is sent from a web form and addressed to auser#mydomain.com and asharedmailbox#mydomain.com.
When the mail comes in, it is BCC'd twice to the external addresses and 1 copy only delivered locally in user and sharedmailbox.
This is all reflected in a message trace.
Has anyone come across this and knows how to prevent this?
TIA
Someone else in my organisation found out how to work around this.
They added in a condition to the "If the message" operation as below
If the message...
Is sent to 'auser#mydomain.com'
And Is received from 'email#example.com'
Do the following...
Blind carbon copy(Bcc) the message to 'external#domain1.com' and 'external#domain2.com'
And now the rule only processed once.

Magento 2.3.1 Authorize.net Payment Method - The authenticity of the gateway response could not be verified

When you place an order using Authorized.Tet as a payment method on Magento 2.3.1
this error shows up
"The authenticity of the gateway response could not be verified"
Can someone enlighten me what this error is all about and help me fix this error?
V1/guest-carts/fYSiT09cTjrNy2T14YzaXPXDlDMjMUUL/payment-information 400 (bad request)
{message: "The authenticity of the gateway response could not be verified.",…}
message: "The authenticity of the gateway response could not be verified."
trace: "#0 /home/eaglesc3/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Checkout\Model\GuestPaymentInformationManagement->savePaymentInformationAndPlaceOrder('fYSiT09cTjrNy2T...', 'roeland#alwayso...', Object(Magento\Quote\Model\Quote\Payment\Interceptor), Object(Magento\Quote\Model\Quote\Address))
#1 /home/eaglesc3/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Checkout\Model\GuestPaymentInformationManagement\Interceptor->___callParent('savePaymentInfo...', Array)
#2 /home/eaglesc3/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Checkout\Model\GuestPaymentInformationManagement\Interceptor->Magento\Framework\Interception\{closure}('fYSiT09cTjrNy2T...', 'roeland#alwayso...', Object(Magento\Quote\Model\Quote\Payment\Interceptor), Object(Magento\Quote\Model\Quote\Address))
#3 /home/eaglesc3/public_html/generated/code/Magento/Checkout/Model/GuestPaymentInformationManagement/Interceptor.php(26): Magento\Checkout\Model\GuestPaymentInformationManagement\Interceptor->___callPlugins('savePaymentInfo...', Array, Array)
#4 [internal function]: Magento\Checkout\Model\GuestPaymentInformationManagement\Interceptor->savePaymentInformationAndPlaceOrder('fYSiT09cTjrNy2T...', 'roeland#alwayso...', Object(Magento\Quote\Model\Quote\Payment\Interceptor), Object(Magento\Quote\Model\Quote\Address))
#5 /home/eaglesc3/public_html/vendor/magento/module-webapi/Controller/Rest/SynchronousRequestProcessor.php(95): call_user_func_array(Array, Array)
#6 /home/eaglesc3/public_html/vendor/magento/module-webapi/Controller/Rest.php(188): Magento\Webapi\Controller\Rest\SynchronousRequestProcessor->process(Object(Magento\Framework\Webapi\Rest\Request\Proxy))
#7 /home/eaglesc3/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))
#8 /home/eaglesc3/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Webapi\Controller\Rest\Interceptor->___callParent('dispatch', Array)
#9 /home/eaglesc3/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Webapi\Controller\Rest\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#10 /home/eaglesc3/public_html/generated/code/Magento/Webapi/Controller/Rest/Interceptor.php(26): Magento\Webapi\Controller\Rest\Interceptor->___callPlugins('dispatch', Array, Array)
#11 /home/eaglesc3/public_html/vendor/magento/framework/App/Http.php(136): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#12 /home/eaglesc3/public_html/generated/code/Magento/Framework/App/Http/Interceptor.php(24): Magento\Framework\App\Http->launch()
#13 /home/eaglesc3/public_html/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http\Interceptor->launch()
#14 /home/eaglesc3/public_html/index.php(92): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#15 {main}"
Looking at the source code this error seems to center around the hash used to verify the response. The transactionResponse->transHashSha2 and transactionResponse->transHash both appear to be either empty or the hash itself isn't valid.
Your version of Magento seems to support this change and indicates what you need to do to resolve this. Since you are using a version of Magento that supports this change you probably have to make a change to your Authorize.Net account. Make sure you:
Get a new Authorize.Net signature key
Log into the Merchant Interface at https://account.authorize.net.
Click Account from the main toolbar.
Click Settings in the main left-side menu.
Click API Credentials & Keys.
Select New Signature Key. Review the options available.
Click Submit to continue.
Request and enter PIN for verification.
Your new Signature Key is displayed. Copy this key to add to your Magento Admin configuration.
Update your Magento configuration
Log into the Magento Admin.
On the Admin sidebar, click Stores. Then under Settings, click Configuration.
In the panel, click Sales then Payment Methods.
Expand the Authorize.net Direct Post section.
In the Signature Key enter the SHA-512 Signature Key.
Click Save Config.
Just worked through this same issue on 2.3.3. I ran into it after generating new keys for our development server using authorize.net's sandbox. Thought I might have generated the keys in the wrong order (per the answer by glsAdmin) but the generation times were in proper order. I debugged the transaction response and the necessary data was there (transHashSha2 was populated). So, what was wrong?
In my case it was resolved by regenerating the keys and checking the boxes "Disable Old Transaction Key Immediately" and "Disable Old Signature Key Immediately" when generating the new keys on Authorize.net.
We had exactly the same issue migrating from Magento1 to Magento2.3.1 specifically for the authorize.net conversion.
I made the mistake of going to authorize.net and creating a new signature BEFORE creating a new transaction key.
After much reading (and some help from https://www.solvature.us/) we discovered that the order of creation is just as important as the new creation of keys.
First create a new transaction key (remember, this may affect active integrations so be careful). Second, create the new signature.
Hope this helps.

IMAP "Invalid Credentials" via GMail XOAUTH

I'm trying to get into the IMAP server with OAuth, using the PHP Sample Code provided by Google which uses the Zend Imap class but I am failing to authenticate. Zend is giving me the error:
Zend_Mail_Storage_Exception [ Error ]: cannot select INBOX, is this a valid transport?
Annoyingly this is a rather confusing error message, for what is essentially "Invalid Credentials". How did I know that? By debugging the actual commands being send to the IMAP socket I see this:
string(44) "NO Invalid credentials ey9if1544983wid.142
"
I have tried with telnet and a Ruby gmail_xoauth gem which suggests it is not a code issue, but something else.
Looking at the most basic level of all this, I am getting commands like this:
TAG1 AUTHENTICATE XOAUTH R0VUIGh0dHBzOi8vbWFpbC5nb29nbGUuY29tL21h......etc
This is where I get NO Invalid credentials then:
TAG2 SELECT "INBOX"
This returns BAD Unknown command and kicks me out.
I have tried searching around for people having the same problem but I find only questions and no answers. There are a few similar StackOverflow questions:
One post shows somebody having the exact same problem in Python.
This post shows somebody trying to be awkward and do it with OAuth 2, with no report of success.
There is a thread on the GMail Google Group that suggests an "Invalid Credentials" error can be resolved by going to https://accounts.google.com/DisplayUnlockCaptcha for GMail accounts and https://www.google.com/a/[YOURDOMAIN.COM]/UnlockCaptcha if you are using Google Apps, but the latter just said that my username and password were wrong when they clearly were not. Using this https://accounts.google.com/DisplayUnlockCaptcha worked fine - even though my account is a hosted App, not plain old GMail - however I still get the same errors when trying to log back in with the PHP sample code provided by Google.
I've tried with various hosted Google App accounts and a plain GMail account. I've tried switching the IMAP server from imap.gmail.com to imap.googlemail.com, nothing makes any difference.
/**
* Make the IMAP connection and send the auth request
*/
$imap = new Zend_Mail_Protocol_Imap('imap.googlemail.com', '993', true);
$authenticateParams = array('XOAUTH', $initClientRequestEncoded);
$imap->requestAndResponse('AUTHENTICATE', $authenticateParams);
/**
* Print the INBOX message count and the subject of all messages
* in the INBOX
*/
$storage = new Zend_Mail_Storage_Imap($imap);
echo '<h1>Total messages: ' . $storage->countMessages() . "</h1>\n";
For those with an interest, this is the specific PHP code that sets up the connection, all XOauth is handled by Google's PHP in the same file but I skipped it.
I had this exact same error, and eventually realised I was using the wrong scope when requesting the OAuth permissions.
You need to have...
scope=https://mail.google.com/
access_type=offline
And also IMAP enabled in your Gmail account obviously. All seems good now.
One problem you may have is that the third parameter of Zend_Mail_Protocol_Imap('imap.googlemail.com', '993', true); should not be true. It should be a string, as either "SSL" or "TLS". I believe you want "SSL" if going over port 993. It's only a boolean when it is FALSE.
Try replacing that first line with this:
$imap = new Zend_Mail_Protocol_Imap('imap.googlemail.com', '993', 'SSL');
When i had this same error message, it was because
$options['consumerSecret'] = $THREE_LEGGED_CONSUMER_SECRET_HMAC;
I was doing that in a function and variable $THREE_LEGGED... wasn't in the scope. Pretty stupid and i'm sure that you'd have spotted that but just in case somebody new is reading that.