[dmarc-discuss] Inbox Clutter

Todd Lyons tlyons at ivenue.com
Thu Jun 7 10:04:29 PDT 2012

On Thu, Jun 7, 2012 at 9:42 AM, Todd Lyons <tlyons at ivenue.com> wrote:
> If anything comes in from an ipv6 host, the
> script chokes because the ip field is defined as INT(10), and an ipv6
> address is not an int, so it gets converted to NULL on the insert and
> dies because that field cannot be NULL:

Thanks to world ipv6 day, ipv6 addresses are not compatible with the
existing design (all of schema, import, and display) with the tools
mentioned in this thread.

> Working on converting it to VARCHAR(40) which is the max length of an
> ipv6 address string.  Determining if I need to adjust anything else in
> the php or in the perl imap script.

I know it's suboptimal, but I had to convert it all back to text. :-(

1) in the schema, I did:
  alter table rptrecord MODIFY `ip` VARCHAR(40) NOT NULL;
  update rptrecord set ip=INET_NTOA(ip);

2) in the perl imap script, I changed it to:
       $dbh->do(qq{INSERT INTO
           or die "cannot insert record " . $dbh->{'mysql_error'};

3) in the php webpage, I changed it to:
       echo "<td><a name=rpt". $row['serial'].">". $row['ip'].
            //"</td><td>". gethostbyaddr(long2ip($row['ip'])).
            "</td><td>". gethostbyaddr($row['ip']).

It's working again with the above changes.  You'll get the annoying issue
now that any sorting of the IP will be done text based instead of integer
based, but that's an inconvenience and not a stopper.

Always code as if the guy who ends up maintaining your code will be a
violent psychopath who knows where you live. -- Martin Golding
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://medusa.blackops.org/pipermail/dmarc-discuss/attachments/20120607/ab94de79/attachment.htm>

More information about the dmarc-discuss mailing list