[EMAIL PROTECTED] writes:
Hello,
Is there is solution for incoming emails with char '&' in sender email address:
In order for a solution to exist, one requirement must be met: a problem must exist before hand.
You need to explain, beforehand, what the actual problem is.
# mailq
Size Queue ID Date
User From
Status Recipient
---------------- ---------------------------------------------------------
976.8K 00062ED6.3FC75ACE.00002AC6 Nov 28 16:25
courier Service&[EMAIL PROTECTED]
[EMAIL PROTECTED]
1 messages.
# cancelmsg 00062ED6.3FC75ACE.00002AC6
Message scheduled for cancellation.
# mailq
Size Queue ID Date
User From
Status Recipient
---------------- ---------------------------------------------------------
3.6K 000106D6.3FCCE661.00003A3E Dec 02 21:22
courier
Service&[EMAIL PROTECTED]
1 messages.
Yes? Your point is?
The only solution for now is stop courier, delete everything in in /var/spool/courier/msgq and /var/spool/courier/msgs and start courier again.
Comments?
If you are implying that neither the message, nor the bounce, is getting delivered, then your first step should be to look in your mail logs, and see why.
There's nothing inherently unusual about messages with & in the sender's address:
MAIL FROM:<service&[EMAIL PROTECTED]>
250 Ok.
RCPT TO:<[EMAIL PROTECTED]>
250 Ok.
DATA
354 Ok.
From: service&[EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: test
Ampersand test
.
250 Ok. 3FCD2557.000076A9
QUIT
221 Bye.
Delivered-To: [EMAIL PROTECTED]
Return-Path: <service&[EMAIL PROTECTED]>
Received: from ny.email-scan.com (softdnserr [::ffff:127.0.0.1])
(IDENT: [gIHo74ksgZk9dQIY16UPCy5dpeAKd/S8])
by ny.email-scan.com with esmtp; Tue, 02 Dec 2003 18:50:28 -0500
From: service&[EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: test
Ampersand test
My guess would be that you've installed some convoluted command line in the .courier file that uses the $SENDER environment variable in an unsafe way, so the ampersand in the E-mail address gets interpreted by the shell.
Congratulations! With a carefully-crafted message, an attacker can execute any shell command on your box.
But again, that's just a guess, because you haven't explained what your problem is.
There is logs:
Nov 30 04:57:28 server-1 courierd: started,id=00062ED6.3FC75ACE.00002AC6,from=<Service&[EMAIL PROTECTED]>,modul e=local,[EMAIL PROTECTED]/home/protechnica/office!!,a ddr=<[EMAIL PROTECTED]>
Nov 30 04:57:28 server-1 courierd: Waiting. shutdown time=none, wakeup time=none, queuedelivering=1, inprogress=1
Nov 30 04:57:28 server-1 courierlocal:id=00062ED6.3FC75ACE.00002AC6,from=<Service&[EMAIL PROTECTED]>, addr=<[EMAIL PROTECTED]>: [EMAIL PROTECTED]: not found
Nov 30 04:57:28 server-1 courierlocal:id=00062ED6.3FC75ACE.00002AC6,from=<Service&[EMAIL PROTECTED]>, addr=<[EMAIL PROTECTED]>: maildrop: error writing to filter.
Nov 30 04:57:28 server-1 courierlocal:id=00062ED6.3FC75ACE.00002AC6,from=<Service&[EMAIL PROTECTED]>, addr=<[EMAIL PROTECTED]>: maildrop: Unable to filter message.
Nov 30 04:57:28 server-1 courierlocal:id=00062ED6.3FC75ACE.00002AC6,from=<Service&[EMAIL PROTECTED]>, addr=<[EMAIL PROTECTED]>,status: deferred
Nov 30 04:57:28 server-1 courierd: completed,id=00062ED6.3FC75ACE.00002AC6
My /etc/courier/maildroprc:
import SENDER
import RECIPIENT
import HOME
PATH=/bin:/usr/bin:/usr/local/bin:/usr/lib/courier/bin/
INBOX="Maildir/"
DEFAULT="$INBOX"
SPAMFLD="/home/protechnica/zarhi/Maildir/.spam/"
SHELL=/bin/ash
#Amavis is called
# Import Variables
#
#import HOME
#import SENDER
#import RECIPIENT
# Virus Scan
if ($SENDER ne "")
{
FROM=$SENDER
}
else
{
FROM="unknown"
}
xfilter "/usr/sbin/amavis $FROM $RECIPIENT"
if (/^Subject:.*VIRUS IN*/)
{
exception {
to "/home/protechnica/zarhi/Maildir/.Virus"
}
}
#If a virus was detected the mail goes to Maildir/.Virus
#and no further checking is done for that piece of mail.
# create needed directory
`test -d "$SPAMFLD"`
if( $RETURNCODE == 1 )
{
`maildirmake "$SPAMFLD"`
}
# filter message
# xfilter "/usr/bin/spamc"
# if ( /^X-Spam-Status: Yes,/)
# {
# DEFAULT="$SPAMFLD"
# }
xfilter "/usr/bin/spamassassin"
if (/^X-Spam-Flag: *YES/)
{
exception {
to "$SPAMFLD"
}
}
So the problem is: If such email arrived it sit is mail queue and courierlocal try to deliver twice every hour. As You see this email is received at 28 Nov 2003. Three days after this courier continue try to deliver locally. If I try to cancel message with cancelmsg, sometimes bounce is send ok, some times bounce is sitting in queue, and I remove it with cleaning msgq and msgs folders.
--
Svetozar Mihailov
------------------------------------------------------- This SF.net email is sponsored by OSDN's Audience Survey. Help shape OSDN's sites and tell us what you think. Take this five minute survey and you could win a $250 Gift Certificate. http://www.wrgsurveys.com/2003/osdntech03.php?site=8 _______________________________________________ courier-users mailing list [EMAIL PROTECTED] Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
