Gossamer Forum
Home : General : Perl Programming :

Another quick one...

Quote Reply
Another quick one...
I'm a busy little (well, big) boy aren't I?

Is it possible to create a POP3 mailbox using perl?

adam
Quote Reply
Re: Another quick one... In reply to
Adam,

Artificially speaking...Yes! But it wouldn't technically be a real POP3 account. Not with it's own email address and stuff. Unless you mean writing your own POP3 server in perl. Then I suppose it would be possible.

Strictly speaking though to create your own POP3 accounts you need administrative access to an email server. Which is where your POP accounts are stored.

If you want to be able to handle your own Email Accounts, you'll probably need Root access to your server so's you can install and compile an email server.

Well that's it...I wish I could help you more!

Rod
Quote Reply
Re: Another quick one... In reply to
Rod, (and you can explain phoule while you're at it too!)

Maybe I went a little bit *too* simple that time! Ok, here's what I want to do:

I have a pretty good web-based mailer, and I'll be offering it to my clients as a value-added extra for my services, that they can use to check their regular or catch-all accounts on the server.

*But*, and here's the thing, I would also like to use it on a couple of my sites as a Hotmail style service. So I would like to be able to have a user sign up for service, have the script create a POP3 mailbox for them (using the adduser command?) and away they go. And another related thing while I'm at it, I'd also like to create a web-based interface to the aliases and virtmaps, like on Hiway? Which means I'd need the permissions to edit them and use the newaliases or newvirtmaps command.

Now I've realised that one of the main problems is that I might have to run as root to use these commands, but if I thought it was possible, I'd have a chat with my host to see if they'd let me at it. I doubt it, but I've talked them into everything else so far, so I'm willing to chance my arm. The way I see it though, and correct me if I'm wrong, I can use the commands from telnet with my username, so surely I should be able to do it via the web, maybe using cgi-wrap or something? (Please, don't get complicated on cgi-wrap, I don't really understand it yet.)

What I need to know is if it's actually *possible* to send the commands through a web-based perl script?

Thanks,
adam
Quote Reply
Re: Another quick one... In reply to
Phule:

He is a self-made mega trillionaire...son to the owner of Phule Munitions the biggest company in the Galaxy!
Courtesy of Robert Aspirin, author of many excellent books...

I fancy myself to be capable of a similar succesful life story. Though that was before running across such powerful scripts like Links...But seeing a script like this pushes me further to my own goals!

Well enough about me! What you are talking is definately doable, I would recommend looking into Major-Domo. It is a mailing list manager extremely powerful...for your purposes there may be a whole bunch of Smile (The best kind) re-usable code to do what you are trying to accomplish.

Rod
Quote Reply
Re: Another quick one... In reply to
Adam,

Here's to the realization of dreams...
Smile

Branston he's Good...I love flying his old Airline too, and mmmm..the Air Hostesses are soo sweet!

[This message has been edited by phoule (edited April 11, 1999).]
Quote Reply
Re: Another quick one... In reply to
Rod,

I have Majordomo running on my machine, but MD doesn't actually create mailboxes, it just aliases them to the Majordomo program. And even the aliases part is run from the command line. If I could have the webmail program deal with the mail directly that would be grand, but it's a third party app and it retrieves the mail from a real POP3 mailbox. I don't have the capability to write an app myself that can do that, and even if I could, I've found that Perl is quite slow with an application like this (I also have MailMan by Endymion, which is pretty but slow).

I'll keep hunting the web...

Well, good luck with fame and fortune anyway, I'm probably much the same, although Richard Branson would be the man whose footsteps I'd like to follow in. Here's to dreams... Smile

Cheers,
adam
Quote Reply
Re: Another quick one... In reply to
Hi Adam,

POP boxes are really system dependant, so it's hard to tell without knowing the details of your system. Your main hurdle will be with permissions. What I've done in the pass is have your cgi program write a "pop request" file to a directory, and then have a script running in cron that will every hour or so create all the pops that have been requested. The script running in cron will have to run under root.

A lot of systems allow users to create their own aliases and redirects using a .aliases file or a .forward file. I would then have your script run under cgiwrap or SUexec so it can create the files under the users own permissions.

Hope this helps,

Alex
Quote Reply
Re: Another quick one... In reply to
 
I'll try creating a mailbox via cron and see if it works. I've avoided cron so far, so I'm running into uncharted territory, but hell I have to learn sometime right? Smile

My aliases and virtmaps are run by writing to a "aliases" or "virtmaps" file and running a "vnewaliases" or "vnewvirtmaps" command, which I presume then writes them to a database. I might try running this via cron as well.

Thanks again Alex, most helpful.