IMAP Bounced Email : Original message is removed from bounced email - java

IMAP is removing the original content from the mail, as can be seen from below example (The original message has been removed from the bounce message.)
Question: Is there any config that I can provide to IMAP while connecting to always send the original message?
Example :
Return-Path: <>
To: a#ba.com
From: Mail Administrator <postmaster#b.com>
Reply-To: <Postmaster#b.com>
Subject: Mail System Error - Returned Mail with Subject: Hi from a
Date: Tue, 11 Oct 2018 12:38:19
Message-ID: <12121213312.AH12R3177.ns12d12121231u2fep03t-svc.1.q.com#qwp03t-q>
MIME-Version: 1.0
Content-Type: multipart/report;
report-type=delivery-status;
Boundary="===========================_ _= 8483766(3177)q"
Content-Transfer-Encoding: 7bit
--===========================_ _= 8483766(3177)q
Content-Type: text/plain
This Message was undeliverable due to the following reason:
Each of the following recipients was rejected by a remote mail server.
The reasons given by the server are included to help you determine why
each recipient was rejected.
Recipient: <a12312121#gmail.com>
Reason: 5.1.1 The email account that you tried to reach does not exist. Please try 5.1.1 double-checking the recipient's email address for typos or 5.1.1 unnecessary spaces. Learn more at 5.1.1 https://support.google.com/mail/?p=NoSuchUser w02-q2.2a60 - gsmtp
Please reply to <Postmaster#a.b.com>
if you feel this message to be in error.
The original message has been removed from the bounce message.
--===========================_ _= 8483766(3177)q
Content-Type: message/delivery-status
Reporting-MTA: dns; asasd.as.aas.a.a.com
Arrival-Date: Tue, 11 Oct 2018 12:38:06
Received-From-MTA: dns; a.a.a.a.b.com
Action: failed
Status: 5.1.1
Remote-MTA: dns; gmail-smtp-in.l.google.com (172.217.194.27)
Diagnostic-Code: smtp; 550-5.1.1 The email account that you tried to reach does not exist. Please try
550-5.1.1 double-checking the recipient's email address for typos or
550-5.1.1 unnecessary spaces. Learn more at
550 5.1.1 https://support.google.com/mail/?p=NoSuchUser w20-v6si34204854plp.260 - gsmtp
--===========================_ _= 8483766(3177)q--

IMAP - internet message access protocol is a protocol to access emails on a mail server. This does not dictate what is provided by the server when an Email is requested via IMAP. I would suggest posting the mail server you are running as there may be configuration settings on the mail server that can do this.

Related

Send email with attachment in Java via relay mail server error

I am running a Java web application and send email. "mail.smtp.auth: false" in props, but I still keep getting
javax.mail.AuthenticationFailedException: 535 5.7.3 Authentication unsuccessful
What is the best solution? I couldn't find what I was looking for in this thread
properties:
mail.smtp.auth: false
mail.smtp.starttls.enable: false
mail.debug: true
mail.host: xx.xx.xx.x
mail.port: 25
mail.smtp.socketFactory.class: xxxxxx
This is how I edited my settings. But I'm getting authentication error.
javax.mail.AuthenticationFailedException: 535 5.7.3 Authentication unsuccessful

Trouble with James mail server: some time email message can't be received from gmail

I configured Apache James server in my local machine then added domains & user and then configured it in thunderbird.
Then I tried to send an email from Gmail to apache James server and I am facing below issue like,
Sometimes mail sent successfully from Gmail to the James server, but sometimes it's failed to send an email.
I am getting this error in Gmail: Address not found Your message wasn't delivered to [email address] because the address couldn't be found, or is unable to receive mail.
The response from the remote server was: 550 5.1.1 [email address] Recipient not found.
Anyone please help me on this issue?
Thanks!
Try to open access for dangerous apps on myaccount.google.com/lesssecureapps

JavaMail - Invalid HELO name

