LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   How to send an e-mail with the command line? (https://www.linuxquestions.org/questions/linux-server-73/how-to-send-an-e-mail-with-the-command-line-831753/)

professorgenival 09-12-2010 04:19 PM

How to send an e-mail with the command line?
 
Hello everybody :-)

I'm new with mail servers and I want to send a simple mail from my terminal and I need some help...

I'm using opensuse and a Know that I have postfix installed...

I don't know what I need configure first...

I know that I need a SMTP server to send e-mails write?

When I try send e-mail with the command mail I received this message :

Code:

mail -s "meeting reminder" -c professorgenival@hotmail.com micromerces@gmail.com
mailq:

Code:

(host mx4.hotmail.com [65.55.92.168] refuse to talk to me: 421 cannot conect to SMTP server.
I was reading about fetchmail But I can't understand....

I don't want only de answer.. I want a help to know what I need to study first. :-)

Thanks in advanced

14moose 09-12-2010 05:53 PM

Short answer:

If your local mail server is Postfix, then you should be able to configure it to forward mail to a remote SMTP server by editing main.cf, like this:
Code:

/etc/postfix/main.cf

        relayhost = smtp.yourisp.com

If you're using sendmail, the file would be "/etc/mail/relay-domains"

Here are more details for Postfix:
http://www.postfix.org/BASIC_CONFIGURATION_README.html

unSpawn 09-12-2010 05:57 PM

Quote:

Originally Posted by 14moose (Post 4095483)
Short answer

...the long answer being that Hotmail forces SenderID, a mcrsft-assimilated derivative of SPF.

14moose 09-12-2010 10:19 PM

Quote:

...the long answer being
Actually, the "long answer" can get VERY long :)

I just wanted to make sure the OP covered the "basics" before delving into more detail. There are a LOT of things that can go wrong.

Here are two good links:

Controlling E-Mail Spam

You Might Be an Anti-Spam Kook If...

professorgenival -

1. Your "mail -s" syntax should work fine

2. The main issue is that you need to find a good "relay server", and configure Postfix (and, possibly other stuff) appropriately.

'Hope that helps

nsb58 09-13-2010 02:05 AM

you can use mutt also with your sendmail or postfix MTA.

You can configure your postfix in /etc/postfix/main.cf in RHEL 5

Three main configurations are to be done in the file.

Outbound
Inbound
authentication (who can send email)

Note: you can also use mutt for pop and imap service with SSL

mutt -f pop://username@servername


All times are GMT -5. The time now is 06:07 PM.