Difference between revisions of "DSpace/C2/Email-Configuration-for-DSpace-on-Windows-OS/English"
(Created page with "'''Script : Email Configuration for DSpace on Windows''' '''Author : Pankaj Patil''' '''Keywords: DSpace Rebuild, DSpace Email Configuration, dspace.cfg, Rebuild script, DSp...") |
Pravin1389 (Talk | contribs) |
||
(One intermediate revision by one other user not shown) | |||
Line 42: | Line 42: | ||
|- | |- | ||
|| Switch to '''WordPad''' and open the file | || Switch to '''WordPad''' and open the file | ||
− | || I have opened the '''commands file''' in | + | || I have opened the '''commands file''' in '''WordPad '''on my machine. |
And I will use the same file to copy-paste the '''commands''' during the demonstration. | And I will use the same file to copy-paste the '''commands''' during the demonstration. | ||
+ | |||
The shortcut to paste on the '''Command Prompt '''is''' Ctrl '''and '''V '''keys'''.''' | The shortcut to paste on the '''Command Prompt '''is''' Ctrl '''and '''V '''keys'''.''' | ||
|- | |- | ||
Line 75: | Line 76: | ||
|| '''DSpace '''requires '''SMTP service''' to send and receive '''emails.''' | || '''DSpace '''requires '''SMTP service''' to send and receive '''emails.''' | ||
'''SMTP services''' like '''Gmail, SendinBlue, SendGrid, Pepipost, Amazon SES '''or '''Mandrill''' can be used. | '''SMTP services''' like '''Gmail, SendinBlue, SendGrid, Pepipost, Amazon SES '''or '''Mandrill''' can be used. | ||
+ | |||
Additionally, custom '''SMTP''' services can also be set up and used as well. | Additionally, custom '''SMTP''' services can also be set up and used as well. | ||
|- | |- | ||
Line 85: | Line 87: | ||
|| Next we have to give a valid '''gmail ID''' for '''mail.server.username.''' | || Next we have to give a valid '''gmail ID''' for '''mail.server.username.''' | ||
I will use the '''admin’s mail id''', which is '''dspace.u1@gmail.com''' | I will use the '''admin’s mail id''', which is '''dspace.u1@gmail.com''' | ||
+ | |||
You can also use the same '''email id''' which you gave as your '''admin mail id'''. | You can also use the same '''email id''' which you gave as your '''admin mail id'''. | ||
+ | |||
The value for '''mail.server.password '''has to be the '''password''' of dspace.u1@gmail.com.''' | The value for '''mail.server.password '''has to be the '''password''' of dspace.u1@gmail.com.''' | ||
+ | |||
The typed '''password''' will be visible to everyone. | The typed '''password''' will be visible to everyone. | ||
+ | |||
So I have blurred it for this demonstration. | So I have blurred it for this demonstration. | ||
|- | |- | ||
Line 94: | Line 100: | ||
| | We will now use''' gmail’s SMTP port (SSL): 465''', to connect to the '''SMTP server'''. | | | We will now use''' gmail’s SMTP port (SSL): 465''', to connect to the '''SMTP server'''. | ||
So, let us disable the default '''SMTP port''' which is 25. | So, let us disable the default '''SMTP port''' which is 25. | ||
+ | |||
To do so, type '''<nowiki># </nowiki>'''in front of the line '''mail.server.port'''. | To do so, type '''<nowiki># </nowiki>'''in front of the line '''mail.server.port'''. | ||
|- | |- | ||
Line 100: | Line 107: | ||
|| Now, give a valid '''email address''' for '''mail.from.address.''' | || Now, give a valid '''email address''' for '''mail.from.address.''' | ||
This '''email id''' will be considered as the '''from address''' for the recipients. | This '''email id''' will be considered as the '''from address''' for the recipients. | ||
+ | |||
Here I will type the value as '''dspace.u1@gmail.com''' | Here I will type the value as '''dspace.u1@gmail.com''' | ||
|- | |- | ||
Line 105: | Line 113: | ||
'''feedback.recipient=dspace.u1@gmail.com''' | '''feedback.recipient=dspace.u1@gmail.com''' | ||
|| Please type a valid''' email address''' for '''feedback.recipient''' | || Please type a valid''' email address''' for '''feedback.recipient''' | ||
+ | |||
If a '''user''' submits any feedback in '''DSpace''', then their feedback will be sent to this '''email id'''. | If a '''user''' submits any feedback in '''DSpace''', then their feedback will be sent to this '''email id'''. | ||
+ | |||
Here also I will type the value as '''dspace.u1@gmail.com''' | Here also I will type the value as '''dspace.u1@gmail.com''' | ||
|- | |- | ||
Line 111: | Line 121: | ||
'''mail.admin=dspace.u1@gmail.com''' | '''mail.admin=dspace.u1@gmail.com''' | ||
|| Next, we have to give a valid '''email address''' for '''mail.admin.''' | || Next, we have to give a valid '''email address''' for '''mail.admin.''' | ||
+ | |||
'''System notifications '''and '''administration emails''' will be sent to '''mail.admin address'''. | '''System notifications '''and '''administration emails''' will be sent to '''mail.admin address'''. | ||
+ | |||
I will type the value as '''dspace.u1@gmail.com '''here. | I will type the value as '''dspace.u1@gmail.com '''here. | ||
|- | |- | ||
|| '''Mail.extraproperties >> '''remove # symbol | || '''Mail.extraproperties >> '''remove # symbol | ||
|| Next, we will '''configure''' the''' SMTP port''' '''(SSL): 465.''' | || Next, we will '''configure''' the''' SMTP port''' '''(SSL): 465.''' | ||
+ | |||
Scroll down and locate the line '''<nowiki>#mail.extraproperties.</nowiki>''' | Scroll down and locate the line '''<nowiki>#mail.extraproperties.</nowiki>''' | ||
+ | |||
Remove '''<nowiki># </nowiki>'''symbol at the beginning of '''mail.extraproperties.''' | Remove '''<nowiki># </nowiki>'''symbol at the beginning of '''mail.extraproperties.''' | ||
|- | |- | ||
Line 134: | Line 148: | ||
|- | |- | ||
|| Open '''Wordpad''' | || Open '''Wordpad''' | ||
− | || So, | + | || So, open '''Wordpad.''' |
|- | |- | ||
|| [Wordpad] type: | || [Wordpad] type: | ||
Line 164: | Line 178: | ||
|- | |- | ||
|| Click on dropdown of '''Save as type -> Text Documents ''' | || Click on dropdown of '''Save as type -> Text Documents ''' | ||
− | || Click on the '''Save as type '''dropdown | + | || Click on the '''Save as type '''dropdown and select the '''type''' as '''Text Documents.''' |
|- | |- | ||
|| Enter File name | || Enter File name | ||
Line 210: | Line 224: | ||
|| Narration only | || Narration only | ||
|| Next we have to '''configure''' some '''settings''' in the '''Gmail account''' which we have used. | || Next we have to '''configure''' some '''settings''' in the '''Gmail account''' which we have used. | ||
− | To access ''' | + | To access '''Gmail''' through '''DSpace''', '''less secure apps''' in '''Gmail settings''' should be turned '''ON'''. |
|- | |- | ||
|| [browser] Login to gmail as Email: dspace.u1@gmail.com | || [browser] Login to gmail as Email: dspace.u1@gmail.com | ||
Password: ********* | Password: ********* | ||
− | || To do so, '''login''' to the respective ''' | + | || To do so, '''login''' to the respective '''Gmail account''' which you had typed in the '''Email settings''' of '''DSpace'''. |
|- | |- | ||
|| [browser] Type the url: | || [browser] Type the url: | ||
Line 253: | Line 267: | ||
| | [Browser] Open the gmail account | | | [Browser] Open the gmail account | ||
| | Let us cross-verify this. | | | Let us cross-verify this. | ||
+ | |||
Switch to the '''browser''' where our '''mail account''' is '''logged''' in. | Switch to the '''browser''' where our '''mail account''' is '''logged''' in. | ||
+ | |||
Now check the '''Inbox''' for the new mail. | Now check the '''Inbox''' for the new mail. | ||
|- | |- | ||
Line 261: | Line 277: | ||
|- | |- | ||
| | Logout from gmail | | | Logout from gmail | ||
− | | | Once done, '''sign out''' from the ''' | + | | | Once done, '''sign out''' from the '''Gmail account. ''' |
|- | |- | ||
| | Close the '''command prompt''' | | | Close the '''command prompt''' |
Latest revision as of 23:19, 13 January 2021
Script : Email Configuration for DSpace on Windows
Author : Pankaj Patil
Keywords: DSpace Rebuild, DSpace Email Configuration, dspace.cfg, Rebuild script, DSpace gmail configuration,
Visual Cue | Narration |
Slide: Title | Welcome to this Spoken Tutorial on Email Configuration for DSpace on Windows OS. |
Slide: Learning Objectives | In this tutorial, we will learn to
|
Slide: System requirements | This tutorial is recorded using
However you may use any other text editor or browser of your choice. |
Slide: Pre-requisites | To practice this tutorial,
|
Slide: Pre-requisites |
|
Slide : Code files |
|
Switch to WordPad and open the file | I have opened the commands file in WordPad on my machine.
And I will use the same file to copy-paste the commands during the demonstration. The shortcut to paste on the Command Prompt is Ctrl and V keys. |
Slide: Necessity of Email Configuration | In DSpace we have to configure the email settings to send emails from DSpace. |
Slide : Necessity of Email Configuration | DSpace sends emails to the users for various activities such as
|
Only Narration | Let us begin. |
Browse C Drive >> dspace-6.3-src-release >> dspace >> config | In the file browser, go to C Drive.
Browse and navigate to the config folder in dspace-6.3-src-release as shown. |
Open dspace.cfg with Wordpad | Open the configuration file dspace.cfg in WordPad editor. |
Point to dspace.cfg in WordPad | dspace.cfg file is now open in WordPad. |
Point to Email settings | Scroll down and locate the Email settings section. |
Slide: SMTP Services | DSpace requires SMTP service to send and receive emails.
SMTP services like Gmail, SendinBlue, SendGrid, Pepipost, Amazon SES or Mandrill can be used. Additionally, custom SMTP services can also be set up and used as well. |
mail.server = smtp.gmail.com | In this demonstration, I will configure a Gmail SMTP mail server.
So, first I’ll set the value for mail.server as smtp.gmail.com |
mail.server.username =dspace.u1@gmail.com
mail.server.password =******** |
Next we have to give a valid gmail ID for mail.server.username.
I will use the admin’s mail id, which is dspace.u1@gmail.com You can also use the same email id which you gave as your admin mail id. The value for mail.server.password has to be the password of dspace.u1@gmail.com. The typed password will be visible to everyone. So I have blurred it for this demonstration. |
Type # in front of the line
mail.server.port |
We will now use gmail’s SMTP port (SSL): 465, to connect to the SMTP server.
So, let us disable the default SMTP port which is 25. To do so, type # in front of the line mail.server.port. |
Set from Address of the email recipients
mail.from.address = dspace.u1@gmail.com |
Now, give a valid email address for mail.from.address.
This email id will be considered as the from address for the recipients. Here I will type the value as dspace.u1@gmail.com |
Set Feedback recipient email address
feedback.recipient=dspace.u1@gmail.com |
Please type a valid email address for feedback.recipient
If a user submits any feedback in DSpace, then their feedback will be sent to this email id. Here also I will type the value as dspace.u1@gmail.com |
Set email address for mail admin
mail.admin=dspace.u1@gmail.com |
Next, we have to give a valid email address for mail.admin.
System notifications and administration emails will be sent to mail.admin address. I will type the value as dspace.u1@gmail.com here. |
Mail.extraproperties >> remove # symbol | Next, we will configure the SMTP port (SSL): 465.
Scroll down and locate the line #mail.extraproperties. Remove # symbol at the beginning of mail.extraproperties. |
Remove # symbol | Also, remove # symbol at the beginning of the next two consecutive lines, as shown. |
Save and close file | Then, save and close the file. |
Slide : Rebuild DSpace | Whenever we customize DSpace, it is necessary to rebuild DSpace.
Rebuild process involves
We will prepare a Batch file to rebuild DSpace, and use it whenever required. |
Open Wordpad | So, open Wordpad. |
[Wordpad] type:
call cd C:\Program Files\Apache Software Foundation\Tomcat 8.5\bin call Tomcat8.exe stop call cd C:\dspace-6.3-src-release call mvn -U clean package call cd C:\dspace-6.3-src-release\dspace\target\dspace-installer call ant fresh_install call cd C:\Program Files\Apache Software Foundation\Tomcat 8.5\bin call Tomcat8.exe start |
And type the commands as shown.
We have used these commands in the earlier tutorial to build dspace. |
Press Ctrl+S keys | Save the file by pressing Ctrl + S keys together.
A dialog box to save the file appears. |
Select Desktop location to save file | On the left, select Desktop as a location to save the file. |
Click on dropdown of Save as type -> Text Documents | Click on the Save as type dropdown and select the type as Text Documents. |
Enter File name
Rebuild-DSpace.bat |
In the File name field, type the name as Rebuild-DSpace.bat. |
Narration only | .bat extension indicates that it is a batch file. |
Click on Save button | Click on the Save button. |
Point to Dialog box | A dialog box opens to confirm this save. |
Click Yes button | Click on the Yes button. |
Close Rebuild-DSpace.bat file | Close Rebuild-DSpace.bat file. |
Narration only | Now let us rebuild DSpace using the Rebuild-DSpace.bat file. |
Go to the Desktop
Right click on Rebuild-DSpace >> Run as Administrator |
Go to the Desktop and locate the file Rebuild-DSpace.
Then right-click on it and select Run as Administrator. |
Click on yes | If prompted, click on the Yes button in the User Account Control dialog box. |
Point to Command Prompt | The Command Prompt opens and the process of DSpace rebuild begins. |
Point to BUILD SUCCESSFUL message | On successful completion, BUILD SUCCESSFUL message will appear on the Command Prompt. |
Show closing of Command Prompt | After the rebuild process, the Command Prompt closes automatically. |
Narration only | This means we have deployed DSpace email configuration on Tomcat server. |
Narration only | Next we have to configure some settings in the Gmail account which we have used.
To access Gmail through DSpace, less secure apps in Gmail settings should be turned ON. |
[browser] Login to gmail as Email: dspace.u1@gmail.com
Password: ********* |
To do so, login to the respective Gmail account which you had typed in the Email settings of DSpace. |
[browser] Type the url:
https://www.google.com/settings/security/lesssecureapps https://www.google.com/settings/security/lesssecureapps |
Then in the address bar type the URL as shown. |
[browser] Turn the toggle on for Allow less secure apps | Turn ON the toggle button for Allow less secure apps. |
Open new tab in the browser | Open a new tab in the browser. |
[browser] Type https://accounts.google.com/DisplayUnlockCaptcha | Enter the URL as shown to configure google account’s access to DSpace. |
Click the Continue button | Click the Continue button. |
Close tab for Less secure app access and google account access tab | Close the tab for Less secure app access and google account access. |
Only narration | We have now done the required configurations.
Next let us send a test mail. |
Open the Command Prompt. | To do so, open the Command Prompt. |
[Command Prompt] Type:
cd C:\dspace\bin |
Using cd command switch the present working directory to dspace bin. |
[Command Prompt] type:
dspace test-email |
Then type this command to send a test email.
Test email will be sent to the mail id which was set in mail.admin in dspace.cfg file. |
[Browser] Open the gmail account | Let us cross-verify this.
Switch to the browser where our mail account is logged in. Now check the Inbox for the new mail. |
[Browser] Point to the DSpace test mail | Here is the DSpace test email.
We have successfully configured the mail configuration and also sent a test mail in DSpace. |
Logout from gmail | Once done, sign out from the Gmail account. |
Close the command prompt | And close the command prompt. |
Slide: Troubleshoot Email Errors | If you didn’t receive the email then check the following.
|
Only Narration | This brings us to the end of this tutorial.
Let us summarize. |
Slide Summary | In this tutorial, we learnt to
|
Slide : About Spoken Tutorial project | The video at the following link summarises the Spoken Tutorial project.
Please download and watch it. |
Slide : Spoken Tutorial workshops | The Spoken Tutorial Project team conducts workshops and gives certificates.
For more details, please write to us. |
Slide: Answers for THIS Spoken Tutorial | Please post your timed queries in this Forum. |
Slide: Acknowledgement -I | Spoken Tutorial project is funded by Ministry of Education (MoE), Government of India. |
Slide: Acknowledgement -II | DSpace spoken tutorial series is funded by the National Virtual Library of India, Ministry of Culture, Government of India. |
Narration only | This script and video for this tutorial was contributed by Pankaj Patil from IIT Bombay.
This is Nancy Varkey signing off. Thanks for joining. |