You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Serge Knystautas <se...@lokitech.com> on 2001/12/06 00:49:44 UTC
MAIL FROM and spaces
Ok, after saying that all those messages didn't put a space between MAIL
FROM: and the <>, I'm seeing in EHLO mode the commands are a bit different.
I recently turned on the SIZE limit in SMTP, which means JAMES acknowledges
with an EHLO and a 250-SIZE line. Remote servers are noticing this, so
they're sending the complementary SIZE parameter in the MAIL FROM. This
means they send the following:
MAIL FROM:<us...@domain> SIZE=2148
Where 2148 is the number of bytes of the message. Note there is now no
space between "...FROM:" and "<username...". Incidentally, this size is
sent so as while it gives a series of RCPT TO commands, our server can see
if any of those users have a quota that this message would exceed, and then
reject receiving the message for that user, using a 452 reply code.
Anyway, James is failing on this MAIL FROM format, so the size limitation
code isn't 100% just yet. I'm not sure quite how many emails we're
rejecting at this point, but I'm either going to patch this or turn off the
size limit setting on my server soon.
Serge Knystautas
Loki Technologies - Unstoppable Websites
http://www.lokitech.com/
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: MAIL FROM and spaces
Posted by Serge Knystautas <se...@lokitech.com>.
Patches applied.
I also made a fix to the RemoteDelivery mailet... it wasn't storing a new
'lastupdated' on the Mail each time it failed to send a message, so a
message would never move from the top of the stack. Also documented
LinearProcessor a bit more and added some debug in there.
Serge Knystautas
Loki Technologies - Unstoppable Websites
http://www.lokitech.com/
----- Original Message -----
From: "Matthew Pangaro" <mp...@lokitech.com>
To: "James Developers List" <ja...@jakarta.apache.org>
Sent: Friday, December 07, 2001 9:33 AM
Subject: Re: MAIL FROM and spaces
> Hello all,
> I've attacheched a diff for a patch to the SMTPHandler that will allow
> it to handle the SIZE= extension to the MAIL FROM. It's not
> particularly complicated, but it works, and should also make the
> server a little more forgiving, in that it will now swallow any
> unexpected command after the email address. If we want to support more
> commands, we can just add them to this code block. I haven't been able
> to find anything about other extensions to MAIL FROM, but I guess we
> should keep looking. Overall, it seems like the size limiting will
> work pretty well now, after this fix and the patch serge committed
> yesterday to MimeMessageWrapper, which fixed the basic functionality.
>
> I also removed the DEEP_DEBUG parameter, which was set locally, and
> not configurable. Seemed like this could just follow the normal log
> setting pattern from the conf file.
>
> The other two patches are related to serge's fix of MimeMessageWrapper
> from yesterday. I just found all the instances where an exception was
> being caught in a try block, and the root cause wasn't being wrapped
> in the MessagingException. Seems like it's always a good idea to
> include that original exception, since it allows the caller to get
> more information, if they need it (like in the case of SMTPHandler).
>
> Matt Pangaro
> Loki Technologies
> http://www.lokitech.com
>
> ----- Original Message -----
> From: "Serge Knystautas" <se...@lokitech.com>
> To: <ja...@jakarta.apache.org>
> Sent: Wednesday, December 05, 2001 6:49 PM
> Subject: MAIL FROM and spaces
>
>
> > Ok, after saying that all those messages didn't put a space between
> MAIL
> > FROM: and the <>, I'm seeing in EHLO mode the commands are a bit
> different.
> > I recently turned on the SIZE limit in SMTP, which means JAMES
> acknowledges
> > with an EHLO and a 250-SIZE line. Remote servers are noticing this,
> so
> > they're sending the complementary SIZE parameter in the MAIL FROM.
> This
> > means they send the following:
> >
> > MAIL FROM:<us...@domain> SIZE=2148
> >
> > Where 2148 is the number of bytes of the message. Note there is now
> no
> > space between "...FROM:" and "<username...". Incidentally, this
> size is
> > sent so as while it gives a series of RCPT TO commands, our server
> can see
> > if any of those users have a quota that this message would exceed,
> and then
> > reject receiving the message for that user, using a 452 reply code.
> >
> > Anyway, James is failing on this MAIL FROM format, so the size
> limitation
> > code isn't 100% just yet. I'm not sure quite how many emails we're
> > rejecting at this point, but I'm either going to patch this or turn
> off the
> > size limit setting on my server soon.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: MAIL FROM and spaces
Posted by Danny Angus <da...@thought.co.uk>.
Cool
> -----Original Message-----
> From: Matthew Pangaro [mailto:mpangaro@lokitech.com]
> Sent: Friday, December 07, 2001 2:34 PM
> To: James Developers List
> Subject: Re: MAIL FROM and spaces
>
>
> Hello all,
> I've attacheched a diff for a patch to the SMTPHandler that will allow
> it to handle the SIZE= extension to the MAIL FROM. It's not
> particularly complicated, but it works, and should also make the
> server a little more forgiving, in that it will now swallow any
> unexpected command after the email address. If we want to support more
> commands, we can just add them to this code block. I haven't been able
> to find anything about other extensions to MAIL FROM, but I guess we
> should keep looking.
AUTH is one it goes: MAIL FROM:<us...@mailhost.tld> AUTH=user@maihost.tld
and is used to indicate that the sender was authorised as the AUTH= address
by the sending SMTP host, giving you the opportunity to compare that with
the MAIL FROM: address itself.
Can't quite get why, which suggests I've misunderstood it, but there you go!
d.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: MAIL FROM and spaces
Posted by Matthew Pangaro <mp...@lokitech.com>.
Hello all,
I've attacheched a diff for a patch to the SMTPHandler that will allow
it to handle the SIZE= extension to the MAIL FROM. It's not
particularly complicated, but it works, and should also make the
server a little more forgiving, in that it will now swallow any
unexpected command after the email address. If we want to support more
commands, we can just add them to this code block. I haven't been able
to find anything about other extensions to MAIL FROM, but I guess we
should keep looking. Overall, it seems like the size limiting will
work pretty well now, after this fix and the patch serge committed
yesterday to MimeMessageWrapper, which fixed the basic functionality.
I also removed the DEEP_DEBUG parameter, which was set locally, and
not configurable. Seemed like this could just follow the normal log
setting pattern from the conf file.
The other two patches are related to serge's fix of MimeMessageWrapper
from yesterday. I just found all the instances where an exception was
being caught in a try block, and the root cause wasn't being wrapped
in the MessagingException. Seems like it's always a good idea to
include that original exception, since it allows the caller to get
more information, if they need it (like in the case of SMTPHandler).
Matt Pangaro
Loki Technologies
http://www.lokitech.com
----- Original Message -----
From: "Serge Knystautas" <se...@lokitech.com>
To: <ja...@jakarta.apache.org>
Sent: Wednesday, December 05, 2001 6:49 PM
Subject: MAIL FROM and spaces
> Ok, after saying that all those messages didn't put a space between
MAIL
> FROM: and the <>, I'm seeing in EHLO mode the commands are a bit
different.
> I recently turned on the SIZE limit in SMTP, which means JAMES
acknowledges
> with an EHLO and a 250-SIZE line. Remote servers are noticing this,
so
> they're sending the complementary SIZE parameter in the MAIL FROM.
This
> means they send the following:
>
> MAIL FROM:<us...@domain> SIZE=2148
>
> Where 2148 is the number of bytes of the message. Note there is now
no
> space between "...FROM:" and "<username...". Incidentally, this
size is
> sent so as while it gives a series of RCPT TO commands, our server
can see
> if any of those users have a quota that this message would exceed,
and then
> reject receiving the message for that user, using a 452 reply code.
>
> Anyway, James is failing on this MAIL FROM format, so the size
limitation
> code isn't 100% just yet. I'm not sure quite how many emails we're
> rejecting at this point, but I'm either going to patch this or turn
off the
> size limit setting on my server soon.
RE: MAIL FROM and spaces
Posted by Danny Angus <da...@thought.co.uk>.
I just looked at that again, and it doesn't look for the space between : and
< what happens is that it splits at the first space, and the command is the
first part, then it splits at the : and the sub command is the first part,
but the second part is not split further, it is passed as the argument, in
the case of MAIL FROM this is assumed by doMAIL() to be the sender and
nothing else, which I assume stuffs it because it doesn't end with >, or
can't be parsed into a mail address.
What I need to know before I can sort it out is whether there is a list of
these additional arguments and which commands they can be applied to, Serge
has identified SIZE, I found AUTH while I was patching this last time, are
there any more?
We need to add another layer of command parsing to deal with them.
d.
> -----Original Message-----
> From: Danny Angus [mailto:danny@thought.co.uk]
> Sent: Thursday, December 06, 2001 9:58 AM
> To: James Developers List
> Subject: RE: MAIL FROM and spaces
>
>
> I'll have another go at parseCommand() in SMTPHandler
>
> > -----Original Message-----
> > From: Serge Knystautas [mailto:sergek@lokitech.com]
> > Sent: Wednesday, December 05, 2001 11:50 PM
> > To: james-dev@jakarta.apache.org
> > Subject: MAIL FROM and spaces
> >
> >
> > Ok, after saying that all those messages didn't put a space between MAIL
> > FROM: and the <>, I'm seeing in EHLO mode the commands are a bit
> > different.
> > I recently turned on the SIZE limit in SMTP, which means JAMES
> > acknowledges
> > with an EHLO and a 250-SIZE line. Remote servers are noticing this, so
> > they're sending the complementary SIZE parameter in the MAIL FROM. This
> > means they send the following:
> >
> > MAIL FROM:<us...@domain> SIZE=2148
> >
> > Where 2148 is the number of bytes of the message. Note there is now no
> > space between "...FROM:" and "<username...". Incidentally, this size is
> > sent so as while it gives a series of RCPT TO commands, our
> server can see
> > if any of those users have a quota that this message would
> > exceed, and then
> > reject receiving the message for that user, using a 452 reply code.
> >
> > Anyway, James is failing on this MAIL FROM format, so the size
> limitation
> > code isn't 100% just yet. I'm not sure quite how many emails we're
> > rejecting at this point, but I'm either going to patch this or
> > turn off the
> > size limit setting on my server soon.
> >
> > Serge Knystautas
> > Loki Technologies - Unstoppable Websites
> > http://www.lokitech.com/
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: MAIL FROM and spaces
Posted by Danny Angus <da...@thought.co.uk>.
I'll have another go at parseCommand() in SMTPHandler
> -----Original Message-----
> From: Serge Knystautas [mailto:sergek@lokitech.com]
> Sent: Wednesday, December 05, 2001 11:50 PM
> To: james-dev@jakarta.apache.org
> Subject: MAIL FROM and spaces
>
>
> Ok, after saying that all those messages didn't put a space between MAIL
> FROM: and the <>, I'm seeing in EHLO mode the commands are a bit
> different.
> I recently turned on the SIZE limit in SMTP, which means JAMES
> acknowledges
> with an EHLO and a 250-SIZE line. Remote servers are noticing this, so
> they're sending the complementary SIZE parameter in the MAIL FROM. This
> means they send the following:
>
> MAIL FROM:<us...@domain> SIZE=2148
>
> Where 2148 is the number of bytes of the message. Note there is now no
> space between "...FROM:" and "<username...". Incidentally, this size is
> sent so as while it gives a series of RCPT TO commands, our server can see
> if any of those users have a quota that this message would
> exceed, and then
> reject receiving the message for that user, using a 452 reply code.
>
> Anyway, James is failing on this MAIL FROM format, so the size limitation
> code isn't 100% just yet. I'm not sure quite how many emails we're
> rejecting at this point, but I'm either going to patch this or
> turn off the
> size limit setting on my server soon.
>
> Serge Knystautas
> Loki Technologies - Unstoppable Websites
> http://www.lokitech.com/
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>