Changeset 31729
- Timestamp:
- 2017-06-12T11:56:25+12:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/BerryBasket.java
r30820 r31729 556 556 password = GlobalProperties.getProperty("mail.smtp.password"); 557 557 String from = GlobalProperties.getProperty("mail.from"); 558 558 String port = GlobalProperties.getProperty("mail.smtp.port"); 559 String mail_security = GlobalProperties.getProperty("mail.security"); 559 560 String mailer = "msgsend"; 560 561 … … 580 581 } 581 582 583 584 if (port != null && !port.trim().equals("")) { 585 props.put("mail.smtp.port", port); 586 } 587 588 if (mail_security != null) { 589 mail_security = mail_security.trim(); 590 if (mail_security.equals("ssl")) { 591 props.put("mail.smtp.ssl.enable", "true"); 592 } else if (mail_security.equals("tls")) { 593 props.put("mail.smtp.starttls.enable", "true"); 594 } 595 else if (mail_security.equals("")) { 596 logger.error("unknown security protocol "+mail_security +", should be ssl or tls"); 597 } 598 } 599 600 // this doesn't seem to matter having this when 601 // username and password are empty 602 props.put("mail.smtp.auth", "true"); 603 582 604 //setup username and password to the smtp server 605 583 606 if (username == null || username.trim().equals("")) 584 607 username = ""; 585 608 if (password == null || password.trim().equals("")) 586 609 password = ""; 610 587 611 Authenticator auth = new Authenticator() 588 612 { … … 619 643 catch (Exception e) 620 644 { 621 e.printStackTrace(); 622 result.appendChild(result_doc.createTextNode(e.getMessage())); 645 logger.error("Error sending mail!"); 646 e.printStackTrace(); 647 result.appendChild(result_doc.createTextNode(e.getMessage())); 623 648 } 624 649
Note:
See TracChangeset
for help on using the changeset viewer.