Thank you very much for this info. I followed the instructions and did everything I could, but it is still not working for me.
1. I am using James as my local mail server(smtp and pop3) and the version is 2.3.2. The SMTP and POP3 works fine to me on my local dell window machine.
2. TrackStudio can send out email from my local SMTP server to any recipient without any problem.
3. But the ticket is not created after I send an email to one designated mailbox "fcai@localhost". I registered user "fcai" in both James mail and Track Studio. The user fcai can create a task on the folder of TrackStudio which I set the email import rule for.
4. My email config in trackstudio.mail.property is like this:
trackstudio.sendMail yes
mail.transport.protocol smtp
mail.smtp.host localhost
mail.smtp.port 25
mail.from Postmaster@localhost
mail.smtp.user Postmaster
mail.smtp.password pass
mail.smtp.timeout 10000
mail.smtp.connectiontimeout 10000
trackstudio.FormMailNotification yes
mail.store.protocol pop3
mail.store.host localhost
mail.store.port 110
mail.store.user Postmaster@localhost
mail.store.forward yes
mail.store.fwdaddress fcai@localhost
mail.debug true
5. Email Import Rule setting
Name Create Task through Email
Keyword (regular expression) BUILD:
In Subject
Order 1
Allowed Domains
Task Properties Parent Task Build Request
Category Build Request
User Import Properties Owner fcai
6. Test code to send the email:
String user = "fcai";
String password = "pass"; // user password
String from = "Postmaster@localhost"; // newlycreateduser@localhost
// Create a mail session
Properties properties = new Properties();
properties.put("mail.smtp.host", "localhost");
properties.put("mail.transport.protocol", "smtp");
properties.put("mail.smtp.port", "25");
properties.put("mail.smtp.username", user);
properties.put("mail.smtp.password", password);
Session session = Session.getDefaultInstance(properties, null);
try
{
InternetAddress[] addrs = new InternetAddress[2];
addrs[0] = new InternetAddress("fcai@localhost");
addrs[1] = new InternetAddress("fcai@foreverliving.com");
Message msg = new MimeMessage(session);
msg.setFrom(new InternetAddress(from));
msg.setRecipients(Message.RecipientType.TO, addrs);
msg.setSubject("BUILD:Test to create a ticket");
msg.setText("I am here");
Transport.send(msg);
System.out.println("Email sent successfully");
}
catch (MessagingException e)
{
e.printStackTrace();
}