EPrints Technical Mailing List Archive

Message: #07461


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

Re: [EP-tech] eprints integration with office365 SMTP


On Fri, Aug 31, 2018 at 5:42 PM John Salter <J.Salter@leeds.ac.uk> wrote:
Hi John, Thanks for your reply.

> If I've followed this email thread properly, you have confirmed that you can send an email from the server via 'mail'.
> Was this as 'you' or as the EPrints user (have you tested both)?

Yes, I'm able to send emails both as francis@eprints.iisc.ac.in and
eprints@eprints.iisc.ac.in using 'mail' command.  However, postfix
sends these mails as eprints@iisc.ac.in because it has been configured
that way. Also, eprints@iisc.ac.in is a shared mailbox.

> This write-up:
> https://secopsmonkey.com/mail-relaying-postfix-through-office-365.html
> makes it sound like there may be some blocking of emails happening - EPrints will send the email from the 'adminemail' address (eprints@iisc.ac.in) - which >might not be allowed by the Office365 server.

Our Postfix configuration is similar to what has been explained in the
above article..

eprints@iisc.ac.in, which is the eprints admin email, is authorised to
send mails.

>
> If you try changing (temporarily) the adminemail address (normally in ~/archives/ARCHIVEID/cfg/cfg.d/adminemail.pl) to your own email address, and then send a test email, does the email get sent?

Yes, I have tried this option, too, but is doesn't help.
>
> The follow-up post to the above: https://secopsmonkey.com/better-mail-relaying-postfix-through-office-365.html might also be useful.

I will have to seek network administering team of our institute to try
the above option.