I used to run a server app that sends an e-mails each 2 hours, but sometimes i get the error below:
Não foi possível enviar a mensagem.
Mensagem: com.sun.mail.smtp.SMTPSendFailedException: 550 Access denied - Invalid HELO name (See RFC2821 4.1.1.1)
Jan 07, 2013 1:00:32 PM job_hidrojato.comunicacao.email.Email run
SEVERE: null
com.sun.mail.smtp.SMTPSendFailedException: 550 Access denied - Invalid HELO name (See RFC2821 4.1.1.1)
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)
at javax.mail.Transport.send0(Transport.java:169)
at javax.mail.Transport.send(Transport.java:98)
at job_hidrojato.comunicacao.email.Email.run(Email.java:186)
at java.lang.Thread.run(Thread.java:722)
I've already tried to explicitly define the mail.smtp.localhost using the code below, where "HADES" is the hostname of my server, but it didn't work.
props.put("mail.smtp.localhost", "HADES");
The error log gerenated after this change is the same, so I think that the problem isn't the hostname parameter. I already read the links below but again, didn't work, so I'm running out of alternatives to solve this problem, and any help would be appreciated :)
Invalid HELO name in JavaMail
550 Access denied - Invalid HELO name
If you look up RFC2811 section 4.1.1.1 it says (emphasis mine):
These commands are used to identify the SMTP client to the SMTP
server. The argument field contains the fully-qualified domain name
of the SMTP client if one is available. In situations in which the
SMTP client system does not have a meaningful domain name (e.g., when
its address is dynamically allocated and no reverse mapping record is
available), the client SHOULD send an address literal (see section
4.1.3), optionally followed by information that will help to identify
the client system.
The name HADES is not a fully qualified domainname (which is hostname+domain, eg www.example.com, some definitions of FQDN also require a dot a the end (ie www.example.com. but I am unsure if that is required by SMTP). If you don't have a FQDN, you should use an address literal (see section 4.1.3 Address Literals), which basically is the IP address.
Also be sure that your SMTP server is not actively restricting access to unknown or unauthenticated hosts.

sending mail through Java

I am facing problem on a centOS server while sending java mails. Getting the following exception.
javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25, response: -1
I used the following command from the command prompt and I got the mail as expected.
echo "testing" | mail -s"test subject" shantanu.oa#gmail.com
The relevant entry from maillog looks like this...
Mar 28 20:13:16 postfix/smtpd[10120]: fatal: no SASL authentication mechanisms
Mar 28 20:13:17 postfix/master[28163]: warning: process /usr/libexec/postfix/smtpd pid 10120 exit status 1
Mar 28 20:13:17 postfix/master[28163]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
Mar 28 20:26:22 postfix/smtpd[11001]: warning: SASL: Connect to private/auth failed: Connection refused
How do I correct the problem?
From the log entry
Mar 28 20:13:16 postfix/smtpd[10120]: fatal: no SASL authentication mechanisms
I suspect that the problem is on Postfix, of which I'm not an expert. Googling for "fatal: no SASL authentication mechanisms" gives lots of interesting links: maybe have a look here or here.
From the exception it seems like its not able to connect to the host.
Have you tried the telnet stuff?
One more thing to check would be whether the name to IP resolution is taking place properly.If not you can use the IP directly in place of host to see what happens.
does your smtp-server needs authentication?
Seems so, because the cmd call with mail works. In default postfix configuration a local user is allowed to send mails without authentication. And your Java application might not be a registered system user on this maschine.
Try to provide username and password in your code to login to the smtp server.

SMTP Settings Not working for Hotmail

Username: xxxxx.#hotmail.com
Password: yyyyyyyy
Pop3: pop3.live.com Port: 995 SSL: TRUE
SMTP: smtp.live.com Port: 587 SSL: TRUE (Port: 25 also not working)
These are the details I gave: POP3 settings accepted and SMTP settings throw Exception:
javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
I got this Exception when I try to send a mail via Java Coding.
Can any one help me for correct SMTP settings which will works to send mail.
I have Send mail using Gmail and Yahoo.
To my knowledge you only use their incoming address. For outgoing to need to use a local/private/alternate SMTP server.
I check my incoming mail on a Live account through pop3.live.com and send out through mail.{myworkdomain}.com.au

Categories

Resources