pady-geazy
Fri, 13 Nov 2009 08:27:46 -0800
I got it to work by setting a name for the sender in commons-email and then setting the "From:" header...
email.setFrom("pady at appdomain dot com", "padysrini at gmail dot com" );
email.addHeader("From:", "padysrini at gmail dot com");
MSN does complain about spoofing but atleast it gets delivered.
Thanks, Norman and Stefano.
-- pady
----- Original Message -----
From: "pady-geazy" <p...@geazy.com>
To: "James Users List" <server-user@james.apache.org> Sent: Friday, November 13, 2009 9:28 PM Subject: Re: simple beginner question...
Hi Norman,I tried this also. I still get the error...I am not setting the headers correctly...i tried these combinations and I searched for typical smtp headers...email.addHeader("From", info.fromAddress); email.addHeader("FROM", info.fromAddress); email.addHeader("MAIL FROM", info.fromAddress); email.addHeader("From:", info.fromAddress); email.addHeader("Mail From:", info.fromAddress); 235 Authentication Successful DEBUG SMTP: use8bit false MAIL FROM:<padysrini at gmail dot com> 250 2.1.0 Sender <padysrini at gmail dot com> OK RCPT TO:<padysrini at hotmail dot com> 503 5.7.1 Incorrect Authentication for Specified Email Address DEBUG SMTP: Invalid AddressesDEBUG SMTP: "padysrini at hotmail dot com" <padysrini at hotmail dot com>DEBUG SMTP: Sending failed because of invalid destination addresses RSET 250 2.0.0 OK javax.mail.SendFailedException: Invalid Addresses; nested exception is:com.sun.mail.smtp.SMTPAddressFailedException: 503 5.7.1 Incorrect Authentication for Specified Email Addresspady----- Original Message ----- From: "Norman Maurer" <norman.mau...@googlemail.com>To: "James Users List" <server-user@james.apache.org> Sent: Friday, November 13, 2009 8:47 PM Subject: Re: simple beginner question...Hi Pady, yeah just use the address you want in "MAIL FROM" and FROM header. Bye, Norman 2009/11/13 pady-geazy <p...@geazy.com>:Hi Stefano, I can send emails. Just that it allows only from addresses that have 'appdomain dot com'. I do have authentication enabled. Just that it onlyallows 'appdomain dot com' sender addresses alone. I was wondering if it is possible to continue to use authentication, send email as 'app at appdomain dot com' but spoof the send address after authentication to 'user at gmaildot com'. pady ----- Original Message ----- From: "Stefano Bagnara" <apa...@bago.org> To: "James Users List" <server-user@james.apache.org> Sent: Friday, November 13, 2009 1:33 PM Subject: Re: simple beginner question... either you enable authentication for James (and use it from your client) or you add the client IP to the <authorizedAddresses> configuration. Stefano 2009/11/13 pady-geazy <p...@geazy.com>:Hi Norman, Thanks for your reply. I tried setting the "from" address alone to my gmailaccount. And tried to use my server ( with the credentials ) to send mail.But it fails with this exception - Here is the debug log output: DEBUG SMTP: connected to host "mail.geazy.com", port: 25 EHLO padydev 250-PRABHA Hello padydev ... 250-AUTH LOGIN PLAIN 250-AUTH=LOGIN PLAIN 250-PIPELINING 250 ENHANCEDSTATUSCODES DEBUG SMTP: Found extension "AUTH", arg "LOGIN PLAIN" DEBUG SMTP: Found extension "AUTH=LOGIN", arg "PLAIN" DEBUG SMTP: Found extension "PIPELINING", arg "" DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg "" DEBUG SMTP: Attempt to authenticate AUTH LOGIN ... .. ... 235 Authentication Successful DEBUG SMTP: use8bit false MAIL FROM:<padysrini at gmail dot com> 250 2.1.0 Sender <padysrini at gmail dot com>OK RCPT TO: <padysrini at hotmail dot com> 503 5.7.1 Incorrect Authentication for Specified Email Address DEBUG SMTP: Invalid AddressesDEBUG SMTP: "padysrini at hotmail dot com"<padysrini at hotmail dot com>DEBUG SMTP: Sending failed because of invalid destination addresses RSET 250 2.0.0 OK javax.mail.SendFailedException: Invalid Addresses; nested exception is: com.sun.mail.smtp.SMTPAddressFailedException: 503 5.7.1 Incorrect Authentication for Specified Email Address at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1294) at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:635) at javax.mail.Transport.send0(Transport.java:189) at javax.mail.Transport.send(Transport.java:118) at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1128) at org.apache.commons.mail.Email.send(Email.java:1163) at com.geazy.frames.server.utils.ServerUtils.sendHtmlEmail(ServerUtils.java:151) at com.geazy.frames.server.utils.ServerUtils.main(ServerUtils.java:296) Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 503 5.7.1 Incorrect Authentication for Specified Email Address at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1145) ... 7 more QUIT I use apache commons mail to send mail. Here is the code: HtmlEmail email = new HtmlEmail(); email.setHostName(info.mailserver); email.setAuthentication(info.username, info.password); email.setSmtpPort(info.smtpport); email.setFrom("padysrini at gmail dot com"); email.addTo("padysrini at hotmail dot com"); email.setSubject(subject); email.setHtmlMsg(html); email.setDebug(true); email.send(); Thanks pady ----- Original Message ----- From: "Norman Maurer" <nor...@apache.org> To: "James Users List" <server-user@james.apache.org> Sent: Friday, November 13, 2009 1:24 AM Subject: Re: simple beginner question...I think there is no need for aspecial mailet. Just Set the Mail from and from headers to the senderaddress you want to use. Bye norman 2009/11/12, pady-geazy <p...@geazy.com>:I have a requirement in my app as follows -1. A user registers with my app, and registers an email address. ( "a atgmail dot com" ) 2. The app sometimes has to send emails on behalf of the user.3. I have James email server which accepts connections from "appdomaindot com". 4. In the above scenario, today, the app sends the email using the sender as "app at appdomain dot com"5. But I would like James to process the email as the sender as "app at appdomain dot com" ( thus doing smtp auth ) but then forward the emailsusing the sender as "a at gmail dot com" Can this be done with a mailet ? Thanks pady--------------------------------------------------------------------- To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org For additional commands, e-mail: server-user-h...@james.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org For additional commands, e-mail: server-user-h...@james.apache.org--------------------------------------------------------------------- To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org For additional commands, e-mail: server-user-h...@james.apache.org--------------------------------------------------------------------- To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org For additional commands, e-mail: server-user-h...@james.apache.org
--------------------------------------------------------------------- To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org For additional commands, e-mail: server-user-h...@james.apache.org