Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»General Articles»Postfix Forward Incoming Emails to Other Email Account

    Postfix Forward Incoming Emails to Other Email Account

    By RahulApril 5, 20222 Mins Read

    I am configuring my Linux system to accept incoming emails and forward them to needed email accounts. For this setup, the Ubuntu operating system is used with the postfix mail server. We can configure Postfix as mail forwarding server using the virtual_alias_maps settings.

    Advertisement

    This tutorial will help you to set up a postfix server to forward the email to other email accounts.

    Setup Mail Forwarding in Postfix

    Forwarding emails to remote mailboxes via Postfix does not require local mailboxes. Any email received by the Postfix will be routed to remote mailboxes based on configuration.

    Below example configuration will help you to configure example.com as mail forwarding domain on Postfix.

    Edit Postfix main.cf in editor:

    sudo vi /etc/postfix/main.cf 
    

    Add your mail forwarding domain to virtual_alias_domains and a configuration file with routing rules with virtual_alias_maps. You can add multiple virtual_alias_domains with space-separated.

    virtual_alias_domains = example.com tecadmin.net
    virtual_alias_maps = hash:/etc/postfix/virtual
    

    Next create and edit /etc/postfix/virtual file in editor:

    sudo vi /etc/postfix/virtual 
    

    Now add the Postfix email forwarding rules as per your requirements. Below is some example:

    1. Forward [email protected] emails to [email protected]
      [email protected]       [email protected] 
      
    2. Forwarding all the emails sent to any email id for domain example.com to [email protected]
      @example.com       [email protected] 
      
    3. Forward incoming emails to [email protected] to the local Unix root account.
      [email protected]       root
      

    Save and close the file. Next, create a hash file of the virtual and start postfix service.

    postmap /etc/postfix/virtual 
    service postfix restart 
    

    Conclusion

    In this tutorial, you have learned to configured Postfix to forward emails to other email accounts.

    mail Postfix
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    sleep Command in Linux with Examples

    20 Basic Linux Commands for the Beginners (Recommended)

    tail Command in Linux with Examples

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • 11 Practical Example of cat Command in Linux
    • sleep Command in Linux with Examples
    • 20 Basic Linux Commands for the Beginners (Recommended)
    • tail Command in Linux with Examples
    • What is a Orphan Process in Unix/Linux
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.