Using authsmtp from a Grails server

Posted by Simon on Stack Overflow See other posts from Stack Overflow or by Simon
Published on 2010-02-22T10:47:31Z Indexed on 2010/03/12 9:27 UTC
Read the original article Hit count: 324

Filed under:
|
|

This is quite a specific question, and I have had no luck on the grails nabble forum, so I thought I would post here. I am using the grails mail plug-in, but I think my question is a general one about using authsmtp as an email gateway from my server.

I am having trouble sending mail from my app using authsmtp. I have installed and configured the mail plugin and was originally using my ISP's SMTP server to send mails. However when I deployed to AWS EC2 this failed because my elastic IP was blocked by the SMTP host. So I bought myself an authsmtp account and set up my server email address as an accepted one at authsmtp.

I then changed my configuration in SecurityConfig.groovy to point to the authsmtp server that I had been designated...

   mailHost = "mail.authsmtp.com"
   mailUsername = "myusername"
   mailPassword = "mypassword"
   mailProtocol = "smtp"
   mailFrom = "[email protected]"
   mailPort = 2525

...and I'm just trying to get this to work locally before I deploy back up to AWS. Sending mail fails and in my log I have this exception:

2010-02-13 10:59:44,218 [http-8080-1] ERROR service.EmailerService  - Failed to send emails: Failed messages: com.sun.mail.smtp.SMTPSendFailedException: 513 5.0.0 Your email system must authenticate before sending mail.

org.springframework.mail.MailSendException; nested exception details (1) are:
Failed message 1:
com.sun.mail.smtp.SMTPSendFailedException: 513 5.0.0 Your email system must authenticate before sending mail. at
com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1388)
       at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:959)
       at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:583)

I'm a bit lost since the username and password I provide in the configuration are definitely correct.

A terse and not very helpful conversation with authsmtp support suggests that I need to MD5 and/or base64 encode my credentials before sending, so my question is in three parts...

1) any idea what's going on with the failure and why that message is appearing? 2) how would I encode the credentials to pass to authsmtp and how would I configure that for the mail plugin 3) has anyone successfully connected and sent mail through authsmtp from the mail plugin and specifically from AWS EC2?

© Stack Overflow or respective owner

Related posts about grails

Related posts about email