The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Old "aliases" file needs to be converted to cpanel's forwards file...

Discussion in 'General Discussion' started by dead.org, Oct 19, 2004.

  1. dead.org

    dead.org Member

    Joined:
    Oct 19, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    I live in Topeka, Kansas, United States of America
    Hi I'm the new admin at dead.org I just picked this domain up from the last owner and he had a script that would when someone wanted an email forwarder they would fill out a form still viewable from the website (www.dead.org) just click on freemail.

    Well I'm not really too concerned with forwarding anymore, as I would like to get a new mail subsection going where users can create there own pop3 accounts and manage em' by themselves such as setting up there own forwarders, auto-responders, etc.

    But what does concern me is the previous 1-2k users that are in this (/etc/aliases *nix format) aliases file. I need some type of script to import this aliases file into the cpanels interface for it's forwarding option. I don't know if it's some type of database or what. I'm not good at scripting let alone programming so I thought I would ask here, and see if anyone knew how to interface with cpanels forwarder file.

    The aliases file looks like as follows:

    aliaschosen: realemail@domain.tld
    aliaschosen2: realemail@domain.tld
    aliaschosen3: realemail@domain.tld
    ...
    and so on forever!!!

    Somehow his previous mail server new that any mail routed to it with one of those alias names would get automatically forwarded to the users realemail@domain.tld. I don't really know how to set that up again, let alone import these thousands of emails into the cpanel which is what I would sorda like, that way I could prune the list as I see fit.

    If someone is bored and capable and wouldn't mind helping me out I sure would appreciate it.
    ***Disclaimer*** If you happen to goto http://www.dead.org and you are offended by the content, I don't really have anything to do with that, I'm just the "current" owner/admin for the time being. It's nothing like a rotten.com just some morbid poetry, and information about ways to die, hopefully it will become mostly a poetry site. So try and keep the remarks regarding the site to a minimum ;) thanks

    Matthew Holevinski
    admin@dead.org
    eylusion@yahoo.com
     
  2. dead.org

    dead.org Member

    Joined:
    Oct 19, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    I live in Topeka, Kansas, United States of America
    I guess no one knows what I am talking about :)

    What a bummer it's been a few hours and I don't think anyone has even viewed this post yet... I guess i'll just keep waiting... :cool:
     
  3. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    You might need to be patient - it's been a busy 36 hours on these forums ;)

    Anyway, on a cPanel server, the aliases are stored in:

    /etc/valiases/domain

    The format of your aliases file appears to be in the same format as required in the valiases files, so it is probably just a matter of copying the entries in the relevant domains file in /etc/valiases/

    Btw, I liked the site :)
     
  4. SarcNBit

    SarcNBit Well-Known Member

    Joined:
    Oct 14, 2003
    Messages:
    1,010
    Likes Received:
    3
    Trophy Points:
    38
    Don't trust the view count on this board. It does not work correctly :eek:

    The aliases are stored in /etc/valiases/domain.tld

    This post has an example of how the entries need to appear.

    Make sure you search before posting! :)
     
  5. SarcNBit

    SarcNBit Well-Known Member

    Joined:
    Oct 14, 2003
    Messages:
    1,010
    Likes Received:
    3
    Trophy Points:
    38
    Damn chirpy sneaking in on me! :p

    All of our valias files contain 'full address : full address' not just 'alias : full address'. I am unclear if your current file has full addresses or not. I have not tested to see if it works without a full address to the left of the colon.
     
  6. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Got to keep on your toes in these forums now ;)

    I think you might be right in needing a full email address as the first parameter. A simple search an replace on : would easily fix that, though.
     
  7. dead.org

    dead.org Member

    Joined:
    Oct 19, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    I live in Topeka, Kansas, United States of America
    A find and replace would probably be alittle too difficult

    It's true it's not email@dead.org: useremail@domain.tld
    currently the aliases file is just that an alias aliasnick: useremail@domain.tld...

    I don't believe I have access to that directory because I am indeed an end user on this server my friend who owns the server could place it there but i figure if there is such a way to find/replace the first "<nick>:" before the users emailaddress directly after and append an @dead.org he could probably just pipe the contents of my aliases file into his.

    Something about that doesn't sound right though, let's say hypothetically this was my server and my aliases file was in the format of user@dead.org: user@email.tld and it would be a simple append command to put my aliases into that valias file then would it show up as forwards in the cpanel. (hope that made sense)

    You guys rock, thank you so much for the posts, you have been very informative and helpful as well as positive, it's really nice getting those kinda responses.

    And to the one gentleman that mentioned he liked the site I appreciate that too, thanks :)
    It used to be ran YEARS ago, but was taken offline but I kept the site admins email and mailed him the other day and he was like ya, let's try and get it back up and running so that's what I'm doing, hopefully a re-design won't take us too long.

    God what I wouldn't give to be able to program scripts, and macro's, and things of that nature that would be soooooooo nice, I could automate myself right out of a darn job!

    I assume since this is the Scripting thread you guys know a thing or two about scripting and programming scripts, just off topic do you think www.elementk.com would be a good place to start with some languages, I've programmed on and off through the years but never seriously, and it was all very broad never focused on just one language so I never specialized. But i'm familiar with coding and compiling and the likes but kinda flustered when it comes to finding a place to start. I figure something like perl in an *nix environment would be the best but still unsure.

    Thanks for Everything,
    Matt

    ***EDIT***
    Ohh hell!!!! /etc/valiases/domain, okay that sounds right that way the aliases file would be specific to my domain, I guess I have a tendency to glance over stuff. YAY, okay so somehow get this aliases file into that valiases/deadorg directory and I'm homefree given it's in the correct format, and still don't know if it would show up under cpanel's interface in the email forwarding page.
     
    #7 dead.org, Oct 19, 2004
    Last edited: Oct 19, 2004
  8. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Hi Matt,
    Yup, that's it. cPanel just reads the contents of that valiases file. I'd ask your admin and give him a lollipop for his efforts ;)

    I've been programming for, oooh, around 25 years now (I started young, BTW!). My language of choice now is perl. What language you choose, really does depend on what you want to do with it.

    For example, if you want to do MySQL back-end web sites with pretty and powerful front-ends, the PHP might be your choice.

    If you want an all purpose language that you can write server back-end scripts and dynamic web comtent, then perl might be a better bet.

    If you want to develop client based applications, then there's a wealth of options in Java, C++, VB, and the list goes on.

    At the end of the day, a programming language is just a matter of getting the damn PC to do what you want it to. The real skill is learning how to use that language for your own means, which does take time, experience and above all, enthusiasm.

    Your greatest source for learning, is other peoples scripts together with a good course on how to program in a language that you would like to use to achieve something with now.

    Just my 2p worth.
     
  9. dead.org

    dead.org Member

    Joined:
    Oct 19, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    I live in Topeka, Kansas, United States of America
    dually noted

    touche', I agree with everything u said.

    Much obliged and I guess you can consider this thread closed :) I'm gonna go home and get my aliases file formatted correctly and placed into that directly thanks for all the help guys.

    Have a Good One,
    Matt

    5pm i'm clocking the hell out
     
  10. SarcNBit

    SarcNBit Well-Known Member

    Joined:
    Oct 14, 2003
    Messages:
    1,010
    Likes Received:
    3
    Trophy Points:
    38
    Please do not be confused. The file name would be dead.org and the directory would be /etc/valiases/ :)

    You have to make sure that the file is chown'd correctly (accountname.mail) if you are going to replace it. Your server admin should be able to take care of that no problem if they are willing to load the file for you.
     
  11. SarcNBit

    SarcNBit Well-Known Member

    Joined:
    Oct 14, 2003
    Messages:
    1,010
    Likes Received:
    3
    Trophy Points:
    38
    Maybe sysadmin work isn't right for you :D :p
     
  12. dead.org

    dead.org Member

    Joined:
    Oct 19, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    I live in Topeka, Kansas, United States of America
    Comprehension

    Ya, I understood you guys perfectly. I didn't repeat it back as well but I understood that /etc/valiases was the dir and dead.org was the file, either way nothing alittle cat aliases > echo > dead.org couldn't solve.
    My aliases format was user: useremail@domain.tld, but I got it fixed to user@dead.org: useremail@domain.tld. So everything is fine now and working wonderfully..



    ...
    ...

    Except that who know's how many of these forwards no longer goto valid addresses anymore... Ohh wo-uhz mee.....

    Thanks tho'!
    Matt
     
Loading...

Share This Page