You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Michael Herrmann (Commented) (JIRA)" <se...@james.apache.org> on 2011/10/03 14:42:34 UTC

[jira] [Commented] (JAMES-1317) Mail spooled but not processed

    [ https://issues.apache.org/jira/browse/JAMES-1317?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13119271#comment-13119271 ] 

Michael Herrmann commented on JAMES-1317:
-----------------------------------------

The problem also occurs in the latest snapshot release of 3.0-beta4, revision 1177179. 

Maybe a little code will help. I have one non-standard mailet, AliasingMailet, in mailetcontainer.xml:

...
<processor state="transport" enableJmx="true">
      <mailet match="SMTPAuthSuccessful" class="SetMimeHeader">
        <name>X-UserIsAuth</name>
        <value>true</value>
      </mailet>
      <mailet match="All" class="our.company.AliasingMailet"/>
...

Here is its service() method:

public void service(Mail mail) throws MessagingException {
	MailAddress from = new MailAddress((InternetAddress) mail.getMessage().getFrom()[0]);
	MailAddress to = new MailAddress((InternetAddress) mail.getMessage().getRecipients(Message.RecipientType.TO)[0]);
	if (to.getDomain().equals(mailserverConfiguration.getDefaultDomain())) {
		Conversation conversation = conversationService.getConversation(mail);

		InternetAddress[] recipients = conversation.getAliasB().getRecipients();
		logger.info("Rewriting recipients of mail " + mail.getMessage().getSubject() + " to " + Arrays.asList(recipients));
		mail.getMessage().setRecipients(Message.RecipientType.TO, recipients);

		String newFrom = conversation.getAliasA() + "@" + mailserverConfiguration.getDefaultDomain();
		logger.info("Rewriting sender of mail " + mail.getMessage().getSubject() + " from " + from + " to " + newFrom + ".");
		mail.getMessage().setFrom(new InternetAddress(newFrom));

		getMailetContext().sendMail(mail.getMessage());
		mail.setState(Mail.GHOST);
	} else if (!from.getDomain().equals(mailserverConfiguration.getDefaultDomain())) {
		String newFrom = conversationService.getConversation(mail).getAliasA().toString() + "@" + mailserverConfiguration.getDefaultDomain();
		logger.info("Rewriting sender of mail " + mail.getMessage().getSubject() + " from " + from + " to " + newFrom + ".");
		mail.getMessage().setFrom(new InternetAddress(newFrom));
	}
}

The Spring bean conversationService is autowired and uses James's JPA-infrastructure to persist/load Conversations. The problem occurs (stochastically) when I bombard the server with 50 concurrent SMTP-requests. 

We want to use James to handle email conversations of all users of our portal for classified ads and expect about 1.500.000 mails/month. If this problem cannot be solved we will have to downgrade to version 2.3.2 :(
                
> Mail spooled but not processed
> ------------------------------
>
>                 Key: JAMES-1317
>                 URL: https://issues.apache.org/jira/browse/JAMES-1317
>             Project: JAMES Server
>          Issue Type: Bug
>          Components: SpoolManager & Processors
>    Affects Versions: 3.0-M1, 3.0-M2, 3.0-beta3
>            Reporter: Raju Buchi
>            Priority: Critical
>             Fix For: 3.0-beta4
>
>         Attachments: Dump.txt, jstack.zip
>
>
> Mails sent to James server are spooled but they are not processed and sent out.
> The issue is similar to the one faced by Zach.
> The server seems to be working fine for a few hours or few days, but some time all the mails are spooled but they will not be processed and sent out. Restarted the server several times and some time a few of the mails will be processed and all the others are lost.
> As Norman suggested I have took a jstack trace. 
> Please let me how we can resolve this issue
> Thanks
> - Raju

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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