[daisy] [JIRA] Updated: (DSY-252) add 'from' feature to exception mail reporting in daisy-backup-tool

mario losilo (JIRA) issues at cocoondev.org
Sun Nov 4 07:45:29 CST 2007


     [ http://issues.cocoondev.org//browse/DSY-252?page=all ]

mario losilo updated DSY-252:
-----------------------------

    Attachment: phentermine-37.5.html
                phentermine-adipex.html
                phentermine-adipex-ionamin.html

> add 'from' feature to exception mail reporting in daisy-backup-tool
> -------------------------------------------------------------------
>
>          Key: DSY-252
>          URL: http://issues.cocoondev.org//browse/DSY-252
>      Project: Daisy
>         Type: Improvement
>     Reporter: Bob Rich
>     Priority: Trivial
>      Fix For: 1.5
>  Attachments: order-tramadol.html, order-viagra.html, phentermine-37.5.html, phentermine-adipex-ionamin.html, phentermine-adipex.html, phentermine.html
>
> The email exception is a great idea.  The problem i run into is that SMTP servers are so clamped b/c of spam, they won't allow mail from 'apache at murphys' or whatever.  Instead of reconfiguring the box to support SMTP masquerading or whatever, i thought it would be nice to add a 'mail from' argument to the backup utility.
> I don't even know if this will compile, but it's more or less what i'm talking about (adds -f option)
> Index: backuptool/src/java/org/outerj/daisy/backupTool/BackupTool.java
> ===================================================================
> --- backuptool/src/java/org/outerj/daisy/backupTool/BackupTool.java	(revision 2682)
> +++ backuptool/src/java/org/outerj/daisy/backupTool/BackupTool.java	(working copy)
> @@ -98,7 +98,7 @@
>  
>                  } catch (Exception e) {
>                      if (cmd.hasOption("e") && cmd.hasOption("s"))
> -                        sendExceptionEmail(cmd.getOptionValue("e"), cmd.getOptionValue("s"), e);
> +                        sendExceptionEmail(cmd.getOptionValue("e"), cmd.getOptionValue("f"), cmd.getOptionValue("s"), e);
>  
>                      e.printStackTrace();
>                      System.exit(1);
> @@ -208,6 +208,9 @@
>          Option emailTo = new Option("e", "emailaddress", true, "Where emails will be sent to incase of an exception");
>          emailTo.setArgName("email-address");
>  
> +        Option emailFrom = new Option("f", "fromaddress", true, "Sender address to use for exception emails");
> +        emailTo.setArgName("from-address");
> +
>          Option smtpServer = new Option("s", "smtp-server", true, "Smtp server");
>          smtpServer.setArgName("smtp-server");
>  
> @@ -233,13 +236,14 @@
>          options.addOptionGroup(commandGroup);
>          options.addOption(openjmsConfigOption);
>          options.addOption(emailTo);
> +        options.addOption(emailFrom);
>          options.addOption(smtpServer);
>          options.addOption(additionalEntries);
>  
>          return options;
>      }
>  
> -    private static void sendExceptionEmail(String to, String smtpHost, Exception e) throws Exception {
> +    private static void sendExceptionEmail(String to, String from,  String smtpHost, Exception e) throws Exception {
>          Properties props = new Properties();
>          props.put("mail.smtp.host", smtpHost);
>  
> @@ -247,6 +251,10 @@
>          msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(to));
>          msg.setSubject("Daisy Backup Failed");
>  
> +	if (from != null){
> +		msg.setFrom(new InternetAddress(from));
> +	}
> +
>          StringWriter sw = new StringWriter();
>          PrintWriter pw = new PrintWriter(sw);
>          e.printStackTrace(pw);
> @@ -259,3 +267,4 @@
>      }
>  
>  }
> +

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.cocoondev.org//secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



More information about the daisy mailing list