Basically, it allows you to enter an email address for a user, and get a dated. In my case, Apache runs as the vpopmail user, so YMMV.
Demo is up at http://doacafe.com/contact.php, use the user cyt0plas, and the domain doacafe.com
TinyURL is simply a shorter version of the URL, and Contact URL allows you to direct-link the page without making the email easily visible. Example: http://doacafe.com/contact.php?user=Y3l0MHBsYXM=&domain=ZG9hY2FmZS5jb20=
and http://tinyurl.com/25w4q
===== Begin Script =====
<?php
define('PAGE_TITLE','Contact a User');
?>
<html>
<head>
<title><?=PAGE_TITLE?></title>
<link rel="stylesheet" type="text/css" href="/includes/common.css" media="all" />
</head>
<body>
<div>
<h1><?=PAGE_TITLE?></h1>
<p>This form allows you to contact one of our users. Please do not use it to spam.<br />
Yes, the email probably looks long and funky. Don't worry, it's just for anti-spam purposes.</p>
<?php
if ($_GET['user']) {
// decode the email
$_POST['user'] = base64_decode($_GET['user']);
$_POST['domain'] = base64_decode($_GET['domain']);
} else {
?>
<p><form action="<?=$_SERVER['PHP_SELF']?>" method="post">
<input name="user" value="<?=htmlspecialchars($_POST['user'])?>" /> @
<input name="domain" value="<?=htmlspecialchars($_POST['domain'])?>" /><br />
<br />
<input type="submit"></form></p>
<?
}
if ($_POST['user']) {
// OK, a username was specified.
// Check that the user exists, and uses tmda
$tmdadir = '/home/vpopmail/domains/' . basename($_POST['domain']) . '/' . basename($_POST['user']) . '/.tmda';
$config = $tmdadir . '/config';
if (!file_exists($config)) {
echo "Invalid user or domain.";
} else {
$command = '/usr/share/toaster/tmda-1.0.2/bin/tmda-address -c ' . escapeshellarg ($config) . ' -a ' .
escapeshellarg ($_POST['user'] . '@' . $_POST['domain']);
$email = trim(`$command`);
echo (sprintf('<p>Use this email address: <a href="%s">%s</a>.</p>', $email, $email));
// "encode" the User/Pass, and gen a url
$url = (sprintf('http://%s%s?user=%s&domain=%s',
$_SERVER['HTTP_HOST'], $_SERVER['PHP_SELF'],
base64_encode($_POST['user']), base64_encode($_POST['domain']) ));
if (!$_GET['user'])
echo sprintf ('<p>Use this URL to direct link: <a href="%s">URL</a> | <a href="%s">TinyURL</a></p>',
$url, 'http://tinyurl.com/create.php?url=' . $url);
}
}
?>
<br />
</div>
</body>
</html>
smime.p7s
Description: S/MIME Cryptographic Signature
_____________________________________________ tmda-users mailing list ([EMAIL PROTECTED]) http://tmda.net/lists/listinfo/tmda-users
