Can you send email using sendmail?

asys

Member

Reaction score: 2
Messages: 38

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?
 

ShelLuser

Son of Beastie

Reaction score: 2,097
Messages: 3,790

Look into mail(1) instead.

So going for your example above:

echo "Sample line" | mail -s foobar someemail@gmail.com, and done.
 
OP
asys

asys

Member

Reaction score: 2
Messages: 38

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.
 

ShelLuser

Son of Beastie

Reaction score: 2,097
Messages: 3,790

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.
 
OP
asys

asys

Member

Reaction score: 2
Messages: 38

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.
 

ekingston

Active Member

Reaction score: 65
Messages: 230

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.
 

ronaldlees

Aspiring Daemon

Reaction score: 333
Messages: 767

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 ...
 

drhowarddrfine

Son of Beastie

Reaction score: 2,346
Messages: 4,311

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.
 
Top