Re: [beagleboard] How to use Exim4 to Send Email from Beaglebone Black Debian
Create the file .muttrc eg in /root/ or in /home/debian/ (the user that wants to use mutt) and add a line set smtp_url="smtp://user:passw...@smtp.someserver.com" And don't forget the return after this line. (as in crontab as well) * * * * * root ls /somefolder | mutt -s "" someu...@someserver.com 2>&1 BTW: didn't you read my Email where i worte that you can redirect crontabs output into a file: * * * * * root ls /somefolder >> /root/crontab_err.txt 2>&1 On Thu, Apr 21, 2016 at 2:06 AM, John Bakerwrote: > Dieter, > I'm trying to get mutt running to get error messages from crontab. I > installed mutt with aptitude and it may be working but I don't know how to > set it up to get the messages :-[ > > Apr 20 23:49:01 beaglebone /USR/SBIN/CRON[8657]: (root) CMD (export > DISPLAY=:0 && /usr/bin/python /home/debian/Desktop/SimB.py) > Apr 20 23:50:01 beaglebone /USR/SBIN/CRON[8690]: (root) CMD (export > DISPLAY=:0 && /usr/bin/python /home/debian/Desktop/SimB.py) > Apr 20 23:51:02 beaglebone /USR/SBIN/CRON[8723]: (root) CMD (export > DISPLAY=:0 && /usr/bin/python /home/debian/Desktop/SimB.py) > Apr 20 23:52:01 beaglebone /USR/SBIN/CRON[8756]: (root) CMD (export > DISPLAY=:0 && /usr/bin/python /home/debian/Desktop/SimB.py) > > Setup is described in https://wiki.debian.org/Mutt says there is a muttrc > file in "a user's $HOME directory" but I find only unreadable muttrc files > elsewhere and I'm not sure I know where and what a "user's $HOME directory" > is. > > 1. Do I need to set up some directory in /home/? > 2. Do I need to create a muttrc file to configure mutt? > 3. Is there a way to find and read the sent messages? > > Thanks, > John > > On Wednesday, May 27, 2015 at 7:44:18 AM UTC-7, Dieter Wirz wrote: >> >> If you only want to send mail, install mutt >> With mutt u can use any SMTP server, and mutt comes with its own;-) >> >> On Tue, May 26, 2015 at 11:09 PM, tcb2 wrote: >> > I've recently gotten Exim4 to send mail from the BBB with Debian, using >> > the >> > Gmail SMTP server. (I tried using the BBB as the server with SMTP port >> > 25, >> > but my ISP [Comcast] blocks that port to prevent spam.) I am running >> > code to >> > monitor a sensor, and wanted an email alert to me at certain detected >> > values. Here are the general steps: >> > >> > 1. Tell Google that you'll be sending email from your BBB. From a >> > browser on >> > the BBB, sign in to your gmail account at: >> > http://www.google.com/accounts/DisplayUnlockCaptcha >> > >> > >> > 2. Open port 587. For this you need to be root. Check your iptables >> > (firewall) first to see if 587 is already open: >> > # iptables -L -n >> > >> > If not, then >> > # iptables -A OUTPUT -p tcp --dport 587 -j ACCEPT >> > >> > and, if you don't have any input rules, which is good (see >> > >> > http://unix.stackexchange.com/questions/104954/how-to-allow-outgoing-smtp-on-iptables-debian-linux), >> > then >> > >> > # iptables -I INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT >> > >> > 3. Install and configure exim4 as root. This is the package that sends >> > the >> > email. >> > >> > # apt-get install exim4 >> > >> > Now, configure exim as root: >> > >> > # dpkg-reconfigure exim4-config >> > in the dialog, answer as follows: >> > >> > Configuration type mail sent by smarthost; received via SMTP or >> > fetchmail >> > System mail name localhost >> > IP-addresses to listen on for incoming SMTP connections 127.0.0.1 ; ::1 >> > (to >> > refuse external connections) >> > Other destinations for which mail is acceptedleave empty >> > Machines to relay mail forleave empty >> > IP address or host name of the outgoing smarthostsmtp.gmail.com::587 >> > Hide local mail name in outgoing mail ?yes >> > Keep number of DNS-queries minimal (Dial-on-Demand) ?no >> > Delivery method for local mailmbox format in /var/mail/ >> > Split configuration into small files ?no >> > >> > check /etc/exim4/update-exim4.conf.conf to see if the file looks like >> > the >> > below, and if not, change it: >> > >> > dc_eximconfig_configtype='smarthost' >> > dc_other_hostnames='' >> > dc_local_interfaces='127.0.0.1 ; ::1' >> > dc_readhost='' >> > dc_relay_domains='' >> > dc_minimaldns='false' >> > dc_relay_nets='' >> > dc_smarthost='smtp.gmail.com::587' >> > CFILEMODE='644' >> > dc_use_split_config='false' >> > dc_hide_mailname='true' >> > dc_mailname_in_oh='true' >> > dc_localdelivery='mail_spool' >> > >> > Then modify /etc/exim4/passwd.client to (substitute your gmail name and >> > pwd): >> > >> > gmail-smtp.l.google.com:yourgmailn...@gmail.com:yourpassword >> > *.google.com:yourgmailn...@gmail.com:yourpassword >> > smtp.gmail.com:youremailna...@gmail.com:yourpassword >> > >> > Change permissions, etc >> > >> > # chown root:Debian-exim /etc/exim4/passwd.client >> > # chmod 640 /etc/exim4/passwd.client >> > >> > restart Exim >> > >> > # update-exim4.conf >> > # invoke-rc.d exim4 restart >> > >> > >> > 4. Test sending mail >>
Re: [beagleboard] How to use Exim4 to Send Email from Beaglebone Black Debian
Dieter, I'm trying to get mutt running to get error messages from crontab. I installed mutt with aptitude and it may be working but I don't know how to set it up to get the messages :-[ Apr 20 23:49:01 beaglebone /USR/SBIN/CRON[8657]: (root) CMD (export DISPLAY=:0 && /usr/bin/python /home/debian/Desktop/SimB.py) Apr 20 23:50:01 beaglebone /USR/SBIN/CRON[8690]: (root) CMD (export DISPLAY=:0 && /usr/bin/python /home/debian/Desktop/SimB.py) Apr 20 23:51:02 beaglebone /USR/SBIN/CRON[8723]: (root) CMD (export DISPLAY=:0 && /usr/bin/python /home/debian/Desktop/SimB.py) Apr 20 23:52:01 beaglebone /USR/SBIN/CRON[8756]: (root) CMD (export DISPLAY=:0 && /usr/bin/python /home/debian/Desktop/SimB.py) Setup is described in https://wiki.debian.org/Mutt says there is a muttrc file in "a user's $HOME directory" but I find only unreadable muttrc files elsewhere and I'm not sure I know where and what a "user's $HOME directory" is. 1. Do I need to set up some directory in /home/? 2. Do I need to create a muttrc file to configure mutt? 3. Is there a way to find and read the sent messages? Thanks, John On Wednesday, May 27, 2015 at 7:44:18 AM UTC-7, Dieter Wirz wrote: > > If you only want to send mail, install mutt > With mutt u can use any SMTP server, and mutt comes with its own;-) > > On Tue, May 26, 2015 at 11:09 PM, tcb2wrote: > > I've recently gotten Exim4 to send mail from the BBB with Debian, using > the > > Gmail SMTP server. (I tried using the BBB as the server with SMTP port > 25, > > but my ISP [Comcast] blocks that port to prevent spam.) I am running > code to > > monitor a sensor, and wanted an email alert to me at certain detected > > values. Here are the general steps: > > > > 1. Tell Google that you'll be sending email from your BBB. From a > browser on > > the BBB, sign in to your gmail account at: > > http://www.google.com/accounts/DisplayUnlockCaptcha > > > > > > 2. Open port 587. For this you need to be root. Check your iptables > > (firewall) first to see if 587 is already open: > > # iptables -L -n > > > > If not, then > > # iptables -A OUTPUT -p tcp --dport 587 -j ACCEPT > > > > and, if you don't have any input rules, which is good (see > > > http://unix.stackexchange.com/questions/104954/how-to-allow-outgoing-smtp-on-iptables-debian-linux), > > > > then > > > > # iptables -I INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT > > > > 3. Install and configure exim4 as root. This is the package that sends > the > > email. > > > > # apt-get install exim4 > > > > Now, configure exim as root: > > > > # dpkg-reconfigure exim4-config > > in the dialog, answer as follows: > > > > Configuration type mail sent by smarthost; received via SMTP or > fetchmail > > System mail name localhost > > IP-addresses to listen on for incoming SMTP connections 127.0.0.1 ; ::1 > (to > > refuse external connections) > > Other destinations for which mail is acceptedleave empty > > Machines to relay mail forleave empty > > IP address or host name of the outgoing smarthostsmtp.gmail.com::587 > > Hide local mail name in outgoing mail ?yes > > Keep number of DNS-queries minimal (Dial-on-Demand) ?no > > Delivery method for local mailmbox format in /var/mail/ > > Split configuration into small files ?no > > > > check /etc/exim4/update-exim4.conf.conf to see if the file looks like > the > > below, and if not, change it: > > > > dc_eximconfig_configtype='smarthost' > > dc_other_hostnames='' > > dc_local_interfaces='127.0.0.1 ; ::1' > > dc_readhost='' > > dc_relay_domains='' > > dc_minimaldns='false' > > dc_relay_nets='' > > dc_smarthost='smtp.gmail.com::587' > > CFILEMODE='644' > > dc_use_split_config='false' > > dc_hide_mailname='true' > > dc_mailname_in_oh='true' > > dc_localdelivery='mail_spool' > > > > Then modify /etc/exim4/passwd.client to (substitute your gmail name and > > pwd): > > > > gmail-smtp.l.google.com:yourgmailn...@gmail.com:yourpassword > > *.google.com:yourgmailn...@gmail.com:yourpassword > > smtp.gmail.com:youremailna...@gmail.com:yourpassword > > > > Change permissions, etc > > > > # chown root:Debian-exim /etc/exim4/passwd.client > > # chmod 640 /etc/exim4/passwd.client > > > > restart Exim > > > > # update-exim4.conf > > # invoke-rc.d exim4 restart > > > > > > 4. Test sending mail > > > > you can do this in perl, for example: > > > > #!/usr/bin/perl > > > > $to = 'some-email-address'; > > $from = 'yourgmailn...@gmail.com'; > > $subject = 'Test Email'; > > $message = 'This is test email sent by Perl Script'; > > > > open(MAIL, "|/usr/sbin/sendmail -t"); > > > > print MAIL "To: $to\n"; > > print MAIL "From: $from\n"; > > print MAIL "Subject: $subject\n\n"; > > print MAIL $message; > > > > close(MAIL); > > > > print "Email Sent Successfully\n"; > > > > or another way it to create a file called mail-body.txt: > > > > to : some-email-address > > from :
Re: [beagleboard] How to use Exim4 to Send Email from Beaglebone Black Debian
If you only want to send mail, install mutt With mutt u can use any SMTP server, and mutt comes with its own;-) On Tue, May 26, 2015 at 11:09 PM, tcb2 tchadwic...@gmail.com wrote: I've recently gotten Exim4 to send mail from the BBB with Debian, using the Gmail SMTP server. (I tried using the BBB as the server with SMTP port 25, but my ISP [Comcast] blocks that port to prevent spam.) I am running code to monitor a sensor, and wanted an email alert to me at certain detected values. Here are the general steps: 1. Tell Google that you'll be sending email from your BBB. From a browser on the BBB, sign in to your gmail account at: http://www.google.com/accounts/DisplayUnlockCaptcha 2. Open port 587. For this you need to be root. Check your iptables (firewall) first to see if 587 is already open: # iptables -L -n If not, then # iptables -A OUTPUT -p tcp --dport 587 -j ACCEPT and, if you don't have any input rules, which is good (see http://unix.stackexchange.com/questions/104954/how-to-allow-outgoing-smtp-on-iptables-debian-linux), then # iptables -I INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT 3. Install and configure exim4 as root. This is the package that sends the email. # apt-get install exim4 Now, configure exim as root: # dpkg-reconfigure exim4-config in the dialog, answer as follows: Configuration type mail sent by smarthost; received via SMTP or fetchmail System mail name localhost IP-addresses to listen on for incoming SMTP connections 127.0.0.1 ; ::1 (to refuse external connections) Other destinations for which mail is acceptedleave empty Machines to relay mail forleave empty IP address or host name of the outgoing smarthostsmtp.gmail.com::587 Hide local mail name in outgoing mail ?yes Keep number of DNS-queries minimal (Dial-on-Demand) ?no Delivery method for local mailmbox format in /var/mail/ Split configuration into small files ?no check /etc/exim4/update-exim4.conf.conf to see if the file looks like the below, and if not, change it: dc_eximconfig_configtype='smarthost' dc_other_hostnames='' dc_local_interfaces='127.0.0.1 ; ::1' dc_readhost='' dc_relay_domains='' dc_minimaldns='false' dc_relay_nets='' dc_smarthost='smtp.gmail.com::587' CFILEMODE='644' dc_use_split_config='false' dc_hide_mailname='true' dc_mailname_in_oh='true' dc_localdelivery='mail_spool' Then modify /etc/exim4/passwd.client to (substitute your gmail name and pwd): gmail-smtp.l.google.com:yourgmailn...@gmail.com:yourpassword *.google.com:yourgmailn...@gmail.com:yourpassword smtp.gmail.com:youremailna...@gmail.com:yourpassword Change permissions, etc # chown root:Debian-exim /etc/exim4/passwd.client # chmod 640 /etc/exim4/passwd.client restart Exim # update-exim4.conf # invoke-rc.d exim4 restart 4. Test sending mail you can do this in perl, for example: #!/usr/bin/perl $to = 'some-email-address'; $from = 'yourgmailn...@gmail.com'; $subject = 'Test Email'; $message = 'This is test email sent by Perl Script'; open(MAIL, |/usr/sbin/sendmail -t); print MAIL To: $to\n; print MAIL From: $from\n; print MAIL Subject: $subject\n\n; print MAIL $message; close(MAIL); print Email Sent Successfully\n; or another way it to create a file called mail-body.txt: to : some-email-address from : yourgmailn...@gmail.com subject : Test mail This is the first mail sent by my server's sendmail ! and then do # cat mail-body.txt | sendmail -t if mail is not sending, then check /var/log/exim4/mainlog for errors. # tail /var/log/exim4/mainlog good luck! -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups BeagleBoard group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups BeagleBoard group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[beagleboard] How to use Exim4 to Send Email from Beaglebone Black Debian
I've recently gotten Exim4 to send mail from the BBB with Debian, using the Gmail SMTP server. (I tried using the BBB as the server with SMTP port 25, but my ISP [Comcast] blocks that port to prevent spam.) I am running code to monitor a sensor, and wanted an email alert to me at certain detected values. Here are the general steps: 1. Tell Google that you'll be sending email from your BBB. From a browser on the BBB, sign in to your gmail account at: http://www.google.com/accounts/DisplayUnlockCaptcha 2. Open port 587. For this you need to be root. Check your iptables (firewall) first to see if 587 is already open: # iptables -L -n If not, then # iptables -A OUTPUT -p tcp --dport 587 -j ACCEPT and, if you don't have any input rules, which is good (see http://unix.stackexchange.com/questions/104954/how-to-allow-outgoing-smtp-on-iptables-debian-linux), then # iptables -I INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT 3. Install and configure exim4 as root. This is the package that sends the email. # apt-get install exim4 Now, configure exim as root: # dpkg-reconfigure exim4-config in the dialog, answer as follows: Configuration type mail sent by smarthost; received via SMTP or fetchmail System mail name localhost IP-addresses to listen on for incoming SMTP connections 127.0.0.1 ; ::1 (to refuse external connections)Other destinations for which mail is accepted*leave empty*Machines to relay mail for*leave empty*IP address or host name of the outgoing smarthostsmtp.gmail.com::587Hide local mail name in outgoing mail ?yesKeep number of DNS-queries minimal (Dial-on-Demand) ?noDelivery method for local mailmbox format in /var/mail/Split configuration into small files ?no check /etc/exim4/update-exim4.conf.conf to see if the file looks like the below, and if not, change it: dc_eximconfig_configtype='smarthost' dc_other_hostnames='' dc_local_interfaces='127.0.0.1 ; ::1' dc_readhost='' dc_relay_domains='' dc_minimaldns='false' dc_relay_nets='' dc_smarthost='smtp.gmail.com::587' CFILEMODE='644' dc_use_split_config='false' dc_hide_mailname='true' dc_mailname_in_oh='true' dc_localdelivery='mail_spool' Then modify /etc/exim4/passwd.client to (substitute your gmail name and pwd): gmail-smtp.l.google.com:yourgmailn...@gmail.com:yourpassword *.google.com:yourgmailn...@gmail.com:yourpassword smtp.gmail.com:youremailna...@gmail.com:yourpassword Change permissions, etc # chown root:Debian-exim /etc/exim4/passwd.client # chmod 640 /etc/exim4/passwd.client restart Exim # update-exim4.conf # invoke-rc.d exim4 restart 4. Test sending mail you can do this in perl, for example: #!/usr/bin/perl $to = 'some-email-address'; $from = 'yourgmailn...@gmail.com'; $subject = 'Test Email'; $message = 'This is test email sent by Perl Script'; open(MAIL, |/usr/sbin/sendmail -t); print MAIL To: $to\n; print MAIL From: $from\n; print MAIL Subject: $subject\n\n; print MAIL $message; close(MAIL); print Email Sent Successfully\n; or another way it to create a file called mail-body.txt: to : some-email-address from : yourgmailn...@gmail.com subject : Test mail This is the first mail sent by my server's sendmail ! and then do # cat mail-body.txt | sendmail -t if mail is not sending, then check /var/log/exim4/mainlog for errors. # tail /var/log/exim4/mainlog good luck! -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups BeagleBoard group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.