Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Bad Address

Quote Reply
Bad Address
Today I rejected a submission to Links 2.0. I received the following error notice:

Quote:
Error validating links:
  • Email Error: 3776. Record deleted, but couldn't send rejection letter. Reason: Bad Email addres: 'someonesemail@shaken-and-stirred.info'.

I changed the actual email address for privacy reasons but the domain is valid.

Can anyone tell me, is this an error within Links or is this a sendmail error?

I did a whois on the domain and it is valid so I do not understand why email could not be sent to it.

I have found the code that generates the error in db.pl (which is shown below) but do not see anything that would cause the error message:

Code:
ID: foreach $id (keys %delete_list) {
if ($delete_list{$id}) { next ID; }
elsif (!$in{"reason-$id"}) { next ID; }
elsif (
${$links{$id}}{'Contact Email'} =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/ ||
${$links{$id}}{'Contact Email'} !~ /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/) {
$errstr .= ($errstr, "<li>Email Error: <strong>$id</strong>. Record deleted, but couldn't send rejection letter. Reason: Bad Email addres: '${$links{$id}}{'Contact Email'}'.");
}
else { &html_reject_email (%{$links{$id}}); }
}

Any help would be appreciated.

By the way, I already corrected the misspelled "addres" in the code on my system. Crazy
Quote Reply
Re: [Bobsie] Bad Address In reply to
You're looking at the right spot (db.pl, about three-quarters of the way down), here is what you need to do:

# Before we display the HTML, let's fire off some validate/modify/delete emails
# lettings visitors know we've added their link. We only send the mail
# if $modify_list{$id} = 0 (if it's still 1, that means there was an error).
# NOTE: You can modify the text of the email in the email templates.
&html_print_headers; # Just in case sendmail coughs up an error.

if ($db_email_modify) {
ID: foreach $id (keys %modify_list) {
if ($modify_list{$id}) { next ID; }
elsif (${$links{$id}}{'Contact Email'} =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/ ||
${$links{$id}}{'Contact Email'} !~ /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/) {
$errstr .= ($errstr, "<li>Email Error: <strong>$id</strong>. Record validated, but couldn't send auto email. Reason: Bad Email addres: '${$links{$id}}{'Contact Email'}'.");
}
else { &html_modify_email (%{$links{$id}}); }
}

Change that 3 to a 4. This allows four-letter tld's (.info).


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Bad Address In reply to
thanks for this - i hadn't encountered this problem until this month and just found this solution


thanks again