DevHeads.net

Special Characters in Address

Hello all,
I'm having an issue that I believe is coming from Postfix. I am sending mail
to an address which contains special characters. Those characters aid me in
routing the mail but unfortunately it seems to be rejected before being
relayed. The format is as follows, a block of text followed by an "="
followed by more text and a number, followed by a "|" and then numbers @ the
domain.com ie: "text=option1| ... at address dot com".
When sending from Gmail for instance I get the following error:

Technical details of permanent failure:
Google tried to deliver your message, but it was rejected by the recipient
domain. We recommend contacting the other email provider for further
information about the cause of this error. The error that the other server
returned was: 501 501 5.1.3 Bad recipient address syntax (state 14).

Also, I am seeing the following error in Postfix:

*'501 5.1.3 Bad recipient address syntax' *

Any suggestions or assistance would be greatly appreciated.
Thanks

Comments

Re: Special Characters in Address

By Melvyn Sopacua at 03/23/2009 - 18:18

Let me guess, option1 contains either '<' or '>':

RCPT TO: text=<html>|12345@localhost
501 5.1.3 Bad recipient address syntax
RCPT TO: <text=<html>|12345@localhost>
501 5.1.3 Bad recipient address syntax

Re: Special Characters in Address

By Evan Platt at 03/23/2009 - 18:04

I'm certainly no Postfix expert, pretty straightforward install...
but I tried setting up an account, and it worked fine - So, likely
anyone who can help you will need / want
postconf -n
entries from mail log showing the reject

Not sure what else... But here's my mail log showing the mail accepted.

Mar 23 16:01:03 www postfix/qmgr[11482]: 3FE281DA4E8:
from=< ... at anotherdomain dot com>, size=2313, nrcpt=1 (queue active)
Mar 23 16:01:03 www postfix/local[13208]: 3FE281DA4E8:
to=< ... at mydomain dot com>,
orig_to=<text=option1| ... at espphotography dot com>, relay=local,
delay=0, status=sent (delivered to mailbox)
Mar 23 16:01:03 www postfix/qmgr[11482]: 3FE281DA4E8: removed

I use one main mailbox and /etc/postfix/aliases ...

Evan

Re: Special Characters in Address

By Mischa Gresser at 03/23/2009 - 18:44

Is this the correct log?

Mar 20 10:13:01 hostname postfix/qmgr[15441]: 39F9BAD0063: removed
Mar 20 10:13:31 hostname postfix/smtpd[31210]: connect from
qw-out-2122.google.com[74.125.92.26]
Mar 20 10:13:32 hostname postfix/smtpd[31210]: warning: Illegal address
syntax from qw-out-2122.google.com[74.125.92.26] in RCPT command: <cover1
<a href="mailto: ... at xxx dot ca"> ... at xxx dot ca</a> < ... at crebifax dot ca>>
Mar 20 10:13:32 hostname postfix/smtpd[31210]: disconnect from
qw-out-2122.google.com[74.125.92.26]

Re: Special Characters in Address

By Victor Duchovni at 03/23/2009 - 19:55

Your HTML mail client has mangled the content. Please disable all HTML
in the MUA and try again. In any case, it looks like the sending system
sent garbage.

Re: Special Characters in Address

By Wietse Venema at 03/23/2009 - 19:11

Mischa Gresser:

The RCPT command syntax is:

RCPT TO:< ... at crebifax dot ca>

Not:

RCPT TO:< ... at xxx dot ca < ... at crebifax dot ca>>

The author of this software should study RFC 821/2821/5321.

Wietse

Re: Special Characters in Address

By Aaron Wolfe at 03/23/2009 - 22:25

I think we are actually seeing a botched attempt to alter log lines by
hand using an HTML mua.

In any case, the format described (not the one "shown") works fine
from my google mail to my instance of postfix at least. without
accurate logs or postconf output, who could guess what is going wrong
for the OP.

