Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revisionBoth sides next revision
docs:guide-user:services:email:smtp.client [2024/12/14 22:55] – formatting stokitodocs:guide-user:services:email:smtp.client [2024/12/14 23:05] – move old clients to bottom stokito
Line 19: Line 19:
  
 "smarthost only" means that the program is only capable to send email through a configured "smarthost", that is, it cannot directly deliver to the destination SMTP server. E.g. it won't make a DNS lookup of the email address for MX record. "smarthost only" means that the program is only capable to send email through a configured "smarthost", that is, it cannot directly deliver to the destination SMTP server. E.g. it won't make a DNS lookup of the email address for MX record.
- 
-===== Using mailsend ===== 
- 
-==== Description ==== 
- 
-Mailsend is a simple command line program to send mail via SMTP protocol. 
- 
-Being quite lightweight and not requiring any configuration, ''mailsend'' is ideal for sending mails in shell scripts. 
- 
-[[https://github.com/muquit/mailsend]] - Sources and issues 
- 
-==== Installation ==== 
- 
-Depending on whether you want SSL support or not (actually, the size of libopenssl will probably be the decisive factor), install one of the two versions: 
- 
-<code> 
-opkg install mailsend 
-opkg install mailsend-nossl 
-</code> 
- 
-==== Usage ==== 
- 
-Simple usage: 
- 
-<code bash> 
-mailsend -f root@openwrt -t foo@example.com -smtp smtp.example.com -sub "My subject" -msg-body /tmp/body 
-</code> 
- 
-For advanced usage (MIME attachments, authentication, BCC, etc), see: 
- 
-<code> 
-mailsend -h 
-mailsend -example 
-</code> 
- 
  
 ===== Using msmtp ===== ===== Using msmtp =====
Line 130: Line 95:
 Mon Oct 14 23:35:55 2024 mail.info msmtp: host=smtp.gmail.com tls=on auth=on user=******@gmail.com from=******@gmail.com recipients=admin@example.com mailsize=181 smtpstatus=250 smtpmsg='250 2.0.0 OK  1728948955 b640f23e62c3d-c9d29717ba4su6358366z.33 - gsmtp' exitcode=EX_OK Mon Oct 14 23:35:55 2024 mail.info msmtp: host=smtp.gmail.com tls=on auth=on user=******@gmail.com from=******@gmail.com recipients=admin@example.com mailsize=181 smtpstatus=250 smtpmsg='250 2.0.0 OK  1728948955 b640f23e62c3d-c9d29717ba4su6358366z.33 - gsmtp' exitcode=EX_OK
 </code> </code>
- 
- 
-===== Using mini-sendmail ===== 
- 
-==== Description ==== 
- 
-mini_sendmail reads its standard input up to an end-of-file and sends a copy of the message found there to all of the addresses listed. 
-The message is sent by connecting to a local SMTP server. This means ''mini_sendmail'' can be used to send email from inside a chroot(2) area. 
- 
-[[https://acme.com/software/mini_sendmail/|Official site]] 
- 
-==== Installation and Configuration ==== 
- 
-<code> 
-opkg install mini-sendmail 
-</code> 
- 
-On Chaos Calmer, the package is no longer available, but the version from Barrier Breaker still works (AA & BB versions as installed below work in AA): 
- 
-<code> 
-opkg install http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/oldpackages/mini-sendmail_1.3.6-4_ar71xx.ipk 
-</code> 
- 
-==== Example ==== 
- 
-<code bash> 
-mini_sendmail -ssmtp.mail.yahoo.com -p465 -t foo@example.com < input_file 
- 
-usage: mini_sendmail [-f<name>] [-t] [-s<server>] [-p<port>] [-T<timeout>] [-v] [address ...] 
-</code> 
- 
-Note that there must not be a space between the option and the value; e.g. "-p 465" is incorrect. 
- 
-Several sample configurations found on the internet failed, but as of 160413, this worked 
-<code bash>  
-echo -e 'From: valid@email.com\r\nSubject: Test Subject\r\n\r\nTesting\r\n.' | mini_sendmail -fvalid@email.com -smail.brighthouse.com toAddr@gmail.com 
-</code> 
-smtp.gmail.com failed; omitting -f failed; omitting "From: " resulted in transmission, but no sender shown. 
- 
-This is a very small package if you can find an smtp server which works and you can configure the command so that the server accepts it. 
  
  
Line 233: Line 158:
  
 You may also need ''SMTP_ANTISPAM_DELAY'' env to bypass the Greylisting antispam if it enabled for submission. You may also need ''SMTP_ANTISPAM_DELAY'' env to bypass the Greylisting antispam if it enabled for submission.
 +
 +
 +===== Using mailsend =====
 +
 +==== Description ====
 +
 +Mailsend is a simple command line program to send mail via SMTP protocol.
 +
 +Being quite lightweight and not requiring any configuration, ''mailsend'' is ideal for sending mails in shell scripts.
 +
 +[[https://github.com/muquit/mailsend]] - Sources and issues
 +
 +==== Installation ====
 +
 +Depending on whether you want SSL support or not (actually, the size of libopenssl will probably be the decisive factor), install one of the two versions:
 +
 +<code>
 +opkg install mailsend
 +opkg install mailsend-nossl
 +</code>
 +
 +==== Usage ====
 +
 +Simple usage:
 +
 +<code bash>
 +mailsend -f root@openwrt -t foo@example.com -smtp smtp.example.com -sub "My subject" -msg-body /tmp/body
 +</code>
 +
 +For advanced usage (MIME attachments, authentication, BCC, etc), see:
 +
 +<code>
 +mailsend -h
 +mailsend -example
 +</code>
 +
 +
 +
 +===== Using mini-sendmail =====
 +
 +==== Description ====
 +
 +mini_sendmail reads its standard input up to an end-of-file and sends a copy of the message found there to all of the addresses listed.
 +The message is sent by connecting to a local SMTP server. This means ''mini_sendmail'' can be used to send email from inside a chroot(2) area.
 +
 +[[https://acme.com/software/mini_sendmail/|Official site]]
 +
 +==== Installation and Configuration ====
 +
 +<code>
 +opkg install mini-sendmail
 +</code>
 +
 +On Chaos Calmer, the package is no longer available, but the version from Barrier Breaker still works (AA & BB versions as installed below work in AA):
 +
 +<code>
 +opkg install http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/oldpackages/mini-sendmail_1.3.6-4_ar71xx.ipk
 +</code>
 +
 +==== Example ====
 +
 +<code bash>
 +mini_sendmail -ssmtp.mail.yahoo.com -p465 -t foo@example.com < input_file
 +
 +usage: mini_sendmail [-f<name>] [-t] [-s<server>] [-p<port>] [-T<timeout>] [-v] [address ...]
 +</code>
 +
 +Note that there must not be a space between the option and the value; e.g. "-p 465" is incorrect.
 +
 +Several sample configurations found on the internet failed, but as of 160413, this worked
 +<code bash> 
 +echo -e 'From: valid@email.com\r\nSubject: Test Subject\r\n\r\nTesting\r\n.' | mini_sendmail -fvalid@email.com -smail.brighthouse.com toAddr@gmail.com
 +</code>
 +smtp.gmail.com failed; omitting -f failed; omitting "From: " resulted in transmission, but no sender shown.
 +
 +This is a very small package if you can find an smtp server which works and you can configure the command so that the server accepts it.
 +
  
  
  • Last modified: 2024/12/14 23:20
  • by stokito