John Rudd's ms2cgp and cgp2ms

NTIN Page Guy pages at ntin.net
Wed Dec 3 20:49:21 GMT 2003


There seems to be a problem with cgp2ms and ms2cgp when a email
address contains an & sign.

For example
I send an email to jena&jema at example.com where example.com
is not a local domain.

The message goes out to mailscanner via cgp2ms

4:03:35.73 2 ENQUEUERRULES [29540630] rule(MailScanner) action #0: launching external task:
[FILE]/usr/local/etc/cgp2ms
14:03:35.84 2 ENQUEUERRULES [29540630] rule(MailScanner) discarded the message
14:03:35.84 2 ENQUEUER-03([29540630]) discarded by Rules
14:03:35.84 2 DEQUEUER [29540630] SYSTEM()jena&jemma at baldwinfamily.us delivered

Then root@ gets the following email, the original
sender of the message gets no failure notice.

Failed to deliver to '<jena>'
address is blacklisted


I have fixed the proceeding problem, here is how I did it.

I found a bug in ms2cgp which was causing problems with email
addresses with & signs in them.

ms2cgp had the following lines, this caused a problem because the &
sign is a special character.

   # send the message off to CommuniGate Pro
   system("$CGPBIN/sendmail -i $rcpt < $msg");

Below is my fix, by inclosing the $rcpt in quotes I have convinced it
to accept special characters in email addresses.

   # send the message off to CommuniGate Pro
   system("$CGPBIN/sendmail -i \"$rcpt\" < $msg");

If you see any flaws in my logic, please let me know.


Best regards,
Robert B, NTIN                           mailto:pages at ntin.net



More information about the MailScanner mailing list