Results 1 to 6 of 6
  1. #1

    Automatically forwarding 1 mail to 2 or more people

    Hi,

    I need to forward some mails I recieve daily to both my email address and my assistants address.

    These are transaction notifications from another company so I can't use like a web form or something.

    I run redhat 7.2 and I configure my sendmail using my control panel which is webmin. But I could probably edit it by hand in ssh at a push.

    My host says he doesn't recall a way to do it, maybe some software is best but I don't want to spend a fortune on CRM software to some emails.

    thanks in advance

  2. #2
    Join Date
    Aug 2002
    Location
    London, UK
    Posts
    9,037
    use a mailing list program/script set it up to run so that mail sent to youraddress is sent to everyone on the list, then add the email addresses you want to receive the mailings as subscribers.
    Matt Wallis
    United Communications Limited
    High Performance Shared & Reseller | Managed VPS Cloud | Managed Dedicated
    UK www.unitedhosting.co.uk | US www.unitedhosting.com | Since 1998.

  3. #3
    Join Date
    May 2002
    Posts
    323
    #man aliases

    Man page for the aliases file. Should be in /etc/mail. You'd need to run newaliases after that, but I'm pretty sure webmin lets do all this (modify /etc/mail/aliases, run newaliases to recreate the database, and restart sendmail).

    From the aliases manpage:

    -----
    NAME
    aliases - aliases file for sendmail

    SYNOPSIS
    aliases

    DESCRIPTION
    This file describes user ID aliases used by /usr/sbin/sendmail. The file resides in /etc (*WARNING, this came from an old install. The file should be in /etc/mail) and is formatted as a series of lines of the form

    name: name_1, name2, name_3, . . .

    The name is the name to alias, and the name_n are the aliases for that name. Lines beginning with white space are continuation lines. Lines beginning with `#' are comments.

    Aliasing occurs only on local names. Loops can not occur, since no mes*sage will be sent to any person more than once.
    -----

    That's about it. It's really the easiest way to do it, as long as both users are local. I think the aliases mechanism is always part of sendmail, as opposed to the 'virtusertable' way that would allow you to send the message to a remote user, but might require you to recompile sendmail.

    I did, often, and beleive me, for the first time it's hours and hours of fun
    - prime [[email protected]]
    ExclaimHosting - Your voice on the web.
    Fast, reliable hosting, at prices you can afford.
    http://www.exclaimhosting.com

  4. #4
    Join Date
    Nov 2002
    Location
    North Yorkshire, England,
    Posts
    122
    Have a go connecting to your server by telnet/ssh.

    Enter the following commands ..

    cd ~
    pico .forward

    and then in that file list both e-mail addresses.

    No doubt there is a better way to do it, but that works for me

  5. #5
    Join Date
    Nov 2000
    Location
    Moran, Ks
    Posts
    186
    If you are wanting to forward all mail sent to one of your email addresses to two or more addresses/accounts it is much simpler than if you are wanting to forward mail from certain senders differently than other mail to that same address.

    What you probably want to do... (depending somewhat on your sendmail configuration) is to add an entry for the [email protected] you want to redirect in /etc/virtusertable, pointing to an alias (in /etc/mail/aliases) which will define the accounts and/or external addresses to which you want the mail forwarded.

    Example:

    ### in /etc/virtusertable ###

    [email protected] alias23


    ### in /etc/mail/aliases ###

    alias23: user2,[email protected],[email protected]


    you will need to rebuild virtusertable db and run newaliases for the changes to take effect. (I'm not how much of that webmin will take care of for you if you use webmin to make the changes) The example above would forward all mail sent to [email protected] to the three recipients specified by alias23. (the local user "user2", and joe and sally at their respective external addresses.

    If you instead want to handle mail from a specific sender separately that you do all other mail sent to the same address, this won't work, and you will need to pipe all of the mail through some kind of filter, such as procmail.

  6. #6
    Join Date
    Aug 2002
    Posts
    647
    jst defining the aliases in /etc/alias works for me, just separate the user accounts you wish ur mails to forward to with a comma, that's it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •