Simple IPTABLES question - accept mail only from select IP addresses

Posted on 2006-04-11
Last Modified: 2011-04-14

I need to add rules to my snapgear firewall (Linux version 2.4.20-uc0 - ColdFire) to accept mail from only a select few IP addresses, what are the IPTABLES commands I need to add?

This would be very easy using destination NAT, but our firewall is rather old....

Thanks in advance!
Question by:omniumnetworking
    LVL 51

    Accepted Solution

    iptables -I FORWARD -p tcp -s selected-IP --dport 25 -j ACCEPT
    iptables -I FORWARD -p tcp -d selected-IP --sport 25 -j ACCEPT
    # assuming your firewall is not the MTA itself

    Author Comment


    I will check this out and post back.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    ​Being a Managed Services Provider (MSP) has presented you  with challenges in the past— and by meeting those challenges you’ve reaped the rewards of success.  In 2014, challenges and rewards remain; but as the Internet and business environment evol…
    BIND is the most widely used Name Server. A Name Server is the one that translates a site name to it's IP address. There is a new bug in BIND (, affecting all versions of BIND 9 from BIND 9.1.0 (inclusive) thro…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now