Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 585F14769EB for ; Fri, 30 Aug 2002 10:19:47 -0400 (EDT) Received: from wolff.to (wolff.to [66.92.219.49]) by postgresql.org (Postfix) with SMTP id 16F66476149 for ; Fri, 30 Aug 2002 10:19:17 -0400 (EDT) Received: (qmail 28795 invoked by uid 500); 30 Aug 2002 14:26:40 -0000 Date: Fri, 30 Aug 2002 09:26:40 -0500 From: Bruno Wolff III To: Matthew Price Cc: pgsql-sql@postgresql.org Subject: Re: RFC822 Checker Message-ID: <20020830142640.GA28639@wolff.to> Mail-Followup-To: Matthew Price , pgsql-sql@postgresql.org References: <20020830.100812.20767.2685@webmail6.nyc.untd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020830.100812.20767.2685@webmail6.nyc.untd.com> User-Agent: Mutt/1.3.25i X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/424 X-Sequence-Number: 9270 On Fri, Aug 30, 2002 at 14:07:28 +0000, Matthew Price wrote: > Howdy, > > Does anyone know of an SQL function that will check a string for compliance with the RFC822 mail address spec? I have a script that sends mail from a db (no, I am not a spammer) but I often have mails sitting in my queue because the MTA (correctly) refuses to process some of the bogus things that users enter by mistake. You might consider storing the unecoded address. If you are using an MTA that doesn't provide a way to input unencoded addresses (e.g. sendmail), you can encode the address before passing it to the MTA or adding it into a header if you need to do that. It isn't even that hard to tack on the person's name (from somewhere else in your database) or other comment on when putting the encoded address into a message header. When collecting input you might ask for confirmation when seeing unusual addresses. This should cut down on the number of bogus ones that get into the sysem.