×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Sendmail config for inbound mail and redirecting them internally to ot

Sendmail config for inbound mail and redirecting them internally to ot

Sendmail config for inbound mail and redirecting them internally to ot

(OP)
Hi,

I have configured a sendmail MTA for incoming mails in a network and by using IPtables i have redirected the traffic internally to other port where one more SMTP by a application is running.

Iptables rule:

iptables -A INPUT -i eth0 -p tcp --dport 25 -j ACCEPT

iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 25 -j REDIRECT --to-port 25000

My sendmail config is as below.

Sendmail.mc

define(`SMART_HOST', `relay:host.subdomain.mydomain.com')dnl

dnl # define(`RELAY_MAILER',`esmtp')dnl
define(`RELAY_MAILER_ARGS', `TCP $h 25000')dnl
define(`ESMTP_MAILER_ARGS', `TCP $h 25000')dnl
dnl #
dnl # The following causes sendmail to only listen on the IPv4 loopback address
dnl # 127.0.0.1 and not on any other network devices. Remove the loopback
dnl # address restriction to accept email from the internet or intranet.
dnl #
DAEMON_OPTIONS(`Port=smtp,Addr= "my IP address", Name=MTA-public')dnl
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA-local')dnl

/etc/services file details

smtp 25/tcp mail
smtp 25/udp mail
submission 25000/tcp # submission
submission 25000/udp # submission



after sendmail config is done i am able to receive mails , but when i applied the iptables rule as above then the mails get reject and logs will give me an error as

dsn=5.0.0, stat= deffered service unavailable

and the bounce message shows

#5.0.0 SMTP; 554 Transaction failed> #SMTP#

I am not sure what i am missing here and what to do more to fix this.

RE: Sendmail config for inbound mail and redirecting them internally to ot

(OP)
one small thing is in the below command i missed "s" in ports.

iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 25 -j REDIRECT --to-ports 25000

Then the above steps are all corect and tested and working fine.

The issue what i faced is after setting everything the application SMTP had few issue, once they are fixed everything got fixed.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close