james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eoin Andrew O'Kane" <eoinok...@e-merge.ie>
Subject RE: Added functionality to James
Date Tue, 09 Oct 2001 16:23:57 GMT
Also

do I need do define a processor "notification"

if so where ?

here is my mailet ,first attempt :)

public class ToSmsNotification extends GenericMailet
{
  String processor;
  String noticeText = null;

  public void init() throws MailetException
  {
    processor = getInitParameter("processor");
    if (processor == null)
    {
      throw new MailetException("processor parameter is required");
    }
    noticeText = getInitParameter("notice");
  }

  public void service(Mail mail) throws MessagingException
  {
   log("SmsNotification");
   log(processor);
   mail.setState(mail.GHOST);
   SendNotification myNotify = new SendNotification(mail);
   myNotify.send();
   if (noticeText != null)
   {
     if (mail.getErrorMessage() == null)
     {
       mail.setErrorMessage(noticeText);
     }
     else
     {
       mail.setErrorMessage(mail.getErrorMessage() + "\r\n" + noticeText);
     }
   }
 }

 public String getMailetInfo()
 {
   return "ToSmsNotification Mailet";
 }
}

-----Original Message-----
From: Eoin Andrew O'Kane [mailto:eoinokane@e-merge.ie]
Sent: 09 October 2001 13:05
To: james-dev@jakarta.apache.org
Subject: RE: Added functionality to James


Hello

I have taken a look at the mailets, the exact design of my solution is a
slight bastardisation of the James model.

What I hope to achieve is to have a SMTP daemon that will accept mail

1. Ensure its not spam
2. Pass the entire Mail object to a "ToSmsNotification" mailet
3. The ToSmsNotification mailet will then perform the sms deliver
4. mail is discarded

I do not intend to ever deliver the mail , although there is no reason when
completed that it would be possible to add the notification as an extra
mailet before the "ToProcessor" mailet.

To do this,

can I add my ToSmsNotification to the /bin/blocks/JAMES.jar ? if so how ?
jar -uvf ?

if I then add

<mailet match="All" class="ToSmsNotification">
	<processor>notification</processr>
</mailet>

to JAMES.conf.xml

will this pass the Mail object to the ToSmsNotification  mailet

I hope I have understood the James design.

regards

Eoin

-----Original Message-----
From: charles [mailto:charles]On Behalf Of Charles Benett
Sent: 08 October 2001 18:59
To: james-dev@jakarta.apache.org
Subject: Re: Added functionality to James


Eoin Andrew O'Kane wrote:
>
> Hello
>
> I am new to the list so please bear with me.
>
> I am currently developing an email to sms based notification server. I
have
> considered qmail as my mail server but I would prefer something totally in
> the Java environment, as my sms solution is a pure java one.
>
> Can additional functionality be incorporated into James that when a
message
> is delivered to the SMTP daemon, it can then be "processed".
> Where can I look at adding this functionality ?

This sounds like a great example of mailets.
You need two things:
1) A matcher to select which messages require sms notification - one of
the existing ones may work
2) A mailet to do the sms notification.
Look at existing stuff in org.apache.james.transport and sub-packages
for ideas.
If you can contribute copyright to Apache, I'm sure other people would
like this as well.
Regards,
Charles

>
> regards
>
> Eoin
>
> eoinokane@e-merge.ie
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-dev-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org


Mime
View raw message