Thanks and regards, Francis
>
> Cheers,
> John
>
> -----Original Message-----
> From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Francis Jayakanth
> Sent: 31 August 2018 12:48
> To: eprints-tech@ecs.soton.ac.uk
> Subject: Re: [EP-tech] eprints integration with office365 SMTP
>
> Hi Enio, Thanks for the reply. Yes port 25 is open
>
>  netstat -napt | grep 127.0.0.1:25 doesn't find the pattern, but
> netstat -napt | grep 0.0.0.0:25 returns the following output:
>
> tcp        0      0 0.0.0.0:25              0.0.0.0:*
> LISTEN      106776/smtpd
>
> Also, I'm able to telnet to port 25:
>
> telnet 127.0.0.1 25
> Trying 127.0.0.1...
> Connected to 127.0.0.1.
> Escape character is '^]'.
> 220 localhost ESMTP Postfix
>
> Best regards, Francis
> On Thu, Aug 30, 2018 at 10:49 PM Enio Carboni <enio.carboni@gmail.com> wrote:
> >
> > Hi Francis,
> >
> > the problem seem to be in "Failed to create SMTP connection to localhost" found in https://github.com/eprints/eprints/blob/2d42b2be54004bf3db6881a6d893d39c7a7f909f/perl_lib/EPrints/Email.pm#L169
> >
> > EPrint use "my $smtp = Net::SMTP->new( $smtphost );" on line 166
> >
> > and defaut to port 25 on "$smtphost" (localhost).
> >
> > Is your postfix active on this port?
> >
> > netstat -napt | grep 127.0.0.1:25
> >
> >  Enio
> > Il 30/08/2018 17:22, Francis Jayakanth ha scritto:
> >
> > Hi, Thomas, thank very much for the kind reply.
> >
> > Yes, I have tried both  'smtp_server' => 'localhost' and 'smtp_server'
> > => 'eprints.iisc.ac.in' options, but the outcome is the same.
> >
> > Here is the corresponding web server log file extract"
> >
> > Failed to create SMTP connection to localhost
> > Failed to send mail.
> > To: francis@iisc.ac.in <>
> > Subject: Request for "Setting up Multilingual Information Repository:
> > A case Study with EPrints.org Software"
> >
> > No helpful hint from the maillog file, too. Here is the extract from
> > the /var/log/maillog file:
> >
> > Aug 30 13:13:35 eprints postfix/postfix-script[104689]: starting the
> > Postfix mail system
> > Aug 30 13:13:35 eprints postfix/master[104691]: daemon started --
> > version 2.10.1, configuration /etc/postfix
> > Aug 30 13:13:35 eprints postfix/pickup[104692]: EE3A2135D797: uid=0 from=<root>
> > Aug 30 13:13:35 eprints postfix/cleanup[104694]: EE3A2135D797:
> > message-id=<20180830074335.EE3A2135D797@localhost>
> > Aug 30 13:13:36 eprints postfix/qmgr[104693]: EE3A2135D797:
> > from=<eprints@iisc.ac.in>, size=510, nrcpt=1 (queue active)
> > Aug 30 13:13:36 eprints postfix/local[104696]: EE3A2135D797:
> > to=<root@localhost.localdomain>, orig_to=<root>, relay=local,
> > delay=53311, delays=53311/0.02/0/0.01, dsn=2.0.0, status=sent
> > (delivered to mailbox)
> > Aug 30 13:13:36 eprints postfix/qmgr[104693]: EE3A2135D797: removed
> > Aug 30 13:18:32 eprints postfix/postfix-script[105288]: stopping the
> > Postfix mail system
> > Aug 30 13:18:32 eprints postfix/master[104691]: terminating on signal 15
> > Aug 30 13:21:22 eprints postfix/postfix-script[105663]: starting the
> > Postfix mail system
> > Aug 30 13:21:22 eprints postfix/master[105665]: daemon started --
> > version 2.10.1, configuration /etc/postfix
> > Aug 30 14:19:13 eprints postfix/postfix-script[110740]: stopping the
> > Postfix mail system
> > Aug 30 14:19:13 eprints postfix/master[105665]: terminating on signal 15
> > Aug 30 14:19:13 eprints postfix/postfix-script[110822]: starting the
> > Postfix mail system
> > Aug 30 14:19:13 eprints postfix/master[110824]: daemon started --
> > version 2.10.1, configuration /etc/postfix
> > Aug 30 19:45:17 eprints postfix/smtpd[5469]: connect from localhost[127.0.0.1]
> > Aug 30 19:45:17 eprints postfix/smtpd[5469]: 24F61201F8D1:
> > client=localhost[127.0.0.1]
> > Aug 30 19:45:17 eprints postfix/smtpd[5469]: disconnect from
> > localhost[127.0.0.1]
> > Aug 30 19:45:17 eprints postfix/pickup[2911]: 66ABA135D797: uid=1003
> > from=<eprints@eprints.iisc.ac.in>
> > Aug 30 19:45:17 eprints postfix/cleanup[5471]: 66ABA135D797:
> > message-id=<alpine.LRH.2.21.1808301944160.5342@eprints.iisc.ac.in>
> > Aug 30 19:45:17 eprints postfix/qmgr[110826]: 66ABA135D797:
> > from=<eprints@iisc.ac.in>, size=655, nrcpt=1 (queue active)
> > Aug 30 19:45:19 eprints postfix/smtp[5474]: 66ABA135D797:
> > to=<fjayakanth@gmail.com>, relay=smtp.office365.com[40.100.141.2]:587,
> > delay=2.5, delays=0.3/0.04/1.9/0.26, dsn=2.6.0, status=sent (250 2.6.0
> > <alpine.LRH.2.21.1808301944160.5342@eprints.iisc.ac.in>
> > [InternalId=35716948034469,
> > Hostname=MA1PR0101MB1701.INDPRD01.PROD.OUTLOOK.COM] 3726 bytes in
> > 0.227, 16.006 KB/sec Queued mail for delivery)
> > Aug 30 19:45:19 eprints postfix/qmgr[110826]: 66ABA135D797: removed
> >
> > The maillog extract indicates that only mails sent using 'alpine' are
> > being logged.
> >
> > Thanks and regards, Francis
> >
> > On Thu, Aug 30, 2018 at 6:24 PM <th.lauke@arcor.de> wrote:
> >
> > Hi Francis,
> >
> > 'smtp_server' => 'smtp.office365.com'
> >
> > have you tried
> > 'smtp_server' => 'localhost'
> > instead?
> >
> > Are there any helpful messages in /var/log/exim4/mainlog?
> >
> > Hth
> > Thomas
> >
> > *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> > *** Archive: http://www.eprints.org/tech.php/
> > *** EPrints community wiki: http://wiki.eprints.org/
> > *** EPrints developers Forum: http://forum.eprints.org/
> >
> >
> > *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> > *** Archive: http://www.eprints.org/tech.php/
> > *** EPrints community wiki: http://wiki.eprints.org/
> > *** EPrints developers Forum: http://forum.eprints.org/
> *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive: http://www.eprints.org/tech.php/
> *** EPrints community wiki: http://wiki.eprints.org/
> *** EPrints developers Forum: http://forum.eprints.org/
>
> *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive: http://www.eprints.org/tech.php/
> *** EPrints community wiki: http://wiki.eprints.org/
> *** EPrints developers Forum: http://forum.eprints.org/