LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-15-2012, 07:22 AM   #1
sieuvocmaytinh
LQ Newbie
 
Registered: Aug 2012
Posts: 13

Rep: Reputation: Disabled
How to config fail2ban send email to gmail when it ban IP


I want to fail2ban send me a email when it ban ip (gmail/yahoo...)
I have to config postfix/sendmail?
or i have to config google smtp, gmail username/password.

sorry for my english

Last edited by sieuvocmaytinh; 08-15-2012 at 07:42 AM.
 
Old 08-15-2012, 07:33 AM   #2
sag47
Senior Member
 
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
Blog Entries: 36

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Configuring sendmail with gmail is fairly easy.
If you have 2-step verification enabled in gmail then you'll have to create an application-specific password.

Last edited by sag47; 08-16-2012 at 08:16 AM.
 
1 members found this post helpful.
Old 08-15-2012, 08:39 PM   #3
sieuvocmaytinh
LQ Newbie
 
Registered: Aug 2012
Posts: 13

Original Poster
Rep: Reputation: Disabled
in fail2ban, where am i config SMTP Server, accout/password?
I have to config sendmail/postfix relay via Gmail, and config fail2ban use sendmail/postfix?
 
Old 08-15-2012, 10:14 PM   #4
sag47
Senior Member
 
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
Blog Entries: 36

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Configure a mail client to use gmail (in my previous post I outlined configuring sendmail). Then once you have the mail client configured and successfully sending test emails then you should modify /etc/fail2ban/action.d/mail.conf and modify the commands to utilize the mail client.

So on the github page for mail.conf they use simply the mail command. You would need to change that mail command to sendmail (with sendmail specific options) or you would need to configure the mail command to work with gmail.

Other pages of documentation you could look at include
http://www.fail2ban.org/wiki/index.p...AL_0_8#Actions
http://www.fail2ban.org/wiki/index.php/HOWTOs
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] fail2ban does not ban, maybe my regex is wrong? JeanC Linux - Server 2 03-17-2011 10:01 AM
[SOLVED] Is it possible to send an email to abc123@gmail.com directly from Konsole? Robert.Thompson Slackware 15 03-03-2011 11:27 AM
help me with simple postfix config: send/receive email at one address anthony_go Linux - Server 3 08-31-2010 12:26 PM
[SOLVED] Fail2Ban failed to ban Attack on Asterisk, Why ? MET Linux - Security 10 05-27-2010 04:08 AM
fail2ban config questions spaceageliving Linux - Security 18 10-08-2009 09:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration