Pages: [1]   Go Down
Author Topic: Attemtping to get gmail email server working with pandora  (Read 896 times)
0 Members and 1 Guest are viewing this topic.
opike
Full Member
***

Karma: 0
Offline Offline

Posts: 26


View Profile
« on: August 03, 2011, 08:00:15 PM »

I had originally opened a thread for this issue back in January:
http://openideas.info/smf/index.php/topic,2438.0.html
but it's been over 120 days since a reply has been made on that thread so the forum software suggested I open a new thread.  I was getting by with a different mail server since January but I no longer have access to that server so now I'm back to trying to use the gmail smtp server, with which I'm still having issues.

Regardless of what configuration I try, I get the following error message in /var/log/pandora/pandora_server.log:
2011-08-03 10:49:23 ubuntu [V1] [ERROR] Sending email to hastapasta99@gmail.com with subject [PANDORA] Alert from agent ubuntu on module perl ping hpdekstop

Here is how I think the mail server settings should be set up in pandora_server.conf:
Code:
mta_address smtp.gmail.com

# mta_port: MTA port (default 25)
mta_port 587

# mta_user MTA User (if needed for auth, FQD or simple user, depending on your server)
mta_user hastapasta99

# mta_pass MTA Pass (if needed for auth)
mta_pass xxxxxxxx

# mta_auth MTA Auth system (if needed, support: LOGIN, PLAIN, CRAM-MD5, DIGEST-MD)
mta_auth LOGIN

I tried all of the Auth system options but I still get the same error.

I have a java program that successfully uses the same gmail server for sending emails. Here's part of the java code:

Code:
String username = "hastapasta99";
String password = "xxxxxxx";

Properties props = new Properties();
props.put("mail.smtp.port","587");
props.put("mail.smtp.host", "smtp.gmail.com");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.debug", "false");
 
/*
 * Setting these timeout values since sending mail sometimes hangs.
*/
props.put("mail.smtp.timeout", 60000);
props.put("mail.smtp.connectiontimeout", 60000);


//Session session = Session.getInstance(props);
Session session = Session.getInstance(props,new MyPasswordAuthenticator(username, password));

I'm able to successfully telnet to smtp.gmail.com on port 587 from the box running pandora server so it's not a network connection or firewall issue (I have the firewall completely disabled).

I'm using pandora FMS version 3.2 on ubuntu.
Logged

tpalacios
Administrator
Sr. Member
*****

Karma: 8
Offline Offline

Posts: 190


The Game


View Profile
« Reply #1 on: August 04, 2011, 11:34:36 AM »

Greetings.

I had originally opened a thread for this issue back in January:
http://openideas.info/smf/index.php/topic,2438.0.html
but it's been over 120 days since a reply has been made on that thread so the forum software suggested I open a new thread.

My deepest regrets for that awful delay then. ;)

This kind of threads are starting to get on my nerves (not cause of you :P) because you're not the first one, and I doubt you'll be the last one who reports about this "external mta problem".

This is because I'm having a bad time trying to find out where's the problem in your case, because our team has already installed some Pandoras in our clients' machines using external mta configurations in pandora_server.conf without any problems.

I'll keep searching about it and will get back to you ASAP.
Logged

alumbreras
Sr. Member
****

Karma: 5
Offline Offline

Posts: 108


View Profile
« Reply #2 on: August 05, 2011, 01:54:50 PM »

Hi opike

you can try to create a new action implemented in java that the work of these .jar is to send an email alert. you can pass the subject and the body of the email by parameter in the jar.

sorry for my english ;), i hope that you understand me.


Logged

cwmoser
Jr. Member
**

Karma: 0
Offline Offline

Posts: 13


View Profile
« Reply #3 on: August 20, 2011, 11:28:17 AM »


How do you enable SSL or TLS in Pandora?
All I can find that Pandora supports are LOGIN, PLAIN, CRAM-MD5, and DIGEST-MD.

SSL or TLS is required to use gmail.

Carl
Logged

gbr
Jr. Member
**

Karma: 0
Offline Offline

Posts: 11


View Profile
« Reply #4 on: September 05, 2011, 02:44:18 PM »

Hello,

This is how I have configured PandoraFMS to work with gmail (on Ubuntu):

Modify Pandora config file.
You can do this by executing the command:
sudo nano /etc/pandora/pandora_server.conf

Setup the mail settings:
Because we have installed a local SMTP server, we only need to set up the connection to this mail server:

# mta_address: External Mailer (MTA) IP Address to be used by Pandora FMS internal email capabilities
mta_address localhost

# mta_port: MTA port (default 25)
#mta_port

# mta_user MTA User (if needed for auth, FQD or simple user, depending on your server)
#mta_user

# mta_pass MTA Pass (if needed for auth)
#mta_pass

# mta_auth MTA Auth system (if needed, support: LOGIN, PLAIN, CRAM-MD5, DIGEST-MD)
#mta_auth

# mta_from Email address that sends the mail, by default is pandora@localhost
#           probably you need to change it to avoid problems with your antispam
mta_from Network Monitor Administrator <noreply@xxx.xxx>

Configure local mailserver EXIM4

http://wiki.debian.org/GmailAndExim4

Apply a filter, so the mails come from noreply@xxx.xxx
Create a file by executing the command:
sudo nano /etc/exim4/filter_reply_to
with the following content:
# Exim filter

# Rewrite my reply to for any mail sent to xxx.xxx@gmail.com

if
        $header_from: contains "Network Monitor Administrator"
then
        headers remove "Reply-To"
        headers add "Reply-To: noreply@xxx.xxx"
        headers add "From: noreply@xxx.xxx"
endif

# Forward any mail sent to root

if
        $header_to: contains "root"
then
        headers remove "Reply-To"
        headers add "Reply-To: noreply@xxx.xxx"
        headers remove "To"
        headers add "To: xxx@xxx.com"
        deliver "yourmailadress@xxx.com"
endif

Adjust also the exim4 config file:
sudo nano /etc/exim4/exim4.conf.template
Add here the line
system_filter = /etc/exim4/filter_reply_to
And restart now the mail service:
sudo service exim4 restart

If you have problems with sending mails, you can check the logs:
sudo tail /var/log/mail.log

Greetings,

Geert
Logged

Manuel Arostegui
Global Moderator
Expert member
*****

Karma: 50
Offline Offline

Posts: 853



View Profile
« Reply #5 on: September 09, 2011, 09:47:10 AM »

Hi,

What happens if you run: echo "body test" | mail -s "test" your@email.com

Do you get the email?
Logged

rich.anderson
Newbie
*

Karma: 0
Offline Offline

Posts: 4


View Profile
« Reply #6 on: October 11, 2011, 08:48:17 PM »

Thank you.  Following the gmail instructions for our local MTA fixed an issue we were having.
Logged

fadosani
Spammer
Newbie
*

Karma: -65535
Offline Offline

Posts: 4


View Profile
« Reply #7 on: October 18, 2011, 12:43:08 PM »

seems to be a very valuable information. thanks to all
Logged

Pages: [1]   Go Up
Print
 
Jump to:  


SourceForge.net Logo  This site is monitored by Pandora FMS   ArticaST