System Account - Paid Account: Email Aliasing
September 2010
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
 
Tue, Jan. 29th, 2008 09:17 am
Paid Account: Email Aliasing

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!

8CommentReplyAdd to MemoriesTell a Friend

squeaky
squeaky
Tue, Jan. 29th, 2008 06:10 pm (UTC)

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.


ReplyThread
jimmy
jimmy
jimmy
Tue, Jan. 29th, 2008 06:14 pm (UTC)

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?


ReplyThread Parent
squeaky
squeaky
Tue, Jan. 29th, 2008 06:22 pm (UTC)

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.


ReplyThread Parent
jimmy
jimmy
jimmy
Tue, Jan. 29th, 2008 06:29 pm (UTC)

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 :)


ReplyThread Parent
squeaky
squeaky
Tue, Jan. 29th, 2008 06:36 pm (UTC)

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.


ReplyThread Parent
jimmy
jimmy
jimmy
Tue, Jan. 29th, 2008 06:40 pm (UTC)

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 :(


ReplyThread Parent
squeaky
squeaky
Tue, Jan. 29th, 2008 06:58 pm (UTC)

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.


ReplyThread Parent
jimmy
jimmy
jimmy
Tue, Jan. 29th, 2008 07:01 pm (UTC)

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 :)


ReplyThread Parent