Iptables and email


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Iptables and email
# 1  
Old 11-05-2004
Iptables and email

Here's my story: I am using Red Hat 9.0 for iptables to set up port forwarding so that we do not need to rely on another company for external email services. This will mean that we will only need the one email server that we have.

I was told that we could not use the firewall that we already have(that would be too easy) to set this up, and we have the DMZ that will be in between the External and the Internal address spaces. My Iptables firewall has a NIC on the External and one on the DMZ. The email server that I am using has a NIC in the DMZ and one on the inside. My current iptables set up is such that it already allows me to receive email, but not send it:

# Generated by iptables-save v1.2.7a on Thu Nov 4 12:16:26 2004
*mangle
:PREROUTING ACCEPT [1734:141563]
:INPUT ACCEPT [1732:141467]
:FORWARD ACCEPT [2:96]
:OUTPUT ACCEPT [1726:140991]
:POSTROUTING ACCEPT [1728:141087]
COMMIT
# Completed on Thu Nov 4 12:16:26 2004
# Generated by iptables-save v1.2.7a on Thu Nov 4 12:16:26 2004
*filter
:INPUT ACCEPT [1732:141467]
:FORWARD ACCEPT [2:96]
:OUTPUT ACCEPT [1726:140991]
COMMIT
# Completed on Thu Nov 4 12:16:26 2004
# Generated by iptables-save v1.2.7a on Thu Nov 4 12:16:26 2004
*nat
:OUTPUT ACCEPT [0:0]
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A PREROUTING -d 124.36.33.67 -i eth0 -j DNAT --to-destination 192.33.2.45
COMMIT


I have tried setting up a POSTROUTING and an OUTPUT chain to help with sending email, but that has not done me any good. I also checked my routes on the email server, and they appear alright. I am using WEBMIN to configure iptables, as I am pretty weak with it. Any advice with configuring IPTABLES to send email would be appreciated.
# 2  
Old 11-05-2004
By the way, here is the iptable file that I have now, but while I can receive email, I cannot send it.

# Generated by iptables-save v1.2.7a on Thu Nov 4 12:16:26 2004
*mangle
:PREROUTING ACCEPT [1734:141563]
:INPUT ACCEPT [1732:141467]
:FORWARD ACCEPT [2:96]
:OUTPUT ACCEPT [1726:140991]
:POSTROUTING ACCEPT [1728:141087]
COMMIT
# Completed on Thu Nov 4 12:16:26 2004
# Generated by iptables-save v1.2.7a on Thu Nov 4 12:16:26 2004
*filter
:INPUT ACCEPT [1732:141467]
:FORWARD ACCEPT [2:96]
:OUTPUT ACCEPT [1726:140991]
COMMIT
# Completed on Thu Nov 4 12:16:26 2004
# Generated by iptables-save v1.2.7a on Thu Nov 4 12:16:26 2004
*nat
:OUTPUT ACCEPT [0:0]
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A PREROUTING -d 124.36.33.67 -i eth0 -j DNAT --to-destination 192.33.2.45
-A POSTROUTING -p tcp -m tcp -s 124.36.33.67 -o eth0 --sport 25 -j SNAT --to-s
ource 192.33.2.45
COMMIT


Again, thanks for any help.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Getting email output in single line with out space in email

I have tried below email method and i am getting every thing in single line . i have put echo to provide space, but it is not helping my code ( echo "From: $FROM" echo "To: $MAILTO" echo "CC: $CC" echo "Subject: $SUBJECT" echo "MIME-Version: 1.0" echo 'Content-Type: multipart/mixed;... (6 Replies)
Discussion started by: mirwasim
6 Replies

2. SuSE

Send outgoing email to my GroupWise email

Dear users, I have Linux server whose versions are Suse 10 SP 3 and Suse 11. I am trying to send email from these servers to my GroupWise email account. In /etc/postfix/main.cf file, The current value of MYHOSTNAME is LINUX.LOCAL. What should be the right value of MYHOSTNAME? Is... (0 Replies)
Discussion started by: JDBA
0 Replies

3. Shell Programming and Scripting

Using top command to email if process is exceeding 25% and sending an email alert if so

This is my first time writing a script and Im having some trouble, Im trying to use the top command to monitor processes and the amount of CPU usage they require, my aim is to get an email if a process takes over a certain percentage of CPU usage I tried grep Obviosly that hasnt worked, Any... (8 Replies)
Discussion started by: jay02
8 Replies

4. Shell Programming and Scripting

Trying to email text, getting blank email

Hello, and thank you for help in advance, i seem to have this script working, except for the email part, it sends me a blank email, am i not redirecting the output of my text file the right way? #!/usr/bin/ksh rm installed_zones.txt installed=/home/xxx/stuff/installed_zones.txt for... (3 Replies)
Discussion started by: BG_JrAdmin
3 Replies

5. UNIX for Dummies Questions & Answers

new to ldap, send email to a ou or group, and see a list from email client

hi, i'm running openldap on ubuntu 10.04, creating new items with apache directory studio (windows version). i use the ldap just as an address book to our small office (email clients are windows live mail 2009, 2011, microsoft outlook 2007 and 2010). a. i cant see a list of the contacts,... (0 Replies)
Discussion started by: V4705
0 Replies

6. Solaris

Send an email from Solaris using Linux email server

Hello everyone I have a problem and I need your help: I have a Solaris 10 and Solaris 8 UNIX Servers, and Linux Centos4 as email server. I need send an email from Solaris servers preferably using Centos4 email server. I have no mail service configured in my Solaris computers (1 Reply)
Discussion started by: aflores
1 Replies

7. UNIX for Dummies Questions & Answers

Send email where # is in the email address - Using Unix

Hi All, How do I send an email using malix where email address contains a #. I have a email address like this : #test@test.com I want to send email like malix -s "TEST" #test@test.com < SOMEFILE I tried \# but doesn't work. Please let me know how we can achieve this? I am in... (1 Reply)
Discussion started by: jingi1234
1 Replies

8. UNIX for Advanced & Expert Users

Unable to send eMail from a UNIX-Host ( using mailx ) to a Outlook-email-addres(Win)

Hi A) I am able to send eMail using mailx from a UNIX ( solaris 8 ) host to my Outlook-email-ID : FName.Surname@Citigroup.com ( This is NOT my actual -eMail-ID). But in Outlook the "From :" eMail address is displayed as " usr1@unix-host1.unregistered.email.citicorp.com " .i.e the words... (2 Replies)
Discussion started by: Vetrivela
2 Replies
Login or Register to Ask a Question