문제

I'm using a local Apache James 2.3.2 install for development and automated testing. It's configured to forward all incoming messages to a single address and to not relay emails outside:

     <mailet match="All" class="Forward">
        <forwardto>test@localhost</forwardto>
     </mailet>

Everything works correctly: emails are accepted, placed in the spool directory, then finally moved to the inbox/test directory, from which they are then picked up by my automated tests for verification.

The only problem is, it can take anywhere between 10 and 60 seconds for those emails to be moved from the spool directory to the inbox/test directory, meaning the tests need to wait that long before retrieving them and doing their checks.

Is this something that can be configured otherwise? Or should I simply move to a different email server for testing purposes?

Thanks!

도움이 되었습니까?

해결책

Not a direct answer to this question, but I've ended up switching to JES http://www.ericdaugherty.com/java/mailserver/ . You can configure how many SMTP and POP3 threads do the work as well as the frequency at which these threads pick up messages from the spool and try to send deliver them

# The server stores incoming SMTP messages on disk before attempting to deliver them.  This
# setting determines how often (in seconds) the server checks the disk for new messages to deliver.  The
# smaller the number, the faster message will be processed.  However, a smaller number will cause
# the server to use more of your system's resources.
smtpdelivery.interval=5

This meets my needs.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top