Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Setting up a Mail alias

  • 28-05-2002 2:11pm
    #1
    Registered Users, Registered Users 2 Posts: 14,153 ✭✭✭✭


    A question if I may.

    I'm trying to set up an alias (eg. name2@mailaddress.com) for an existing user (eg. name1@mailaddress.com).

    I'm using sendmail under RH 7.2 (which I have no choice over, so don't say "use another distro" :p ).

    I'm unsure as to how to go about this. I can see the /etc/aliases file, but is this reading from other files for mail addresses or can I simply put the alias email address into this file, and then rebuild alisases.db


Comments

  • Closed Accounts Posts: 6,601 ✭✭✭Kali


    add it to /etc/aliases then just run newaliases.. depending on how sendmail is setup it could do it itself with a simple restart tho..


  • Registered Users, Registered Users 2 Posts: 1,862 ✭✭✭flamegrill


    it depends, u can use /etc/mail/virtusertable to add these kinds of aliases, or you can use the aliases file. so an entry would be like:

    user@doamin.tld: somename@hotmail.com

    in the aliases file, and in the etc/mail/virtusertable they are very similar but without the :

    so:

    user@doamin.tld somename@hotmail.com
    it can also do:

    @domain.tld root # this is a "catch all" email address

    Hope this helps, newaliases rebuilds the aliases file, and something like "hash -o /etc/mail/virtusertable" will make the db for the other option, but thats usually in the sendmail.cf config in either /etc or /etc/mail.

    Sendmail is your friend dont ph33r it. :)


    Regards,

    Paul


  • Registered Users, Registered Users 2 Posts: 14,153 ✭✭✭✭Lemming


    Originally posted by flamegrill

    Sendmail is your friend dont ph33r it

    Until you see the size of the README file and go "oh dear god!!..." :D

    Cheers lads. I'll have a looksie at what you're all suggesting and let ye know how it goes! :)


  • Registered Users, Registered Users 2 Posts: 14,153 ✭✭✭✭Lemming


    ANother question just before I do anything here .....

    say the actual email address names are:

    name@address.com

    and I want to set up an aliasname of aliasname@address.com to point to the first address too.

    in the /etc/aliases file I'm seeing settings such as name1 : name2 (without the @address.com bit after them).

    My question is this. Is sendmail reading these full email addresses off of another file, or is there a setting somewhere that says all addresses inside this system are "@address.com" ??

    Do I just put in a line reading as "name: aliasname", or can I put in the full email addresses? :-/


  • Closed Accounts Posts: 6,601 ✭✭✭Kali


    sendmail automatically picks up on the correct domain name iirc.. (most likely from /etc/hosts).. although you can change this manually in sendmail.cf but its not reccomended.


  • Advertisement
  • Banned (with Prison Access) Posts: 16,659 ✭✭✭✭dahamsta


    The aliases file is used /only/ for mapping system users, so you can put a full email address on the right-hand side, but not on the left. For example, if you have two domains, 'example.com' and 'example2.com', and you have a mapping for 'user', mail to both domain names will be caught by the 'user' mapping. If you want to map them to separate addresses, you need to use the virtusertable, in which you can put addresses on both sides.

    The Red Hat docs are pretty good.

    adam


  • Registered Users, Registered Users 2 Posts: 14,153 ✭✭✭✭Lemming


    Originally posted by dahamsta
    The aliases file is used /only/ for mapping system users, so you can put a full email address on the right-hand side, but not on the left. For example, if you have two domains, 'example.com' and 'example2.com', and you have a mapping for 'user', mail to both domain names will be caught by the 'user' mapping. If you want to map them to separate addresses, you need to use the virtusertable, in which you can put addresses on both sides.

    The Red Hat docs are pretty good.

    adam


    Dahamsta strikes again!! :D

    Ok, let me get this right (before I go trudging through the rh docs.

    I have an address (name1@address.com). I want to make an alias address to direct to "name1", which will be "alias@address.com"

    In the /etc/aliases file, if I put in:

    name1 : alias@address.com

    is it correct?

    (bearing mind that alias@address.com doesn't actually exist as such. It would merely be a pointer, and not a redirect of another mail account to "name1")


  • Closed Accounts Posts: 6,601 ✭✭✭Kali


    as long as the two address.com are the same then /etc/alias will work... but you don't need to specify the domain.

    just add the following to the file...

    #sends mail to fakeuser@mydomain.com to realuser@mydomain.com
    fakeuser: realuser


    (btw you posted them the wrong way round :) )


  • Registered Users, Registered Users 2 Posts: 14,153 ✭✭✭✭Lemming


    Thanx lads!! :) Much appreciated
    Originally posted by kali

    btw you posted them the wrong way round

    Oh well .. I guess that Linux Certification exam is out of the question any time soon so ;):D


  • Registered Users, Registered Users 2 Posts: 14,153 ✭✭✭✭Lemming


    Oops ..

    got a(nother) question here (it's not my fault .. really .. people just came back to me and asked for it)

    can the same alias be given to multiple users, or will I need to set up a mailinglist for that (or some such)?

    Is there any particular syntax like:
    aliasuser: realuser1; realuser2


  • Advertisement
  • Banned (with Prison Access) Posts: 16,659 ✭✭✭✭dahamsta


    can the same alias be given to multiple users, or will I need to set up a mailinglist for that (or some such)?

    Is there any particular syntax like:
    aliasuser: realuser1; realuser2
    The syntax is wrong there anyway, the users on the right should be separated by a comma. With that example, mail for aliasuser@domain will be redirected by Sendmail to realuser1 and realuser2. If you want to use the same username@muliple.domains, you need to use the virtusertable.

    `man aliases` for details on the aliases file.

    adam


Advertisement