You are not logged in.
I'd like to send trivial emails to my external email addy via POP3 (just text, no attachments) from the shell. Is postfix my best bet? Is there something lighter? The postfix wiki page seems rather involved for what I want to do.
Thanks for the suggestions!
EDIT: Found sendEmail which is pretty nice. Other suggestions are still welcomed!
Last edited by graysky (2010-05-27 19:50:31)
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
esmtp, msmtp, ssmtp
I suggest msmtp.
Offline
echo "message" | mailx -s subject me@domain.com
Offline
@karol
mailx doesn't have an MTA, does it? What are you using to send the email?
Offline
> What are you using to send the email?
Good question. How can I find out?
[root@black pics]# pacman -Q esmtp msmtp ssmtp postfix
error: package "esmtp" not found
error: package "msmtp" not found
error: package "ssmtp" not found
error: package "postfix" not found
[root@black pics]# pacman -Q mailx
error: package "mailx" not found
[root@black pics]# pacman -Q mailx-heirloom
mailx-heirloom 12.4-3
.
http://bugs.archlinux.org/task/8834
It doesn't need an smtp server running on localhost but can connect to a smarthost, even with several encryption methods (SMTPS, SMTP+TLS, IMAP etc.). It also provides a basic MUA (which UNIX mailx does as well).
Last edited by karol (2010-05-27 22:21:48)
Offline
what does this point to:
ls -l /usr/sbin/sendmail
Offline
[karol@black ~]$ ls -l /usr/sbin/sendmail
lrwxrwxrwx 1 root root 14 Apr 17 19:16 /usr/sbin/sendmail -> /usr/bin/mailx
I was setting up rtorrent and found this http://wiki.archlinux.org/index.php/RTo … sing_GMail
I thought it was neat and now this is how I upload daily backups (they're tiny) to Gmail :-)
Last edited by karol (2010-05-27 22:30:03)
Offline
Install msmtp and make a basic config file in ~/.msmtprc, for example:
account gmail
host smtp.gmail.com
port 587
protocol smtp
auth on
from graysky@gmail.com
user graysky@gmail.com
password password
tls on
tls_starttls on
tls_trust_file /usr/share/ca-certificates/mozilla/Equifax_Secure_CA.crt
account default : gmail
Make sure no one else can read or write to that file ('chmod 600 ~/.msmtprc'). Then double-check that mailx is installed (it's in base) and add the following line to ~/.mailrc:
set sendmail="/usr/bin/msmtp"
Everythings all set up! Now just pipe your message to mailx, like karol mentioned earlier:
$ echo "message" | mail -s subject me@domain.com
Last edited by fflarex (2010-05-27 22:48:49)
Offline
etc/nail.rc
set smtp=smtp.gmail.com:587
set smtp-use-starttls
set ssl-verify=ignore
set ssl-auth=login
set smtp-auth-user=ME@gmail.com
set smtp-auth-password=YOURPASS
Offline
@graysky
Hmm cool. It looks like mailx-heirloom has an MTA built in. You can add it to the list I provided.
Offline
I'm not sure about the link '/usr/sbin/sendmail -> /usr/bin/mailx' I may have done it by hand but I honestly don't remember.
Offline
I'm not sure about the link '/usr/sbin/sendmail -> /usr/bin/mailx' I may have done it by hand but I honestly don't remember.
No mailx-heirloom would have done it. /usr/sbin/sendmail is a symlink to your MTA.
Offline
I don't want to go offtopic but it still concerns sending email from the shell so here goes.
I uninstalled mailx-heirloom and removed the (now broken) link. I reinstalled mailx-heirloom, changed /etc/nail.rc to the one I posted here but I couldn't send mail, because it complained about the lack of sendmail. After 'ln -s /usr/bin/mailx /usr/sbin/sendmail' the mails are send OK.
http://repos.archlinux.org/wsvn/communi … k/PKGBUILD
I don't see anything about setting a symlink to sendmail but I'm a noob so I may be wrong.
http://arm.konnichi.com/find/index.php? … 2Fsendmail
None of the apps providing sendmail is present on my system.
Offline
Thanks for all the suggestions, all. Look like I'll stick with sendEmail for my purposes. I also wrote a companion script in the AUR called checkip. The whole reason I wanted this ability was to have an email sent to me when the external IP addy changes (the email needs to contain the new IP). Anyway, thanks again!
Last edited by graysky (2010-05-28 05:47:43)
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
I do something similar to dynamically update some IPtables rules. I use this command to get the wan IP
curl -Ls http://tnx.nl/ip
Last edited by steve___ (2010-05-28 12:45:24)
Offline