Can you send email using sendmail?

First of all, I'm sorry if the title is confusing or doesn't make any sense but I'm simply confused by the intricacies of this whole email technology. I read somewhere that you can send email using sendmail -it < mail but it only goes as far as the queuing list. I've formatted the mail file as below:
Code:
To: someemail@gmail.com
Subject: foobar
Mime-Version: 1.0
Content-Type: text/plain

Sample line

Can this actually be done on a machine from a home network or does it involves something else?
 
I'm afraid the mail is still stuck in the queue with message Deffered: Operation timed out with alt4.gmail-smtp.in.1.google.com. Did I messed up some configuration or something? Mind you i'm doing this on a personal machine from a home network with same made up domain name if that somehow be the reason none of this works.
 
First of all that hostname sounds quite weird to me, not sure how you came up with that one but it doesn't exist. These are the servers which handle GMails incoming e-mail:

Code:
;; QUESTION SECTION:
;gmail.com.                     IN      MX

;; ANSWER SECTION:
gmail.com.              1090    IN      MX      30 alt3.gmail-smtp-in.l.google.com.
gmail.com.              1090    IN      MX      20 alt2.gmail-smtp-in.l.google.com.
gmail.com.              1090    IN      MX      10 alt1.gmail-smtp-in.l.google.com.
gmail.com.              1090    IN      MX      5 gmail-smtp-in.l.google.com.
gmail.com.              1090    IN      MX      40 alt4.gmail-smtp-in.l.google.com.
But assuming that this was a typo then yeah: there's always a chance that some mailservers will refuse to accept e-mail from random hosts. Best way to check up on this is the mail logfile: /var/log/maillog.
 
But assuming that this was a typo then yeah: there's always a chance that some mailservers will refuse to accept e-mail from random hosts. Best way to check up on this is the mail logfile: /var/log/maillog.

You're right. I mistyped the hostname. The stat field from /var/log/maillog are all filled with Deffered: Operation timed out with alt4.gmail-smtp-in.1.google.com. I've sent a handful of emails by now but none made it past the server. I guess the mailserver won't accept some stray mail after all.

A little bit off topic here, would you be so kind to point me to any guide for setting up a local mailserver? The simplest one would do.
 
If I remember correctly, Google has some pretty strict rules about the sources they allow incoming email from. For example, I think Google's receivers reject email from IP addresses that are identified as consumer DHCP allocated. I know they watch for open relays and reject everything coming from those they identify.

If you point your sendmail config to your ISPs outbound relay servers, you may have better luck.
 
If I remember correctly, Google has some pretty strict rules about the sources they allow incoming email from. For example, I think Google's receivers reject email from IP addresses that are identified as consumer DHCP allocated. I know they watch for open relays and reject everything coming from those they identify.

If you point your sendmail config to your ISPs outbound relay servers, you may have better luck.

Yeah - gone are the days when I could direct-send any email with telnet :-( Back in the day, a lot of servers even facilitated this with long timeouts on commands. No more. A few bad apples ...
 
Google has some pretty strict rules about the sources they allow incoming email from.
Everybody has strict rules, not just Google, and you can forget getting accepted by anything Microsoft runs.

You need to set up SPF and DKIM using a real domain name with a static IP but that can get you into GMail and Yahoo. Our small clients have never broken through Outlook or Live or any of that other Microsoft stuff.
 
Back
Top