# Does locally configuring sendmail speed-up my mail transfer?



## michaelsanford (Aug 3, 2003)

I was just curious whether configuring my local sendmail will speed up sending outgoing email or not?

Also, would it work as a back-up SMTP server if my ISP's goes down, when I'm not at this computer (my personal comp's DNS-aliased).

I'm not at all familiar with mail routing, so if my sendmail just contacts my ISP's (i.e., the next hop's) SMTP server, I guess it would actually make it slower.

A general explaination of mail routing would be *much* appreciated as well.


----------



## Captain Code (Aug 3, 2003)

If your ISP blocks outgoing connections on port 25 like mine does, then you'll need to have sendmail send through your ISP's SMTP server rather than directly deliver it to the account you're sending to.

If the port isn't blocked, sendmail will do an MX(mail exchange) lookup through DNS, connect to the mail server for the domain you are sending to, and deliver the email to the correct mailbox directly, without going through any other hops(unless the remote machine is a sort of SMTP gateway*).

It can be faster to use your own server if your ISP has a slow, or very busy SMTP server, and it takes a while for your email to get sent.

To use your own server when you aren't at the computer, you will have to use something like SMTP AUTH, which I haven't setup before so I can't help with that.  What it does is authenticate you for sending email with your server, and stop it from being used to relay SPAM.
It's important that you setup sendmail to only allow you to send email from it.  Otherwise you may find yourself receiving an email from your ISP because people will complain about you sending them SPAM.

If your ISP is any good, they will have more than one SMTP server to accept mail from other ISPs and users, so if one goes down then they will still be able to receive your email.  SMTP is also not an "instant" type of thing.  The servers are setup to try to send usually for a few days until sending a bounce message if the SMTP server they are trying to send it is temporarily unavailable.  The server will usually be fixed by the time that wait period is up.

*what I mean by SMTP gateway is, sometimes very large ISP's will have a few SMTP machines that accept email for the domain, but don't hold the accounts on those machines.  They are used usually for spam/virus filtering because that can be a CPU intensive task.  
Those machines are setup so that they know where the accounts are and will send the email to those machines after they have been processed.


----------



## michaelsanford (Aug 3, 2003)

Cool CaptainCode thanks a lot, very informative.

And yeah I noticed sometimes when I send a message that's undeliverable because the recipiant's mailserver is down, I can have up to 3 days wait for a bounce.

How can I check (without calling and asking  ) if outgoing port 25 is blocked by my ISP: Telnet to my web server (which is at Level3-not on my ISPs network hehe) on port 25? Presumably if it is blocked then I might as well not bother setting up sendmail, right?

Out of curiosity, when I used to work for a hosting company back in '98-ish there was this things called the ORBS blacklist database (Open-Relay Broadcast System) that was supposed to help in SPAM prevention. Is that still in operation?

EDIT: Presumably this means it's blocked, but how can I tell whether it's m ISP or my remote server blocking it?

[amras@nimbus ~]% telnet mail.michaelsanford.com 25
Trying 63.209.115.4...
telnet: connect to address 63.209.115.4: Connection refused
telnet: Unable to connect to remote host


----------



## Captain Code (Aug 3, 2003)

It looks like you don't have port 25 blocked because you can at least reach the remote host on port 25.  I don't know why it would be refused, but when I telnet to it the connection hangs, so that means my port 25 is blocked outgoing.

ORBS is still around from what I know but I have never used it.


----------



## michaelsanford (Aug 3, 2003)

Yeah I assumed that 'could not contact remote host' meant that in fact the remote host was contacted, and the connection was refused.

I forgot that firewalled connections just hang, hehe, It's been a while since I had to try to get through one 

Thanks, I'll try to get sendmail configured and see what happens!

Incidentally, to use non-linux apps with sendmail (like Entourage) do I just configure 127.0.0.1 as my SMTP host?


----------



## Captain Code (Aug 3, 2003)

Yeah, you should be able to just use the loopback address or localhost to connect.


----------



## Eckhart (Aug 4, 2003)

To be sure about the firewall. Do 'nslookup', "set type=MX" and querry the mailexchanges for some domain, use google.com, why not. Tcp connect to it on 25 and tcpdump the packages on that interface. If you receive packages from any host port 25, you can be sure that your provider lets you use smtp to other hosts.

In any case, using your own stmp is only limitedly speeding things up. Any mail still wanders the way from your queue to some other mailserver, from where it is either directly or with another hop delivered. So you don't optimize traffic. It enhances reliability a bit - but only if your e-mail providers smtp really sucks... For some reason, I would then rather consider a change about the provider... 

Your own e-mail server even comes with disadvantages: While your ISPs servers are up any time, your workstation might not be. So if a mailserver on the internet was not reachable at one time, e-mail michgt remain lurking in your local queue while you are offline causing delays in delivery.

MOST IMPORTANT: If you decide to go for your personal smtp, make sure you entirely close it down for public with your firewall.

Btw, ORBS and alikes still are around. E.g. AOL and others check Open-Relay-Databases and reject e-mail from any server on those lists.


----------

