Re: zen.spamhaus.org
Noel, I have verified that is actually is working. My spam processor is saving the test message to the spam directory. I would guess that with your approach, the mail is not even accepted. How do I set it up to check in the in-protocol handler chain? I grep'd my james install for in-protocol but didn't find anything. -- Bud Noel J. Bergman wrote: I use zen.spamhaus.org, but I use it in the in-protocol handler chain, not the mailet pipeline. --- Noel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: zen.spamhaus.org
Are you referring to this block: handler class=org.apache.james.smtpserver.DNSRBLHandler rblservers whitelist query.bondedsender.org. /whitelist blacklist sbl-xbl.spamhaus.org. /blacklist blacklist dul.dnsbl.sorbs.net. /blacklist blacklist list.dsbl.org. /blacklist blacklist relays.ordb.org. /blacklist /rblservers /handler that is commented out in ../conf/james-smtphandlerchain.xml? Should I replace the various blacklist entries with zen.spamhaus.org? Any other black/white lists I should be looking at? If I enable this, do I need to do anything in my spool manager block? Thanks. -- Bud Bud Bach wrote: Noel, I have verified that is actually is working. My spam processor is saving the test message to the spam directory. I would guess that with your approach, the mail is not even accepted. How do I set it up to check in the in-protocol handler chain? I grep'd my james install for in-protocol but didn't find anything. -- Bud Noel J. Bergman wrote: I use zen.spamhaus.org, but I use it in the in-protocol handler chain, not the mailet pipeline. --- Noel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Access to attachment from Mailet
Hi Carl, Yes, it is possible to process a mail attachment from within a mailet. For example, in your matcher, you can check if your message content is an instance of MimeMultipart (assuming the incoming email is multipart MIME encoded), and use the javax.mail.internet.MimeBodyPart to check the type of attachment (using its getContentType()). Then in your mailet, you can do a similar thing and process the attachment as desired. Example code for matcher: public Collection match(Mail mail) throws MessagingException { if(mail.getMessage().getContent() instanceof MimeMultipart) { MimeMultipart multipart = (MimeMultipart) mail.getMessage().getContent(); // extract the MimeBodyParts and check for content type if required. } // if your desired condition is satisfied return mail.getRecipients(); } Hope this helps. Cheers, Sandeep -- http://sandeep.weblogs.us/ Carl Vorster wrote: Hi, Is it possible to access/process a mail attachment from a mailet, I can't seem to find anything to point me in the right direction. Thanks in advance Carl - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Access to attachment from Mailet
Carl, Here is some code from the service() routine of a mailet I use to grab jpg's from attachments: // Loop through the attachments // // Have a look at: // http://java.sun.com/developer/onlineTraining/JavaMail/contents.#GettingAttachments // for some tips on saving attachements. // try { MimeMessage msg = (MimeMessage) mail.getMessage(); Multipart mp = (Multipart) msg.getContent(); boolean imageFound = false; for (int j = 0, n = mp.getCount(); j n; j++) { Part part = mp.getBodyPart(j); String disposition = part.getDisposition(); String contentType = part.getContentType(); log(Content Type = + contentType + Disposition = + disposition); if (contentType.startsWith(image/jpeg)) { imageFound = true; saveImage(user, part); } } if (imageFound) { sendImageReceived(recipient, sender, user); } else { sendImageNotReceived(recipient, sender, user); } } catch (Exception e) { log(Error: , e); } Hope this helps. -- Bud Carl Vorster wrote: Hi, Is it possible to access/process a mail attachment from a mailet, I can't seem to find anything to point me in the right direction. Thanks in advance Carl - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Access to attachment from Mailet
I notice the link in the code is bad. It needs a html after the dot: http://java.sun.com/developer/onlineTraining/JavaMail/contents.html#GettingAttachments Bud Bach wrote: Carl, Here is some code from the service() routine of a mailet I use to grab jpg's from attachments: // Loop through the attachments // // Have a look at: // http://java.sun.com/developer/onlineTraining/JavaMail/contents.#GettingAttachments // for some tips on saving attachements. // try { MimeMessage msg = (MimeMessage) mail.getMessage(); Multipart mp = (Multipart) msg.getContent(); boolean imageFound = false; for (int j = 0, n = mp.getCount(); j n; j++) { Part part = mp.getBodyPart(j); String disposition = part.getDisposition(); String contentType = part.getContentType(); log(Content Type = + contentType + Disposition = + disposition); if (contentType.startsWith(image/jpeg)) { imageFound = true; saveImage(user, part); } } if (imageFound) { sendImageReceived(recipient, sender, user); } else { sendImageNotReceived(recipient, sender, user); } } catch (Exception e) { log(Error: , e); } Hope this helps. -- Bud Carl Vorster wrote: Hi, Is it possible to access/process a mail attachment from a mailet, I can't seem to find anything to point me in the right direction. Thanks in advance Carl - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]