You can send a message to multiple recipients without including the other
recipients in the headers.  Email client software will call it BCC, and if
you're generating the SMTP message yourself, you do whatever you want
(message headers can be completely unrelated to delivery information, hence
the difficulties in stopping spammers)

Serge Knystautas
Loki Technologies
http://www.lokitech.com/
----- Original Message -----
From: "Labib Iskander, Marcus" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 03, 2001 2:49 PM
Subject: AW: Disabling javax.mail.SendFailedException: 552 Too many receipts


Hi Nick,

please excuse my question, but wouldn't you normally want to send to only
one recipient at a time, instead of telling the people every single address
which recieved the same message? Not to mention the waste of transfer
bandwidth sending an email whichs header is bigger than the body.
You could use some mailinglist tool. I am not used to the mailinglist tools
of james (certainly there is some cool way to use them) but with a mailet
you could implement it easily.
You just send to a single email address which will be processed by the
mailet:
<mailet match="RecipientIs='[EMAIL PROTECTED]'" class="MyList">
                        <mailinglist>list1</mailinglist>
</mailet>

The mailet shoud look like this (analog to the
org.apache.james.transport.mailets.Forward mailet):

package mymailets;

import org.apache.mailet.*;
import java.util.*;
import javax.mail.*;
import javax.mail.internet.*;

public class MyList extends GenericMailet {

    private String mailinglist;

    public void init() throws MessagingException {
        mailinglist = getMailetConfig().getInitParameter("mailinglist");
    }

    private MailAddress [] getRecipients(String listName) {
        // your code
    }

    public void service(Mail mail) throws MessagingException {
  MailAddress [] recipients = getRecipents(mailinglist);
  for (int i=0;i<recipients.length;i++) {
        getMailetContext().sendMail(mail.getSender(), recipients[i],
mail.getMessage());
        }
        mail.setState(Mail.GHOST);
    }

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


Dont forget to include this in the spoolmanager element
<mailetpackages>
    <mailetpackage>mymailets.</mailetpackage>

<mailetpackage>org.apache.james.transport.mailets.</mailetpackage>
</mailetpackages>

And take care that the transport processor is configured to send mail from
the mailaddress your webapplication is using to the outside, because the
MailetContext.sendMail() passes the mail directly to the transport
processor.

Greetings,
  Marcus

-----Urspr�ngliche Nachricht-----
Von: Nick [mailto:[EMAIL PROTECTED]]
Gesendet: Montag, 3. September 2001 19:24
An: [EMAIL PROTECTED]
Betreff: Disabling javax.mail.SendFailedException: 552 Too many receipts


Hi,

I am trying to set up an application where I need to be able to mail
thousands of people from our database via a web interface. My problem has
been sending over 100 emails at a time where I get the 552 message. Is there
a way to disable this feature in James so that I can send my emails?

Thanks,

Stefan



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to