create new tag
, view all tags

SID-02308: Cannot send email with SMTP

Status: Answered Answered TWiki version: 6.0.2 Perl version: v5.10.1
Category: CategoryEmail Server OS: CentOS 7 Last update: 10 months ago

I have configure my twiki using SMTP for EMail. But it is failed to send email. Following message is shown when I want to reset my password.

TWiki.ERROR: Can't send mail using Net::SMTP. Can't connect to 'smtp.mysite.com' at /var/www/twiki/lib/TWiki/Net.pm line 665. %PARAM2% %PARAM3% %PARAM4%

But I am sure that I can ping this smtp server successfully.

My Configure setting is:

{EnableEmail} true
{WebMasterEmail} wikimaster@mysite.com
{WebMasterName} XXXXXXXX
{MailProgram}  /usr/sbin/sendmail -t -oi -oeq  // default value
{SMTP}{MAILHOST} smtp.mysite.com
{SMTP}{Username} wikimaster@mysite.com
{SMTP}{Password} mypassword

all other fields about email are blanks.

Can you help to find something reasons ? Thanks.

-- Tony Lu - 2017-03-19

Discussion and Answer

You can get more information by configuring your TWiki with the expert option {SMTP}{Debug}. This usually helps a lot to get the exact reason why sending mail fails. So far, I have just one guess:Your {SMTP}{Username} should be your mysite account and not your mail address - maybe just omit the @mysite.com?

-- Harald Jörg - 2017-03-19

Or, possibly your mail server requires TLS? See SMTPUseTLS

Also, if the smtp server is company internal you likely do not need to authenticate to send e-mail, e.g. empty {SMTP}{Username} and {SMTP}{Password}

-- Peter Thoeny - 2017-03-19

Finally, I got the reason about it. It should be configured to allow connect network and send email by execute command: setsebool httpd_can_sendmail=1 setsebool httpd_can_network_connect=1

-- Tony Lu - 2017-03-20

      Change status to:
ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
Status Answered
Title Cannot send email with SMTP
SupportCategory CategoryEmail
TWiki version 6.0.2
Server OS CentOS 7
Web server Apache/2.2.15 (Unix)
Perl version v5.10.1
Browser & version

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2017-03-20 - TonyLu
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.