Hi

On further investigation changing the test script a little bit so it ended up looking like below there are now now errors anymore with regards to the missing module in INC.

Now it is just

root@XXXXXXXXXX ~ #./perl_test_email_gmail.pl
Could not connect to mail server

So it looks like it is not just some PERL incorrect configuration issue. :(

Any help would be greatly appreciated.


Regards
Kenneth Thorman


#!/usr/bin/perl
use lib '/vol/otrs/Kernel/cpan-lib'; #***************************************** Added line
use Net::SMTP::SSL;

my $fromEmail = 'XXXXXXXXXXXXXXXXXXXx';
my $emailPassword = 'XXXXXXXXXXXXx';
my $toEmail = 'XXXXXXXXXXXXXXXXX';
 
my $text = 'Some email message without fancy formatting!';
my $html = '<b>Some email message with fancy html formatting!!</b>';
 
my $smtp;
if (not $smtp = Net::SMTP::SSL->new('smtp.gmail.com',
                                     Port => 465,
                                     Debug => 1)) {
   die "Could not connect to mail server\n";
}
 
$smtp->auth($fromEmail, $emailPassword) || die "Authentication failed!\n";
 
$smtp->mail($fromEmail . "\n");
my @recepients = split(/,/, $toEmail);
foreach my $recp (@recepients) {
    $smtp->to($recp . "\n");
}
 
$smtp->data();
$smtp->datasend("From: " . $fromEmail . "\n");
$smtp->datasend("To: " . $toEmail . "\n");
$smtp->datasend("Subject: " . $subject . "\n");
$smtp->datasend("MIME-Version: 1.0\n");
$smtp->datasend("Content-Type: multipart/alternative; boundary=\"$boundary\"\n");
$smtp->datasend("\n--$boundary\n");
$smtp->datasend("Content-Type: text/plain; charset=iso-8859-1\n");
$smtp->datasend("Content-Transfer-Encoding: quoted-printable\n");
$smtp->datasend($text . "\n\n");
$smtp->datasend("\n--$boundary\n");
$smtp->datasend("Content-Type: text/html; charset=iso-8859-1\n");
$smtp->datasend("Content-Transfer-Encoding: quoted-printable\n");
$smtp->datasend($html . "\n");
$smtp->dataend();
$smtp->quit;



On Mon, Apr 12, 2010 at 11:48 AM, Kenneth Thorman <kenneth.thorman@appinux.com> wrote:
Looking into the perldoc perllocal I find this

       Sun Nov  1 00:39:48 2009: "Module" Net::SSLeay
       ?   "installed into: /usr/lib/perl5/site_perl/5.8.8"
       ?   "LINKTYPE: dynamic"
       ?   "VERSION: 1.30"
       ?   "EXE_FILES: "


When I try to make a simple command line batch perl program like


#!/usr/bin/perl
use Net::SMTP::SSL;

my $fromEmail = 'XXXXXXXXXXXXXXx';
my $emailPassword = 'XXXXXXXXXXXXXXx';
my $toEmail = 'XXXXXXXXXXXXx';
 
my $text = 'Some email message without fancy formatting!';
my $html = '<b>Some email message with fancy html formatting!!</b>';
 
my $smtp;
if (not $smtp = Net::SMTP::SSL->new('smtp.gmail.com',
                                     Port => 465,
                                     Debug => 1)) {
   die "Could not connect to mail server\n";
}
 
$smtp->auth($fromEmail, $emailPassword) || die "Authentication failed!\n";
 
$smtp->mail($fromEmail . "\n");
my @recepients = split(/,/, $toEmail);
foreach my $recp (@recepients) {
    $smtp->to($recp . "\n");
}
 
$smtp->data();
$smtp->datasend("From: " . $fromEmail . "\n");
$smtp->datasend("To: " . $toEmail . "\n");
$smtp->datasend("Subject: " . $subject . "\n");
$smtp->datasend("MIME-Version: 1.0\n");
$smtp->datasend("Content-Type: multipart/alternative; boundary=\"$boundary\"\n");
$smtp->datasend("\n--$boundary\n");
$smtp->datasend("Content-Type: text/plain; charset=iso-8859-1\n");
$smtp->datasend("Content-Transfer-Encoding: quoted-printable\n");
$smtp->datasend($text . "\n\n");
$smtp->datasend("\n--$boundary\n");
$smtp->datasend("Content-Type: text/html; charset=iso-8859-1\n");
$smtp->datasend("Content-Transfer-Encoding: quoted-printable\n");
$smtp->datasend($html . "\n");
$smtp->dataend();
$smtp->quit;




I get this output

Can't locate Net/SMTP/SSL.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at ./perl_test_email_gmail.pl line 2.
BEGIN failed--compilation aborted at ./perl_test_email_gmail.pl line 2.


I guess this is the reason for things not working?

Regards
Kenneth Thorman

On Mon, Apr 12, 2010 at 11:30 AM, Kenneth Thorman <kenneth.thorman@appinux.com> wrote:
Hi Marcus

Do you see anything obviously wrong in the below output?

Could there be some incompatibilities between the different CPAN modules?

Regards
Ken


On Mon, Apr 12, 2010 at 10:42 AM, Kenneth Thorman <kenneth.thorman@appinux.com> wrote:
This is the output from the command

root@XXXXXXXX /vol/otrs/bin #openssl s_client -host smtp.gmail.com  -port 465
CONNECTED(00000003)
depth=0 /C=US/ST=California/L=Mountain View/O=Google Inc/CN=smtp.gmail.com
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 /C=US/ST=California/L=Mountain View/O=Google Inc/CN=smtp.gmail.com
verify error:num=27:certificate not trusted
verify return:1
depth=0 /C=US/ST=California/L=Mountain View/O=Google Inc/CN=smtp.gmail.com
verify error:num=21:unable to verify the first certificate
verify return:1
---
Certificate chain
 0 s:/C=US/ST=California/L=Mountain View/O=Google Inc/CN=smtp.gmail.com
   i:/C=ZA/ST=Western Cape/L=Cape Town/O=Thawte Consulting cc/OU=Certification Services Division/CN=Thawte Premium Server CA/emailAddress=premium-server@thawte.com
---
Server certificate
-----BEGIN CERTIFICATE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rwbE1E6pVuQaZJY33ILpt8IfzwVf2TGQI+M5yazZ2fC
xwArHo20iAss3MLQR8tDXWfBoH2Lk9BBsEKDRP4hp83yfpZgdY3pinHTCbqHpsiS
v97epiiFBA==
-----END CERTIFICATE-----
subject=/C=US/ST=California/L=Mountain View/O=Google Inc/CN=smtp.gmail.com
issuer=/C=ZA/ST=Western Cape/L=Cape Town/O=Thawte Consulting cc/OU=Certification Services Division/CN=Thawte Premium Server CA/emailAddress=premium-server@thawte.com
---
No client certificate CA names sent
---
SSL handshake has read 1017 bytes and written 315 bytes
---
New, TLSv1/SSLv3, Cipher is RC4-MD5
Server public key is 1024 bit
Compression: NONE
Expansion: NONE
SSL-Session:
    Protocol  : TLSv1
    Cipher    : RC4-MD5
    Session-ID: 05D147DEFDC2F6B10F47D15EC98B42539BD95BEB13F977A2116C49292DEAFBAD
    Session-ID-ctx:
    Master-Key: A2D70CF49308FC90EC4B82CD1C5EA094F88C909880C73C6B7B71EF9C36C3F446A3BA8F0C1E6C71795155E1F116A1F99D
    Key-Arg   : None
    Krb5 Principal: None
    Start Time: 1271061102
    Timeout   : 300 (sec)
    Verify return code: 21 (unable to verify the first certificate)
---
220 mx.google.com ESMTP t2sm65868gve.19




Now after starting to work the commands

EHLO
250-mx.google.com at your service, [79.125.6.100]
250-SIZE 35651584
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH
250-ENHANCEDSTATUSCODES
250 PIPELINING
MAIL FROM:XXXXXXXXXXXXx
530-5.5.1 Authentication Required. Learn more at
530 5.5.1 http://mail.google.com/support/bin/answer.py?answer=14257 q9sm74150gve.14

....

So I can connect as far as I can see

Regards
Ken



On Mon, Apr 12, 2010 at 10:26 AM, Markus Esche <markus.esche@otrs.com> wrote:
Hi Kenneth,

On 12.04.2010, at 10:21, Kenneth Thorman wrote:
> Config Options: Framework -> Core::Sendmail
> SendmailModule: SMTPS
> SendmailModule::Host: smtp.gmail.com
> SendmailModule::Port: 465
> SendmailModule::AuthUser: XXXXXX@XXXXX.com (a valid username)
> SendmailModule::AuthPassword: XXXXXXXXXXXX  (corresponding password to username above)

Could you try the following command:
$ openssl s_client -host smtp.gmail.com -port 465
to get a valid SSL connection to gmail?

And if have SMTP connection up, what if you try authenticate with your
credentials via the openssl prompt?

hth,
Markus

--

Markus Esche
Customer Development


OTRS AG
Europaring 4
94315 Straubing
Deutschland

T: +49 (0) 9421 56818 0
F: +49 (0) 9421 56818 18
I:   http://www.otrs.com/

Geschäftssitz: Bad Homburg
Amtsgericht: Bad Homburg, HRB 10751
Steuernummer: 003 240 97505
Aufsichtsratsvorsitzender: Burchard Steinbild
Vorstand: André Mindermann (Vorsitzender), Martin Edenhofer

---------------------------------------------------------------------
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs

NEW! ENTERPRISE SUBSCRIPTION - Get more information NOW!
http://www.otrs.com/en/support/enterprise-subscription/