I did something similar to an e-mail redirection system I wrote a couple of years ago. Basically when they signed up (via the web), a random ID string was assigned to them and stored along with their database record. An e-mail was then dispatched saying to reply to the message. I set the From/Reply-To address to an address that was procmailed and fed the e-mails into another script that examined it, looked for the ID string, and if it matched the user contained in the message, it would flag them as validated and send off a second welcome message. The "ID" string was actually a concatenation of their username and the random key they were assigned, so it was easy to break apart and compare in the database.

Others have mentioned sending them a URL with a key embedded might work just as well, and I'd have to agree, but IMO replying to an e-mail is a lot easier than cutting/pasting a URL, though since most people nowadays use HTML-aware GUI e-mail clients, that's not such a big deal anymore. I just like keeping everything in one application. If they're going to be validated by e-mail, let them do it all by e-mail (especially if it's as easy as a simple reply). Don't make them start up a web browser session just to complete the process. *shrug*. Personal taste.

Regardless, the system has been running for about 2 years and is entirely automated with a few hundred users (not big, but it's for a select group of members). It's nice being able to code something that's entirely maintenance-free, which is what an automated verification system like this provides!

Unfortunately I'm not aware of any Perl modules to help automate this task, aside from the standard SMTP or Sendmail abstraction modules. Regardless, it's not too complex, and if you go the procmail route, a simple procmail rule will get the contents of the e-mail message sent to the STDIN of your script. Easy to parse.


In reply to RE: Mail-reply user registration by Fastolfe
in thread Mail-reply user registration by athomason

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.