SMTP forward/relay

Discussion in 'Tomato Firmware' started by laxxe, May 16, 2007.

  1. laxxe

    laxxe Network Guru Member

    I'm setting up a network, which will be used by many different people - with different PCs. Their PCs are setup with their SMTP server from their ISP - and maybe they can't send mails "out of the box", when using this network.

    Is there some way, I can forward all SMTP traffic to the SMTP server from the networks ISP?

    If it's not possible to forward SMTP traffic, is it then possible to forward some domain names (SMTP servers from the users PCs) to the networks SMTP server?
  2. ifican

    ifican Network Guru Member

    I suppose this might be possible if you ran your own server then forwarded the traffic, but there is no way that i know of to do this via the router.
  3. paped

    paped LI Guru Member

    From what you are saying you have multiple pc's on the local network sending mail via smtp to multiple ISP's, I mention "sending" as all ISP's I have ever seen use POP3 inbound mail from the ISP's server to the mail client, as such smtp is outgoing traffic thus the router will handle this without any "forwarding" being required. The only time you need to forward smtp traffic would be if the server was on the local network and you needed mail from the internet to terminate on your mail server, then you would need to forward port 25 (normally) to the mail server's Ip address. Re pop3 mentioned earlier again this would be seen as outbound mail and normally needs no forwarding even though the mail is coming in to your local network to the email clients, as the mail clients (outlook etc) have to request this so the router see's the outgoing request and should allow the associated inbound email in to the network/client....
  4. laxxe

    laxxe Network Guru Member

    I'm pretty sure it's possible also when not using a local SMTP server.

    Visitors have different PCs, with different setups and SMTP servers. When using ISP A, you can't use ISP B's SMTP-server. The visitors will have to change the settings in the mail program - and many doesn't know how to do that.

    It doesn't have anything to do with POP3 - which always works fine.

    SMTP is outgoing (in this case), and it's the outgoing SMTP traffic I want to forward to ISP X's SMTP server - even when the PC is setup to use ISP A/B/C's SMTP server.

    It doesn't matter how this is done - I just want the visitors to be able to send mail, without having to change the settings in their mail programs.
  5. ifican

    ifican Network Guru Member

    I understand what you want to do, the issue is going to be getting the domain resolved and forwarded properly. Your isp can care less what any other isp's mail is doing unless it is sent to or directly from your isp. I guess whats left out of the equation is basically what paped said: if your users are using pop3 then there will be no issue, but if they are using exchange or some other proprietary email client then its not going to work unless you take care of the forwarding for them. You know i have to step back for just a minute, and say it this way, will this and can this work yes, but the email server has to be open and allow forwarding from users outside the domain. This unfortunately is not the case anymore because of spammers, networks now shut down and lock out any mail traffic that is suppose to be generated on domain from coming in from the outside and being forwarded on.
  6. laxxe

    laxxe Network Guru Member

    I don't know, why you're talking about POP3. I don't think that matters at all - it's the SMTP server, that should "change".

    The network I'm setting up, is using ISP X. The users use ISP A, B, C, D etc. They have setup their PCs to use ISP A, or ISP or, or... I want to forward all SMTP traffic on my network - to use ISP X's SMTP server - even when the users have setup their mail programs to use ISP A, B, C or D... That should of course work (it doesn't require any open relays) - but I don't know how to do it...

    I'm pretty sure, that 99% of the users that will use this network, isn't using Exchange, and the 1% can fix the setup themselves, if they need to.
  7. ifican

    ifican Network Guru Member

    The reason pop gets brought up is because its the easiest for everyone. And from all of your replies it appears that you want users to use your isp's email server. What we are saying is your isp is not going to allow user to send mail via isp-x outgoing mail server. You can of course do this if you want to setup mail accounts for everyones on your account, but isp-x is only going to allow users from to be processed as outgoing smtp request from their server. From all the posting this is what it sounds like you want to do and from the angle the question has been answered. Let me explain it this way, i have, you can come over here and send and receive pop mail allday without issue, however if you input your email account and try to use my server, your request will be rejected (assuming you dont have email).
  8. snwbdr

    snwbdr Network Guru Member

    What you are saying is when someone let's say on gmail wants to send out an email to on port 587 using TLS encryption with your visitors username and your visitors password to be fowarded to let's say your comcast account at on port 25 no encryption with your username and your password. Do you see where I am going here. That is just two smtp servers.
  9. laxxe

    laxxe Network Guru Member

    I see - and know I understand why we didn't understood eachother!

    This is simply not how it works in Denmark. If you're connected to ISP X, you can always send mails using their SMTP server - using any email address you want. I'm glad this is possible, since I use many different mail adresses (one for private mail, one for my company, one for my...)

    I only want to forward the "standard" SMTP port (25 - without encryption of course).

    When a visitor tries to send mail using his ISPs SMTP server, he will get an error. He should change his SMTP server, but many of the visitors doesn't know how to do this - that's why I want SMTP traffic to be "redirected".

    Two ways:
    1) All traffic on port 25 (no matter what the SMTP server is) will be redirected.
    2) Traffic to all servers I decide (the largest ISP's SMTP servers) will be redirected.

    I don't know which one that's possible and/or which one that's the easiest/smartest.
  10. ifican

    ifican Network Guru Member

    Yes now it does all make sense. Unfortunately i cant think of anyway to do that from a router level. Perhaps one of the server admin types could tell you otherwise, but my guess would be that it would have to be application based. I could tell you how to forward just port 25 to a particular ip but not via this level of equipment. I dont know of any soho or soho designed devices that allow directing of outgoing ports.
  11. affer

    affer LI Guru Member

    To do this, you're either going to have to leave your smtp relay open (so use a VPN, etc to it) or use a packet processing application to strip the smtp server information from mail & replace it with appropriate information to access your network's smtp server.

    Depending on the email applications used, it might be enough to use router port forwarding to redirect smtp (port 25) traffic to the ip of your smtp server. But more than likely, you will have to setup a linux box or find an application that can process packets (change the smtp server address & login info) on outgoing mail.
  12. ifican

    ifican Network Guru Member

    The only issue with this is you would have to have a really funky setup with router wan ports back to back and then try to figure out how to pass normal traffic. The smtp traffic is from the lan side out, not from the wan side in so theres no way to port forward the traffic.
  13. laxxe

    laxxe Network Guru Member

    I don't need to login to the SMTP server - it will accept all connections (and all email adresses), as long as the connection is from an IP that belongs to the ISP!

    Isn't it possible to use a solution like a hosts file? Every connection to should be forwarded to the IP of another ISP (the one that the network uses). Then I can make entries for the most used ISP's in Denmark (there's not so many).
  14. ifican

    ifican Network Guru Member

    Hmmmm, i have used host files for name/domain resolution but i dont know if you can use it for ports. And how would you go about setting each host file on each users machine? I dont know of anyway to create a host file on the router. If you get one of the linux iptables types, i am sure they can tell you how to write a rule to inspect all traffic for port 25 the only problem is i dont know how you would tell it to redirect that traffic.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice