Re: Sending Email
Re: Sending Email
- Subject: Re: Sending Email
- From: Lucas Holt <email@hidden>
- Date: Mon, 11 Jul 2005 19:34:20 -0400
It has nothing to do with your java code. Its the DNS config and
possibly the smtp server. Not you.
1. Tell the bone head sys admin to setup the PTR and A records for
your server correctly. (DNS)
2. Make sure you are allowed to relay with that username/password or
by ip address.
The reason its happening is because many mail servers think that mail
coming from an ip without a PTR record is automatically a spammer.
(comes up forged in the headers or errors) In fact, sendmail has had
this feature for a long time. I believe its called
PICKY_HELLO_CHECK. It can cut some spam as many spammers use ips
that don't belong to them or send from loop back etc.
To explain further, a PTR record is a DNS record that translates an
IP address to a name.. i.e 17.254.0.91 will translate to
91.0.254.17.in-addr.arpa which happens to be an akami server for
www.apple.com. Another example would be
nslookup 216.55.178.45
Note: nslookup is deprecated and may be removed from future releases.
Consider using the `dig' or `host' programs instead. Run nslookup with
the `-sil[ent]' option to prevent this message from appearing.
Server: 192.168.0.2
Address: 192.168.0.2#53
Non-authoritative answer:
45.178.55.216.in-addr.arpa name = mail.foolishgames.com.
Authoritative answers can be found from:
178.55.216.in-addr.arpa nameserver = ns1.abac.com.
178.55.216.in-addr.arpa nameserver = ns2.abac.com.
As you can see, my mail server's reverse lookup (PTR) is
mail.foolishgames.com and if you nslookup mail.foolishgames.com it
resolves to the same ip address. In this case, my hosting company
has to manage the DNS record because they own the ips. IP addresses
can only be subleased some many times and eventually they can't
delegate the DNS to you. At least thats what i've been told in the
past. Either way its whoever gave you the ips for the server's
fault. Most hosting companies will fix this for you for free.
Luke
On Jul 11, 2005, at 1:26 PM, Gino Pacitti wrote:
Hi LD
This is the class I am using and I load from a Properties file the
smtp host, username and password..
Does this clarify the set up?
public static boolean send(String subject, String to, String
from, String body) {
// these will be obtained from the Properties file
String mailHost = ((String)System.getProperties
().getProperty("mailHost"));
String mailSender = ((String)System.getProperties
().getProperty("mailSender"));
String mailPwd = ((String)System.getProperties().getProperty
("mailPwd"));
if ((from != null) && (to != null) && (subject != null) &&
(body != null)) {
try {
//Get system properties
Properties props = System.getProperties();
//Specify the desired SMTP server
props.put("mail.smtp.host", mailHost);
props.put("mail.smtp.auth", "true");
// create a new Session object
javax.mail.Session session =
javax.mail.Session.getInstance(props,null);
// create a new MimeMessage object (using the
Session created above)
Message message = new MimeMessage(session);
message.setFrom(new InternetAddress(from));
message.setRecipients(Message.RecipientType.TO, new
InternetAddress[] { new InternetAddress(to) });
message.setRecipients(Message.RecipientType.BCC,
new InternetAddress[] { new InternetAddress ((String)
System.getProperties().getProperty("toAddress")) });
message.setSubject(subject);
message.setContent(body, "text/plain");
message.setSentDate(new Date());
message.saveChanges();
Transport transport = session.getTransport("smtp");
transport.connect(mailHost,mailSender,mailPwd);
transport.sendMessage(message,
message.getAllRecipients());
transport.close();
return true;
}
catch (Throwable t) {
// t.printStackTrace();
System.err.println("SMTP: " + t);
return false;
}
}
return false;
}
On 11 Jul 2005, at 18:19, LD wrote:
Hi there,
On 12/07/2005, at 3:04 AM, Gino Pacitti wrote:
I have a class that utilizes:
javax.mail.*;
javax.mail.internet.*;
classes and has worked great until now.
I recently set up an xserve in a data centre and the ISP is
handling the DNS etc...
But when I send through to the clients mail server using the
correct mailserver, username and password I get this error:
javax.mail.SendFailedException: 550 5.7.1 <the email address to
send to>... Relaying denied. IP name possibly forged
[217.149.110.33]
The relay error seems to pop its head up when you're attempting to
smtp via a network you're not a part of.
Are you sending via the ISP's smtp?
with regards,
--
LD
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40foolishgames.com
This email sent to email@hidden
Lucas Holt
email@hidden
________________________________________________________
FoolishGames.com (Jewel Fan Site)
JustJournal.com (Free blogging)
FoolishGames.net (Enemy Territory IoM site)
Think PC.. in 2006 you can own an Apple PCintosh. Whats next, windows
works?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden