LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Send email from command line (https://www.linuxquestions.org/questions/linux-newbie-8/send-email-from-command-line-754140/)

markotitel 09-10-2009 07:05 AM

Send email from command line
 
Hi,
I have truble sending mail from one of my home servers, it has no gnome Centos 5.2 is installed INIT 3 default run level.

i tried mutt, msmtp but cannot send email. What steps are neded to do this.

I need just sending option. it It is for learning purpose, I want to send some conf files to email for backup purpose.

Thanks

repo 09-10-2009 07:11 AM

What have you tried?
Error messages?
Do you have a MTA installed and setup?

markotitel 09-16-2009 04:52 PM

Im sorry for delay, here is log
Quote:

server postfix/smtp[26269]: C94FFF10321: to=<removed>, relay=alt1.gmail-smtp-in.l.google.com[removed]:25, delay=27852, delays=27790/0.02/32/30, dsn=4.7.0, status=deferred (host alt1.gmail-smtp-in.l.google.com[removed] said: 421-4.7.0 [removed] Our system has detected an unusual amount of 421-4.7.0 unsolicited mail originating from your IP address. To protect our 421-4.7.0 users from spam, mail sent from your IP address has been temporarily 421-4.7.0 blocked. Please visit http://www.google.com/mail/help/bulk_mail.html 421 4.7.0 to review our Bulk Email Senders Guidelines.
I see what is says but cannot make it work :)

repo 09-16-2009 05:09 PM

Quote:

mail sent from your IP address has been temporarily 421-4.7.0 blocked. Please visit http://www.google.com/mail/help/bulk_mail.html 421 4.7.0 to review our Bulk Email Senders Guidelines.
Did you visit
http://www.google.com/mail/help/bulk_mail.html
Seems to me you need tp wait untill they unblock you
Quote:

Our system has detected an unusual amount of 421-4.7.0 unsolicited mail originating from your IP address.
Investigate your network for this problem

frenchn00b 10-26-2009 08:41 AM

Code:

cat .muttrc

set sendmail="/usr/bin/msmtp"
unset use_from



cat .msmtprc


account default
host smtp.gmail.com
port 587
from XXXXXXXXX@gmail.com
tls on
tls_starttls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
auth on
user XXXXXXXXX@gmail.com
password XXXXXXXXXXX
logfile ~/.msmtp.log


cd /tmp
apt-get -f -y --allow-unauthenticated      install msmtp
apt-get -f -y --allow-unauthenticated      install  mutt
apt-get -f -y --allow-unauthenticated      install  libssl
apt-get -f -y --allow-unauthenticated      install  openssl libssl0.9.7
apt-get -f -y --allow-unauthenticated      install  sendmail-bin
cd /tmp


then run mutt

xterm -e mutt

then chmod og= .msmtprc

then
echo "dfsdsfdf" | mutt -s "gonna make my first test, Linux is the best" me@gmail.com


All times are GMT -5. The time now is 05:12 PM.