Difference between revisions of "DSpace/C2/Email-configuration-for-DSpace-on-Ubuntu-Linux-OS/English"

From Script | Spoken-Tutorial
Jump to: navigation, search
(Created page with "'''Script : Email Configuration for DSpace''' '''Author : Pankaj Patil''' '''Keywords: DSpace Rebuild, DSpace Email Configuration, dspace.cfg, Rebuild script, DSpace gmail...")
 
 
(10 intermediate revisions by 3 users not shown)
Line 9: Line 9:
  
  
{| style="border-spacing:0;width:16.51cm;"
+
{| border = “1”
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| '''Visual Cue'''
 
|| '''Visual Cue'''
 
|| '''Narration'''
 
|| '''Narration'''
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| Slide: Title
 
|| Slide: Title
 
|| Welcome to this '''Spoken Tutorial''' on '''Email Configuration for DSpace.'''
 
|| Welcome to this '''Spoken Tutorial''' on '''Email Configuration for DSpace.'''
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| Slide: Learning Objectives
 
|| Slide: Learning Objectives
|| In this tutorial, we will learn to * <div style="margin-left:1.27cm;margin-right:0cm;">Configure an '''email '''for '''DSpace'''</div>
+
|| In this tutorial, we will learn to  
* <div style="margin-left:1.27cm;margin-right:0cm;">Prepare a '''shell script''' to '''rebuild DSpace'''</div>
+
* <div style="margin-left:1.27cm;margin-right:0cm;">Send a '''test email''' from '''DSpace'''</div>
+
  
 
+
*Configure an '''email '''for '''DSpace'''
|- style="border:1pt solid #000000;padding:0.176cm;"
+
*Prepare a '''shell script''' to '''rebuild DSpace'''
 +
*Send a '''test email''' from '''DSpace'''
 +
|-  
 
|| Slide: System requirements
 
|| Slide: System requirements
|| This tutorial is recorded using* <div style="margin-left:1.27cm;margin-right:0cm;">'''Ubuntu Linux OS 18.04'''</div>
+
|| This tutorial is recorded using
* <div style="margin-left:1.27cm;margin-right:0cm;">'''DSpace version 6.3'''</div>
+
* <div style="margin-left:1.27cm;margin-right:0cm;">'''gedit text editor''' and</div>
+
* <div style="margin-left:1.27cm;margin-right:0cm;">'''Firefox web browser'''</div>
+
 
+
 
+
 
+
  
 +
*'''Ubuntu Linux OS 18.04'''
 +
*'''DSpace version 6.3'''
 +
*'''gedit text editor''' and
 +
*'''Firefox web browser'''
  
 
However you may use any other '''text editor''' or''' browser''' of your choice.
 
However you may use any other '''text editor''' or''' browser''' of your choice.
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| Slide: Pre-requisites
 
|| Slide: Pre-requisites
|| To practice this tutorial,* <div style="margin-left:1.27cm;margin-right:0cm;">You should have installed '''DSpace 6.3 '''and</div>
+
|| To practice this tutorial,
* <div style="margin-left:1.27cm;margin-right:0cm;">You should have a working internet connection.</div>
+
  
 
+
*You should have installed '''DSpace 6.3 '''and
|- style="border:1pt solid #000000;padding:0.176cm;"
+
*You should have a working internet connection.
 +
|-  
 
|| Slide: Pre-requisites
 
|| Slide: Pre-requisites
|| Pre-requisites:* <div style="margin-left:1.27cm;margin-right:0cm;">You should have familiarity with basic '''Linux commands'''.</div>
+
|| Pre-requisites:
* <div style="margin-left:1.27cm;margin-right:0cm;">If not then go through the prerequisite '''Linux '''tutorials on this website.</div>
+
  
 +
*You should have familiarity with basic '''Linux commands'''.
 +
*If not then go through the prerequisite '''Linux '''tutorials on this website.
  
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| Slide : Code files
 
|| Slide : Code files
|| * <div style="margin-left:1.27cm;margin-right:0cm;">The '''commands''' used in this tutorial are available in the '''Code Files '''link on this tutorial page.</div>
+
||  
 
+
*The '''commands''' used in this tutorial are available in the '''Code Files '''link on this tutorial page.
 
+
*Please download and extract the file before practicing.
 
+
|-  
* <div style="margin-left:1.27cm;margin-right:0cm;">Please download and extract the file before practicing.</div>
+
 
+
 
+
|- style="border:1pt solid #000000;padding:0.176cm;"
+
 
|| Switch to '''gedit''' text editor and open the file
 
|| Switch to '''gedit''' text editor and open the file
 
|| I have opened the '''code file''' in the '''gedit text editor''' on my machine.
 
|| I have opened the '''code file''' in the '''gedit text editor''' 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.
 
  
 
Shortcut to paste on the '''terminal''' is '''Shift, Ctrl '''and '''V '''keys'''.'''
 
Shortcut to paste on the '''terminal''' is '''Shift, Ctrl '''and '''V '''keys'''.'''
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| Slide : Necessity of Email Configuration
 
|| Slide : Necessity of Email Configuration
 
|| In '''DSpace''' we have to '''configure''' the '''email settings''' to send '''emails''' from '''DSpace'''.
 
|| In '''DSpace''' we have to '''configure''' the '''email settings''' to send '''emails''' from '''DSpace'''.
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| Slide : Necessity of Email Configuration
 
|| Slide : Necessity of Email Configuration
|| '''DSpace''' sends '''emails''' to the '''users''' for various activities such as * <div style="margin-left:1.27cm;margin-right:0cm;">'''Email verification''' during '''registration'''</div>
+
|| '''DSpace''' sends '''emails''' to the '''users''' for various activities such as
* <div style="margin-left:1.27cm;margin-right:0cm;">Notification '''emails''' during '''Item submission '''and''' review'''</div>
+
* <div style="margin-left:1.27cm;margin-right:0cm;">Getting '''Dspace user’s feedback '''and</div>
+
* <div style="margin-left:1.27cm;margin-right:0cm;">Notifications to '''Community and Collection''' subscribers</div>
+
  
 
+
*'''Email verification''' during '''registration'''
|- style="border:1pt solid #000000;padding:0.176cm;"
+
*Notification '''emails''' during '''Item submission '''and''' review'''
 +
*Getting '''Dspace user’s feedback '''and
 +
*Notifications to '''Community and Collection''' subscribers
 +
|-  
 
|| Only Narration
 
|| Only Narration
 
|| Let us begin.
 
|| Let us begin.
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| Press '''Ctrl+Alt+T '''keys
 
|| Press '''Ctrl+Alt+T '''keys
 
|| Open the '''terminal''' by pressing '''Ctrl, Alt '''and''' T''' keys simultaneously on the keyboard.
 
|| Open the '''terminal''' by pressing '''Ctrl, Alt '''and''' T''' keys simultaneously on the keyboard.
 
  
 
Ensure that you have '''root permissions''' to '''run''' the '''commands'''.
 
Ensure that you have '''root permissions''' to '''run''' the '''commands'''.
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| Only Narration
 
|| Only Narration
 
|| Here onwards, please remember to press the '''Enter''' key after typing each '''command'''.
 
|| Here onwards, please remember to press the '''Enter''' key after typing each '''command'''.
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| [Terminal] type:  
 
|| [Terminal] type:  
 
  
 
'''sudo su - dspace'''
 
'''sudo su - dspace'''
 
|| Now, we will '''login''' as '''user dspace'''.
 
|| Now, we will '''login''' as '''user dspace'''.
 
  
 
Type '''sudo su - dspace'''
 
Type '''sudo su - dspace'''
 
  
 
If prompted, then type the '''password '''of the''' admin user '''to '''login'''.
 
If prompted, then type the '''password '''of the''' admin user '''to '''login'''.
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| [Terminal] type:  
 
|| [Terminal] type:  
 
  
 
'''sudo gedit /home/dspace/dspace-6.3-src-release/dspace/config/dspace.cfg'''
 
'''sudo gedit /home/dspace/dspace-6.3-src-release/dspace/config/dspace.cfg'''
 
|| Type the '''command''' as shown to open '''dspace configuration '''file.
 
|| Type the '''command''' as shown to open '''dspace configuration '''file.
 
  
 
If prompted, type the '''root user password'''.
 
If prompted, type the '''root user password'''.
 
  
 
'''dspace.cfg '''file opens in the '''gedit text editor'''.  
 
'''dspace.cfg '''file opens in the '''gedit text editor'''.  
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| Point to '''Email settings'''
 
|| Point to '''Email settings'''
 
|| Scroll down and locate the '''Email settings''' section.
 
|| Scroll down and locate the '''Email settings''' section.
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| Slide:''' SMTP Services'''
 
|| Slide:''' SMTP Services'''
 
|| '''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.
 
Additionally, custom '''SMTP''' services can also be set up and used.
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| '''mail.server = smtp.gmail.com'''
 
|| '''mail.server = smtp.gmail.com'''
 
 
  
 
|| In this demonstration, I will configure a '''Gmail SMTP mail server.'''
 
|| 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'''
 
So, first I’ll set the value for '''mail.server''' as '''smtp.gmail.com'''
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| '''mail.server.username =dspace.u1@gmail.com'''
 
|| '''mail.server.username =dspace.u1@gmail.com'''
  
'''mail.server.password =d$pace2019*'''
+
'''mail.server.password =***********'''
 
|| Next we have to enter a valid '''gmail ID''' for '''mail.server.username.'''
 
|| Next we have to enter 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 [mailto:dspace.u1@gmail.com 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 [mailto:dspace.u1@gmail.com 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.
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| '''Comment '''
 
|| '''Comment '''
  
 
'''mail.server.port'''
 
'''mail.server.port'''
 
|| We will use''' gmail’s SMTP port (SSL): 465''', to connect to the '''SMTP server'''.
 
|| We will 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'''.  
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| From Address for mail
 
|| From Address for mail
 
|| 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'''
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| Feedback recipient email
 
|| Feedback recipient email
 
|| 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 those feedback will be sent to this '''email id'''.
 
If a '''user''' submits any feedback in '''DSpace''', then those 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'''
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| System administrator email
 
|| System administrator email
 
|| We have to give a valid '''email address''' for '''mail.admin.'''
 
|| 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 [mailto:dspace.u1@gmail.com dspace.u1@gmail.com] '''here.
+
|-  
|- style="border:1pt solid #000000;padding:0.176cm;"
+
 
|| '''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 '''mail.extraproperties.'''
 
Remove '''<nowiki># </nowiki>'''symbol at the beginning '''mail.extraproperties.'''
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| Remove # symbol
 
|| Remove # symbol
 
|| Also, remove''' # '''symbol at the beginning of the next two consecutive lines, as shown.
 
|| Also, remove''' # '''symbol at the beginning of the next two consecutive lines, as shown.
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| Save and close file
 
|| Save and close file
 
|| Save and close the file.
 
|| Save and close the file.
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| Slide : Rebuild '''DSpace'''
 
|| Slide : Rebuild '''DSpace'''
 
|| Whenever we customize '''DSpace''', it is necessary to '''rebuild''' '''DSpace'''.
 
|| Whenever we customize '''DSpace''', it is necessary to '''rebuild''' '''DSpace'''.
  
 
+
'''Rebuild''' process involves
'''Rebuild''' process involves* <div style="margin-left:1.27cm;margin-right:0cm;">Compilation of''' source code'''</div>
+
*Compilation of''' source code'''
* <div style="margin-left:1.27cm;margin-right:0cm;">Installation of '''Webapp'''</div>
+
*Installation of '''Webapp'''
* <div style="margin-left:1.27cm;margin-right:0cm;">Deployment of '''DSpace''' on '''Tomcat server'''.</div>
+
*Deployment of '''DSpace''' on '''Tomcat server'''.
 
+
 
+
 
+
 
+
  
 
We will prepare a''' shell script''' to '''rebuild''' '''DSpace''', and use it whenever required.
 
We will prepare a''' shell script''' to '''rebuild''' '''DSpace''', and use it whenever required.
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| [Terminal] type:  
 
|| [Terminal] type:  
  
 
'''sudo gedit $HOME/Rebuild-DSpace'''
 
'''sudo gedit $HOME/Rebuild-DSpace'''
 
|| Open a new file named '''Rebuild-DSpace '''in a '''text editor'''.  
 
|| Open a new file named '''Rebuild-DSpace '''in a '''text editor'''.  
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| [Terminal] type:  
 
|| [Terminal] type:  
  
 
+
'''sudo service tomcat8 stop’’’
'''sudo service tomcat8 stop'''
+
 
+
  
 
'''sleep 5'''
 
'''sleep 5'''
 
  
 
'''cd /home/dspace/dspace-6.3-src-release'''
 
'''cd /home/dspace/dspace-6.3-src-release'''
  
 
+
'''mvn -U clean package’’’
'''mvn -U clean package'''
+
 
+
  
 
'''cd /home/dspace/dspace-6.3-src-release/dspace/target/dspace-installer'''
 
'''cd /home/dspace/dspace-6.3-src-release/dspace/target/dspace-installer'''
 
  
 
'''ant update'''
 
'''ant update'''
 
  
 
'''sleep 5'''
 
'''sleep 5'''
 
  
 
'''sudo service tomcat8 start'''
 
'''sudo service tomcat8 start'''
 
|| Type the '''shell commands''' as shown in the '''text editor'''.
 
|| Type the '''shell commands''' as shown in the '''text editor'''.
 
  
 
We have used these '''commands''' in the earlier tutorial to '''build dspace'''.
 
We have used these '''commands''' in the earlier tutorial to '''build dspace'''.
  
 
+
|-  
 
+
|- style="border:1pt solid #000000;padding:0.176cm;"
+
 
|| Press Ctrl+S keys
 
|| Press Ctrl+S keys
 
|| Save and close the file.
 
|| Save and close the file.
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| [Terminal] type:  
 
|| [Terminal] type:  
 
  
 
'''sudo chmod 777 $HOME/Rebuild-DSpace'''
 
'''sudo chmod 777 $HOME/Rebuild-DSpace'''
 
|| Type the '''command''' as shown to provide '''executable permissions''' to '''Rebuild-DSpace.'''
 
|| Type the '''command''' as shown to provide '''executable permissions''' to '''Rebuild-DSpace.'''
 
  
 
If prompted, enter the''' admin password''' to proceed further.
 
If prompted, enter the''' admin password''' to proceed further.
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| [Terminal] type:  
 
|| [Terminal] type:  
  
 
'''$HOME/Rebuild-DSpace'''
 
'''$HOME/Rebuild-DSpace'''
 
|| Let us '''rebuild''' '''DSpace''' by typing the following '''command'''.
 
|| Let us '''rebuild''' '''DSpace''' by typing the following '''command'''.
 
  
 
The''' rebuild process''' may take some time depending upon your internet speed.
 
The''' rebuild process''' may take some time depending upon your internet speed.
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| [Terminal] Highlight
 
|| [Terminal] Highlight
 
  
 
'''BUILD SUCCESSFUL'''
 
'''BUILD SUCCESSFUL'''
 
|| On successful completion, '''BUILD SUCCESSFUL '''message will appear on the screen.  
 
|| On successful completion, '''BUILD SUCCESSFUL '''message will appear on the screen.  
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| Narration only
 
|| Narration only
 
|| This means we have '''deployed DSpace email configuration''' on '''Tomcat server.'''
 
|| This means we have '''deployed DSpace email configuration''' on '''Tomcat server.'''
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| 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 '''Gmail''' through '''DSpace''', '''less secure apps''' in '''Gmail''' '''settings''' should be turned '''ON'''.
To access '''gmail''' through '''DSpace''', '''less secure apps''' in '''gmail''' '''settings''' should be turned '''ON'''.
+
|-  
|- style="border:1pt solid #000000;padding:0.176cm;"
+
 
|| [browser] Login to gmail as dspace.u1@gmail.com
 
|| [browser] Login to gmail as dspace.u1@gmail.com
|| To do so, '''login''' to the respective '''gmail account''' which we have typed in the '''Email settings''' of '''DSpace'''.
+
|| To do so, '''login''' to the respective '''Gmail account''' which we have typed in the '''Email settings''' of '''DSpace'''.
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| [browser] Type the url:
 
|| [browser] Type the url:
  
Line 302: Line 248:
 
|| Then in the '''address bar''', type the '''URL '''as shown.
 
|| Then in the '''address bar''', type the '''URL '''as shown.
  
 
+
|-  
 
+
|- style="border:1pt solid #000000;padding:0.176cm;"
+
 
|| [browser] Turn the toggle on for Allow less secure apps
 
|| [browser] Turn the toggle on for Allow less secure apps
 
|| Turn '''ON '''the '''toggle '''button for '''Allow less secure apps.'''
 
|| Turn '''ON '''the '''toggle '''button for '''Allow less secure apps.'''
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| Only narration
 
|| Only narration
 
|| We have done the required '''configurations'''.
 
|| We have done the required '''configurations'''.
  
 
Now let us send a '''test mail'''.
 
Now let us send a '''test mail'''.
 
  
 
To do so, go to the '''terminal.'''
 
To do so, go to the '''terminal.'''
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| [Terminal] type:  
 
|| [Terminal] type:  
 
  
 
'''sudo $HOME/dspace-install/bin/dspace test-email'''
 
'''sudo $HOME/dspace-install/bin/dspace test-email'''
 
|| Then type this '''command''' to send a '''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.
 
'''Test email''' will be sent to the '''mail id '''which was set in '''mail.admin '''in '''dspace.cfg '''file.
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| [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 new mail.
 
Now check the '''Inbox''' for new mail.
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| [Browser] Point to the DSpace test mail
 
|| [Browser] Point to the DSpace test mail
 
|| Here is the '''DSpace test email.'''
 
|| Here is the '''DSpace test email.'''
 
  
 
We have successfully '''configured''' the '''mail configuration''' and also sent a '''test mail''' in '''DSpace'''.
 
We have successfully '''configured''' the '''mail configuration''' and also sent a '''test mail''' in '''DSpace'''.
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| Logout from gmail
 
|| Logout from gmail
|| Once done, '''sign out''' from the '''gmail account. '''
+
|| Once done, '''sign out''' from the '''Gmail account. '''
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| Only Narration
 
|| Only Narration
 
|| This brings us to the end of this tutorial.
 
|| This brings us to the end of this tutorial.
 
  
 
Let us summarize.
 
Let us summarize.
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| Slide Summary
 
|| Slide Summary
  
 +
|| In this tutorial we learnt to
 +
*Configure '''email''' for '''DSpace'''
 +
*Prepare a '''shell script''' to '''rebuild DSpace '''and
 +
*Sent '''test email''' from '''DSpace'''
  
 
+
|-  
|| In this tutorial we learnt to* <div style="margin-left:1.27cm;margin-right:0cm;">Configure '''email''' for '''DSpace'''</div>
+
* <div style="margin-left:1.27cm;margin-right:0cm;">Prepare a '''shell script''' to '''rebuild DSpace '''and</div>
+
* <div style="margin-left:1.27cm;margin-right:0cm;">Sent '''test email''' from '''DSpace'''</div>
+
 
+
 
+
|- style="border:1pt solid #000000;padding:0.176cm;"
+
 
|| Slide : About Spoken Tutorial project
 
|| Slide : About Spoken Tutorial project
 
|| The video at the following link summarises the '''Spoken Tutorial project.'''
 
|| The video at the following link summarises the '''Spoken Tutorial project.'''
 
  
 
Please download and watch it.
 
Please download and watch it.
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| Slide : Spoken Tutorial workshops
 
|| Slide : Spoken Tutorial workshops
 
 
  
 
|| The '''Spoken Tutorial Project''' team conducts workshops and gives certificates.
 
|| The '''Spoken Tutorial Project''' team conducts workshops and gives certificates.
 
  
 
For more details, please write to us.
 
For more details, please write to us.
|- style="background-color:#ffffff;border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| Slide: Answers for THIS Spoken Tutorial
 
|| Slide: Answers for THIS Spoken Tutorial
 
|| Please post your timed queries in this '''Forum'''.
 
|| Please post your timed queries in this '''Forum'''.
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| Slide: Acknowledgement -I
 
|| Slide: Acknowledgement -I
 
|| '''Spoken Tutorial project''' is funded by MHRD, Government of India.
 
|| '''Spoken Tutorial project''' is funded by MHRD, Government of India.
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| Slide: Acknowledgement -II
 
|| Slide: Acknowledgement -II
 
 
  
 
|| '''DSpace spoken tutorial''' series is funded by the National Virtual Library of India, Ministry of Culture, Government of India.
 
|| '''DSpace spoken tutorial''' series is funded by the National Virtual Library of India, Ministry of Culture, Government of India.
|- style="border:1pt solid #000000;padding:0.176cm;"
+
|-  
 
|| Narration only
 
|| Narration only
 
 
  
 
|| This script and video for this tutorial was contributed by '''Pankaj Patil''' from''' IIT Bombay.'''
 
|| This script and video for this tutorial was contributed by '''Pankaj Patil''' from''' IIT Bombay.'''
 
  
 
This is '''Nancy Varkey '''signing off. Thank you for joining.
 
This is '''Nancy Varkey '''signing off. Thank you for joining.
 
|-
 
|-
 
|}
 
|}

Latest revision as of 14:22, 7 January 2021

Script : Email Configuration for DSpace


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.
Slide: Learning Objectives In this tutorial, we will learn to
  • Configure an email for DSpace
  • Prepare a shell script to rebuild DSpace
  • Send a test email from DSpace
Slide: System requirements This tutorial is recorded using
  • Ubuntu Linux OS 18.04
  • DSpace version 6.3
  • gedit text editor and
  • Firefox web browser

However you may use any other text editor or browser of your choice.

Slide: Pre-requisites To practice this tutorial,
  • You should have installed DSpace 6.3 and
  • You should have a working internet connection.
Slide: Pre-requisites Pre-requisites:
  • You should have familiarity with basic Linux commands.
  • If not then go through the prerequisite Linux tutorials on this website.
Slide : Code files
  • The commands used in this tutorial are available in the Code Files link on this tutorial page.
  • Please download and extract the file before practicing.
Switch to gedit text editor and open the file I have opened the code file in the gedit text editor on my machine.

And I will use the same file to copy-paste the commands during the demonstration.

Shortcut to paste on the terminal is Shift, 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
  • Email verification during registration
  • Notification emails during Item submission and review
  • Getting Dspace user’s feedback and
  • Notifications to Community and Collection subscribers
Only Narration Let us begin.
Press Ctrl+Alt+T keys Open the terminal by pressing Ctrl, Alt and T keys simultaneously on the keyboard.

Ensure that you have root permissions to run the commands.

Only Narration Here onwards, please remember to press the Enter key after typing each command.
[Terminal] type:

sudo su - dspace

Now, we will login as user dspace.

Type sudo su - dspace

If prompted, then type the password of the admin user to login.

[Terminal] type:

sudo gedit /home/dspace/dspace-6.3-src-release/dspace/config/dspace.cfg

Type the command as shown to open dspace configuration file.

If prompted, type the root user password.

dspace.cfg file opens in the gedit text editor.

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.

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 enter 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.

Comment

mail.server.port

We will 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.

From Address for mail 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

Feedback recipient email Please type a valid email address for feedback.recipient

If a user submits any feedback in DSpace, then those feedback will be sent to this email id.

Here also I will type the value as dspace.u1@gmail.com

System administrator email 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 mail.extraproperties.

Remove # symbol Also, remove # symbol at the beginning of the next two consecutive lines, as shown.
Save and close file Save and close the file.
Slide : Rebuild DSpace Whenever we customize DSpace, it is necessary to rebuild DSpace.

Rebuild process involves

  • Compilation of source code
  • Installation of Webapp
  • Deployment of DSpace on Tomcat server.

We will prepare a shell script to rebuild DSpace, and use it whenever required.

[Terminal] type:

sudo gedit $HOME/Rebuild-DSpace

Open a new file named Rebuild-DSpace in a text editor.
[Terminal] type:

sudo service tomcat8 stop’’’

sleep 5

cd /home/dspace/dspace-6.3-src-release

mvn -U clean package’’’

cd /home/dspace/dspace-6.3-src-release/dspace/target/dspace-installer

ant update

sleep 5

sudo service tomcat8 start

Type the shell commands as shown in the text editor.

We have used these commands in the earlier tutorial to build dspace.

Press Ctrl+S keys Save and close the file.
[Terminal] type:

sudo chmod 777 $HOME/Rebuild-DSpace

Type the command as shown to provide executable permissions to Rebuild-DSpace.

If prompted, enter the admin password to proceed further.

[Terminal] type:

$HOME/Rebuild-DSpace

Let us rebuild DSpace by typing the following command.

The rebuild process may take some time depending upon your internet speed.

[Terminal] Highlight

BUILD SUCCESSFUL

On successful completion, BUILD SUCCESSFUL message will appear on the screen.
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 dspace.u1@gmail.com To do so, login to the respective Gmail account which we have typed in the Email settings of DSpace.
[browser] Type the url:

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.
Only narration We have done the required configurations.

Now let us send a test mail.

To do so, go to the terminal.

[Terminal] type:

sudo $HOME/dspace-install/bin/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 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.
Only Narration This brings us to the end of this tutorial.

Let us summarize.

Slide Summary In this tutorial we learnt to
  • Configure email for DSpace
  • Prepare a shell script to rebuild DSpace and
  • Sent test email from DSpace
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 MHRD, 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. Thank you for joining.

Contributors and Content Editors

Nancyvarkey, Pankajpatil694, Pravin1389