Mar 23 22:47:39 mx1 postfix/smtpd[22236]: NOQUEUE: reject: RCPT from
mail-gx0-f207.google.com[209.85.217.207]: 550 5.1.1
<cover=cover1| ... at example dot com>: Recipient address rejected:
User unknown in virtual mailbox table; from=< ... at gmail dot com>
to=<cover=cover1| ... at example dot com> proto=ESMTP
helo=<mail-gx0-f207.google.com>

-Aaron

Re: Special Characters in Address

By Aaron Wolfe at 03/23/2009 - 19:03

It's sort of hard (for me at least) to tell what really is in the log
and what your mail client (or mine) has mangled up, does it actually
say:

<cover1
<a href="mailto: ... at xxx dot ca"> ... at xxx dot ca</a> < ... at crebifax dot ca>>

in the log? Is that a newline or space or something? between 'cover1'
and '1231231234'? what exactly is the address you are sending to?
where did that extra address (403 etc .ca) come from? It would help
if you could use plain text only when posting.

i think the simple answer is that postfix is getting garbage and
saying 'no thanks'. maybe your client sends garbage, maybe your client
sends something valid but weird and google turns it into garbage?

-Aaron

Re: Special Characters in Address

By Mischa Gresser at 03/23/2009 - 18:11

Thanks for the quick reply. Sure thing on the logs.

20090320 22:42:55 38236 49A2055900086768 QUEUE
From=< ... at xxx dot com<IVMSXGATE- ... at ivmsxgate dot mailconnect.com>>
Size=1203 Relay=192.168.xxx.xxx

20090320 22:42:55 38237 49A2055900086768 QUEUE Recipient=<xxx|
<a href="mailto: ... at xxx dot ca"> ... at xxx dot ca</a> < ... at crebifax dot ca>>

20090320 22:42:55 38238 49A2055900086768 QUEUE Message-ID=<
... at xxx dot pvt< ... at ivmsxgate dot crc.pvt>>

20090320 22:42:55 38239 49A2055900086768 QUEUE Subject=Mb >
0x52cfd3c0 0x1b9160 2009.3.20 22 42 54 < Mb

*20090320 22:42:56 38241 49A2055900086768 SMTP opened connection
to '192.168.xx.xx' IP 192.168.xx.xx *

*20090320 22:42:56 38242 49A2055900086768 SMTP RCPT TO <xxx|
<a href="mailto: ... at xxxx dot ca"> ... at xxxx dot ca</a> < ... at crebifax dot ca>> got reply '501 5.1.3 Bad
recipient address syntax' *

20090320 22:42:57 38243 49A2055900086768 DSN
To=< ... at xxx dot com<IVMSXGATE- ... at ivmsxgate dot mailconnect.com>>

20090320 22:42:57 38244 49A2055900086768 DSN
RemoteMTA=192.168.xx.xx

20090320 22:42:57 38245 49A2055900086768 DSN Subject=Mb >
0x52cfd3c0 0x1b9160 2009.3.20 22 42 54 < Mb

20090320 22:42:57 38246 49A2055900086768 DSN Relay=192.168.xx.xx

20090320 22:42:57 38247 49A2055900086768 DSN For=<xxx|
<a href="mailto: ... at xxx dot ca"> ... at xxx dot ca</a> < ... at crebifax dot ca>> Action=Failed Status=5.5.0
(other or undefined protocol status) Diagnostic 501 5.1.3 Bad recipient
address syntax

Re: Special Characters in Address

By Aaron Wolfe at 03/23/2009 - 18:15

those don't look like postfix logs. also please include the output of postconf
it is needed to help you.

Re: Special Characters in Address

By Wietse Venema at 03/23/2009 - 18:32

Aaron Wolfe:

The above logging is from the system that is sending mail into
Postfix.

To find out what commands the client sends you need to turn on
logging (debug_peer_list=192.168.1.1 or whatever).

I am pretty sure that your software does not correctly quote special
characters by the rules of RFC 821/2821/5321.

Postfix will not receive mail from clients that don't implement
basic SMTP syntax. This will not be changed.

Wietse

Re: Special Characters in Address

By Victor Duchovni at 03/23/2009 - 18:21

They are unequivocally NOT Postfix logs. The OP should find out what SMTP
software is actually running on the system in question.