/    Sign up×
Community /Pin to ProfileBookmark

Mailing list security

I have just discovered how to send mail with PHP.
But I remember reading a thread here about some security issues.
I can’t seem to find the thread, but I do remember that someone tapped into his account somehow and sent mass emails out and his web service got suspended.
What I would like to know is, what do I need to do to protect myself from this?
My code seems very simple:

[code=php] <?php

//start building the mail string with this format:
//$msg = “This text will appear in message: $variable n”;
//$msg .= “second line of text in message: $variable n”;

//set up the mail

//$recipient = $email; //to whom it is being sent
//$subject = $subject; //this will appear in the subject line
//$mailheaders = “From: <[email protected]> n”;
//$mailheaders .= “Auto generated, do not reply”;

//send the mail
mail($recipient, $subject, $msg, $mailheaders);
?>[/code]

It sure seems to me like anyone can use it.
I’ve discovered that when I receive this email, and I reveal hidden headers, the email address that it is sent from will not accept email.

[QUOTE]

Received: from server302.com ([216.35.196.35]) by bay0-mc9-f10.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 31 May 2006 07:25:25 -0700
Received: (qmail 27742 invoked by uid 2069); 31 May 2006 14:18:41 -0000
X-Message-Info: txF49lGdW43v8sG5cYy4VG6SCajOUNeZVR5Fu25rhBA=
Return-Path: [email][email protected][/email]
X-OriginalArrivalTime: 31 May 2006 14:25:26.0270 (UTC) FILETIME=[0F57C1E0:01C684BE]

[/QUOTE]

That [email][email protected][/email] will not accept email. Which is fine, but can anyone else send email using this information?
Do I have any vunerabilities that I need to be aware of?

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@bokehMay 31.2006 — This is because certain details may be filled in by PHP, the webserver or the mailserver if they are not explicitly set by the script.
×

Success!

Help @anothen spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.21,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...