×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Unusual error with Sendmail

Unusual error with Sendmail

Unusual error with Sendmail

(OP)
If a user enters a badly formed email address ie. yyrtrt@.gdgdg
I get the error

CODE

error closing /usr/lib/sendmail:  (exit 256) 

Any idea how to deal with it?

Keith
www.studiosoft.co.uk

RE: Unusual error with Sendmail

Validate before invoking sendmail is the only way.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

RE: Unusual error with Sendmail

(OP)
Thanks Chris, I test for the presence of a period and @ but obviously not enough.
I have tested my other servers and also shared hosting and the problem is only on one particular server.

Keith
www.studiosoft.co.uk

RE: Unusual error with Sendmail

I usually check for characters before and after the '.'

(\S+)@(\S+)\.(\S+)$ in it's simplest reg exp form

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

RE: Unusual error with Sendmail

(OP)
Thanks, assistance as always much appreciated.
I contacted my ISP but got the usual BS back about the server being unmanaged.

I only discovered the problem by accident, when testing the form.
I was entering nonsense to check some other functions and got this odd error.
It only does it when '@' and '.' are together. If that is the case, I remove them both and my validation fails the submission any way.

Keith
www.studiosoft.co.uk

RE: Unusual error with Sendmail

@. is an invalid character sequence for the Internet Mail RFCs

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

RE: Unusual error with Sendmail

You may want to look @ http://search.cpan.org/dist/Mail-RFC822-Address/Ad...

It is apparently considered bad practice to try to roll your own regex to validate things such as email addresses. nosmiley

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music

RE: Unusual error with Sendmail

(OP)
The check I do is only very basic and is designed to filter out keyboard bashing rather than validate an actual address.
A simple substitution of @. solved the original problem.
Not handling it resulted in a fatal error being thrown and the script crashed, which was unacceptable.

Keith
www.studiosoft.co.uk

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close