System Account - Paid Account: Email Aliasing [entries|archive|friends|userinfo]
System Account

[ website | Scribbld Homepage ]
[ userinfo | scribbld userinfo ]
[ archive | journal archive ]

Paid Account: Email Aliasing [Jan. 29th, 2008|09:17 am]
Previous Entry Add to Memories Tell a Friend Next Entry
For Paid Account users -

I've setup email aliasing and it should be working, for anyone that has or is getting a paid account in the future, I will be using the email address in your profile to alias too, if you change your email address let me know so I can re-alias it!

Thanks!
LinkReply

Comments:
From: [info]squeaky
2008-01-29 05:10 pm (UTC)

(Link)

If you use postfix there is a way to use a mysql database as a virtual aliases location. Then you can actually have it query whatever the current address is so you wont have to manually keep it up to date.
[User Picture]From: [info]jimmy
2008-01-29 05:14 pm (UTC)

(Link)

Yeah, and I definitely want to and I found a post where I think Brad explained how to do it, and that's what I am going to try working on tonight because that would obviously be a much better solution. I am just not sure if there is anything else I have to configure in the LJ code, might you know?
From: [info]squeaky
2008-01-29 05:22 pm (UTC)

(Link)

There is a maint task called "makealiases" that you woudl need to run.

If you are familliar with the maint system, here is the code that I use, just drop it into $LJHOME/bin/maint/aliases.pl

#!/usr/bin/perl
#

$maint{'makealiases'} = sub
{
    my $dbh = LJ::get_dbh("master");
    foreach (keys %LJ::FIXED_ALIAS) {
        $dbh->do("REPLACE INTO email_aliases (alias, rcpt) VALUES (?,?)",
                 undef, "$_\@$LJ::USER_DOMAIN", $LJ::FIXED_ALIAS{$_});
    }
};

1;


And you can fill a hash with aliases for addresses that you want to be fixed ..

i.e.

%LJ::FIXED_ALIAS = (
                    'coppa','squeaky@localhost',
                    'accounts','squeaky@localhost',
                    'postmaster','squeaky@localhost'
                    );


in one of your local config files

Then whenever you get a user who pays, just enter them into the email_aliases table .. using whatever method you are using for paid users.

Then maybe write a nightly task to keep it up to date.

[User Picture]From: [info]jimmy
2008-01-29 05:29 pm (UTC)

(Link)

Alright that makes sense. Can I insert the %LJ::FIXED_ALIAS bit into my ljconfig.pl?

My payment system is wicked ghetto if you've not noticed. It's pretty much 100% manual, people have to email after they pay me with their account name and then I use the /admin/capedit.bml file to upgrade their account.

I could definitely use your help on how to automate this and rename tokens, I would love to reimburse you for your time if you want to help me. I did email you Sunday I think it was (maybe it was yesterday) about getting rename tokens to be more automated.

Anyways, thanks a lot :)
From: [info]squeaky
2008-01-29 05:36 pm (UTC)

(Link)

I reused a lot of the old old code from the ljcom repository before it was made to be closed source and it is highly customized. If I were you, I'd look at paylib.pl ljcom.pl and the htdocs/pay and htdocs/paidaccounts in the svn repository for clues on how to do this.

There is a LOT of code to get it working and now that the code is not under the GPL you can't just use it verbatim.
[User Picture]From: [info]jimmy
2008-01-29 05:40 pm (UTC)

(Link)

Yeah I have been looking at that code, but I know almost nothing about Perl, I can read it and understand what it's doing but I cannot write it for beans.

I remember you used to have CVS/repository up but I see it's no more :(
From: [info]squeaky
2008-01-29 05:58 pm (UTC)

(Link)

Yeah, I am eventually going to bring it back online, I just have way to much on my plate right now. Dealing with the influx of users has had me on my toes for months.
[User Picture]From: [info]jimmy
2008-01-29 06:01 pm (UTC)

(Link)

That would be awesome. Yeah I got hit pretty good because of GJ. I didn't even plan on my site being public, but hey, I won't complain!

You've definitely got to let me know when you bring it back online. I really need more automation :)