LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-15-2008, 05:44 PM   #1
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,336

Rep: Reputation: 54
Can someone explain SMTP


I can't seem to understand exactly how SMTP works, it wont click. Could someone help me understand?

These are my main questions:

1:
When I send email through a specific SMTP server, how does it know that my pop3/imap account is attached to that server? Like assuming open relay is off (which is the case in 99% of the time or spammers will use it) how does it deferient me from a spammer? For an ISP they can by by my IP range, but for like a web host that provides SMTP, for example.

2: When a SMTP accepts mail, what exactly does it do with it if the mail recipient is not on that server? Does it send it to the right SMTP the same way a client would, by checking the mx recard of @domain.com?

3: If I have a local SMTP server on my network (ex: postfix) can I make it use a different SMTP server depending on what the from: is? So if the from is my isp email, then it uses my ISP's server, if the from is another, it uses another server, if it's not listed, then it uses itself (local sending).

Hope I'm making sense. It's mostly 1 and 2 that I can't seem to find an answer no matter where I look. If you can even recommend books on SMTP it would be handy to have (I work for an ISP, so I want to understand this more) though web tutorials will do so I don't have to buy anything. Though a book will look nice on the office shelf. :P
 
Old 02-15-2008, 06:00 PM   #2
networkguru32
LQ Newbie
 
Registered: Feb 2008
Posts: 2

Rep: Reputation: 0
How SMTP works

I too work for an ISP and email seems to be what I work most. This is the way I understand it in reference to your questions.

1. There are basically two ways to send email. The first is if you have your own email server and the other is if you use an email client to a hosted solution. With the hosted solution, you set your email client to sent SMTP to the hosted server. If the server belongs to your ISP, they go by IP address. Additionally, you can set up SMTP authentication on the client, which will log you into the server to send email regardless of your IP. With your own email server, your server will query DNS for the MX records of the domain, then connect to that server. The server will verify that it handles email for the destination domain. If not, the connection is dropped. In addition, the HELO that your server sends is compared with a reverse DNS lookup of the IP that you connected from. They should match or your server may be considered a spammer. Some companies will go a step further and do a forward lookup for the entry they receive from the reverse, and if they don't match, they won't allow you to send SMTP.

2. If the server you connect to does not handle email from that domain, it should drop the connection. If it doesn't, it means it is an open relay server. Most ISPs to have a relay server, but they lock usage down on it to their IPs.

3. I'm not sure on the server side of things on this one. I do know that if you have multiple accounts set up on the Outlook client, a reply to an email will be sent on the account it was received on. New emails will be sent using the default account.

Hope this helps.

The Guru.
 
Old 02-15-2008, 06:42 PM   #3
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,336

Original Poster
Rep: Reputation: 54
Quote:
Originally Posted by networkguru32 View Post
I too work for an ISP and email seems to be what I work most. This is the way I understand it in reference to your questions.

1. There are basically two ways to send email. The first is if you have your own email server and the other is if you use an email client to a hosted solution. With the hosted solution, you set your email client to sent SMTP to the hosted server. If the server belongs to your ISP, they go by IP address. Additionally, you can set up SMTP authentication on the client, which will log you into the server to send email regardless of your IP. With your own email server, your server will query DNS for the MX records of the domain, then connect to that server. The server will verify that it handles email for the destination domain. If not, the connection is dropped. In addition, the HELO that your server sends is compared with a reverse DNS lookup of the IP that you connected from. They should match or your server may be considered a spammer. Some companies will go a step further and do a forward lookup for the entry they receive from the reverse, and if they don't match, they won't allow you to send SMTP.

2. If the server you connect to does not handle email from that domain, it should drop the connection. If it doesn't, it means it is an open relay server. Most ISPs to have a relay server, but they lock usage down on it to their IPs.

3. I'm not sure on the server side of things on this one. I do know that if you have multiple accounts set up on the Outlook client, a reply to an email will be sent on the account it was received on. New emails will be sent using the default account.

Hope this helps.

The Guru.


Yeah thats pretty much how I understand it. But I'm looking more at smtp such as my web host for example. I can use it, but how does it know that I'm actually a customer of that host, and that the email I'm sending is for an account on that hosting? I would figure it checks the from field, but thats not really good since spammers spoof those anyway so spammers would still be able to hijack web hosting smtps. Also I've never actually seen one use authentication (though I know it is possible)

And same here, email is like the #1 thing. when I get a customer that says "hi my internet is not working" I actually say "sweet!" in my head, since those are way easier to deal with.
 
Old 02-15-2008, 08:12 PM   #4
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Are you talking about gmail and so on? Gmail seems to require authentication to use their smtp

http://osdir.com/ml/user-groups.linu.../msg00003.html
 
Old 02-15-2008, 10:03 PM   #5
frndrfoe
Member
 
Registered: Jan 2008
Distribution: RHEL, CentOS, Ubuntu
Posts: 379

Rep: Reputation: 38
Quote:
Originally Posted by Red Squirrel View Post
how does it deferient me from a spammer? For an ISP they can by by my IP range, but for like a web host that provides SMTP, for example.
SMTP-Auth uses the PAM module that is configured, like local account or LDAP.

Quote:
2: When a SMTP accepts mail, what exactly does it do with it if the mail recipient is not on that server? Does it send it to the right SMTP the same way a client would, by checking the mx recard of @domain.com?
The client does not do any checking, it just relays the message from the server. The sending server does not do any checking either, it is the responsibility of the receiving server to handle and report errors regarding the destination address. The "relay" server only verifies that the sender is legitimate.

Quote:
3: If I have a local SMTP server on my network (ex: postfix) can I make it use a different SMTP server depending on what the from: is? So if the from is my isp email, then it uses my ISP's server, if the from is another, it uses another server, if it's not listed, then it uses itself (local sending).
You can setup sendmail to use a smathost, but i don't think it can be conditional. If you work for an ISP, why would you want this unless you are trying to spoof?

Quote:
so I don't have to buy anything. Though a book will look nice on the office shelf. :P
...must everything be free?

Last edited by frndrfoe; 02-15-2008 at 10:15 PM.
 
Old 02-16-2008, 11:09 AM   #6
daveginorge
Member
 
Registered: Oct 2006
Location: Porsgrunn, Norway
Distribution: CentOS 5 / 6 / 7
Posts: 107

Rep: Reputation: 16
With reference to the ISP side of the SMTP question. From the Norwegian way of working which no doubt is the same as the rest of the world.

Most ISP's will not relay port 25 traffic to other SMTP servers other than their own.

Some ISP's will make you use authorisation normally your pop credentials to send email.

Some ISP's will accept all traffic sent to port 25 with the understanding that to get access to there server you are using an IP address supplied by them, meaning that they have an details for all connections made and UIP addresses aquired. If someone has a wireless network and is stupid enough not lock then as far as the ISP is concerned the spammer is the registered user and port 25 will get blocked very quickly.
 
Old 02-16-2008, 01:03 PM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
not a networking question. moved to Linux - General.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can I use sendmail for SMTP instead of my ISP's SMTP server? fcdev Linux - Networking 1 02-05-2007 01:27 AM
SMTP "open relay" and SMTP AUTH aikempshall Linux - Security 3 10-11-2006 08:19 AM
Postfis SMTP forwarding and Incoming SMTP pheasand Linux - Software 0 04-27-2005 05:32 PM
Can Anyone Explain This? Tuzinor Linux - Hardware 8 10-27-2004 10:47 PM
SMTP and KMail and SMTP and Netscape Mail jazz... Linux - Newbie 5 10-11-2003 03:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration