commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ricardo Bevilacqua <rus.s...@gmail.com>
Subject Re: Remove headers on multipart email
Date Fri, 01 Mar 2013 15:54:29 GMT
Hi,

Its a really odd thing that im asking, I know. I think the problem
with the server is that it rejects messages with a custom FROM as an
anti-spam feature, just like Caesar said. If I send a mail manually
with Telnet, without specifying the FROM field, the mail is sent.

Thanks in advance!

Richard.


On Sat, Feb 16, 2013 at 12:11 PM, Thomas Neidhart <thomas.neidhart@gmail.com
> wrote:

> On 02/15/2013 10:44 PM, Ricardo Bevilacqua wrote:
> > Hi to all!
> >
> > I'm facing the following issue: my client has an SMTP server that
> > blocks incomming mails that have the "from" header for some reason. If
> > the mail doesn't have this header, it works.
> >
> > So my question is if there is a chance to remove this header.
> >
> > I've already tried to set the headers to "null" like this:
> >
> > <code>
> >
> >     email.setHeaders(null);
> >
> > </code>
> >
> > But that gives an exception. I also tried to set the From header empty:
> >
> > <code>
> >
> >     HashMap <String, String> headers = new HashMap<String, String>();
> >
> >     headers.put("From", "");
> >
> >     email.setHeaders(headers);
> >
> > </code>
> >
> > But that gives an exception as well.
> >
> > Your help is greatly  appreciated.
>
> Hi,
>
> as Siegfried already mentioned, this is kind of odd. I would first
> investigate why the mail server rejects emails with a valid from header.
>
> If you really want to change/omit the from header you will have to use
> reflection to set it to a null value or update the embedded mime message
> (depending on whether buildMimeMessage has already been called in your
> case).
>
> Thomas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message