Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| docs:guide-user:services:email:smtp.client [2024/10/14 23:41] – [Configuration] bartprokop | docs:guide-user:services:email:smtp.client [2024/12/14 23:05] – move old clients to bottom stokito | ||
|---|---|---|---|
| Line 19: | Line 19: | ||
| " | " | ||
| - | |||
| - | ===== Using mailsend ===== | ||
| - | |||
| - | ==== Description ==== | ||
| - | |||
| - | < | ||
| - | Mailsend is a simple command line program to send mail via SMTP protocol. | ||
| - | </ | ||
| - | |||
| - | Being quite lightweight and not requiring any configuration, | ||
| - | |||
| - | [[https:// | ||
| - | ==== 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: | ||
| - | |||
| - | < | ||
| - | opkg install mailsend | ||
| - | opkg install mailsend-nossl | ||
| - | </ | ||
| - | |||
| - | ==== Usage ==== | ||
| - | |||
| - | Simple usage: | ||
| - | |||
| - | < | ||
| - | mailsend -f root@openwrt -t foo@example.com -smtp smtp.example.com -sub "My subject" | ||
| - | </ | ||
| - | |||
| - | For advanced usage (MIME attachements, | ||
| - | |||
| - | < | ||
| - | mailsend -h | ||
| - | mailsend -example | ||
| - | </ | ||
| ===== Using msmtp ===== | ===== Using msmtp ===== | ||
| Line 59: | Line 24: | ||
| ==== Description ==== | ==== Description ==== | ||
| - | < | + | msmtp is an SMTP client. |
| - | msmtp is an SMTP client. In the default mode, it transmits a mail to | + | In the default mode, it transmits a mail to an SMTP server (for example at a free mail provider) which does the delivery. |
| - | an SMTP server (for example at a free mail provider) which does the | + | To use this program with your mail user agent (MUA), create a configuration file with your mail account(s) and tell your MUA to |
| - | delivery. To use this program with your mail user agent (MUA), create | + | |
| - | a configuration file with your mail account(s) and tell your MUA to | + | |
| call msmtp instead of / | call msmtp instead of / | ||
| - | </ | ||
| Since msmtp understands standard sendmail options, it can be used in places where sendmail is expected (e.g. PHP code). | Since msmtp understands standard sendmail options, it can be used in places where sendmail is expected (e.g. PHP code). | ||
| Line 72: | Line 34: | ||
| ==== Installation ==== | ==== Installation ==== | ||
| - | < | + | < |
| - | Installing '' | + | opkg install msmtp-mta |
| + | </ | ||
| + | |||
| + | Installing '' | ||
| ==== Configuration ==== | ==== Configuration ==== | ||
| - | For router configuration, | + | For router configuration, |
| - | < | + | < |
| default: admin@example.com | default: admin@example.com | ||
| </ | </ | ||
| - | Place your configuration in '' | + | Place your configuration in ''/ |
| - | Here is an example configuration using Gmail that worlks | + | Here is an example configuration using Gmail that works with 2FA and an app password: |
| - | < | + | < |
| # A system wide configuration file. | # A system wide configuration file. | ||
| # It defines a default account. | # It defines a default account. | ||
| Line 113: | Line 78: | ||
| </ | </ | ||
| - | Now symlink '' | + | Now symlink '' |
| Also you may configure env variables '' | Also you may configure env variables '' | ||
| ==== Sending mail ==== | ==== Sending mail ==== | ||
| - | < | + | |
| + | < | ||
| + | echo -e " | ||
| echo -e " | echo -e " | ||
| </ | </ | ||
| - | Note that // | + | Note that the // |
| - | + | ||
| - | + | ||
| - | ===== Using mini-sendmail ===== | + | |
| - | + | ||
| - | ==== Description ==== | + | |
| - | + | ||
| - | ^ Name ^ Version ^ Dependencies ^ Size ^ Description | + | |
| - | | mini-sendmail | + | |
| - | + | ||
| - | [[https:// | + | |
| - | ==== Installation and Configuration ==== | + | |
| - | + | ||
| - | < | + | |
| - | + | ||
| - | 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): | + | |
| + | Use '' | ||
| < | < | ||
| - | opkg install http://downloads.openwrt.org/ | + | 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=' |
| </ | </ | ||
| - | ==== Example ==== | ||
| - | <code bash> | ||
| - | mini_sendmail -ssmtp.mail.yahoo.com -p465 -t foo@example.com < input_file | ||
| - | usage: mini_sendmail [-f< | + | ===== Using ssmtp ===== |
| - | </ | + | |
| - | Note that there must not be a space between the option and the value; e.g. "-p 465" is incorrect. | + | ==== Description ==== |
| - | Several sample configurations found on the internet failed, but as of 160413, this worked | + | A secure, effective and simple way of getting mail off a system to your mail hub. |
| - | <code bash> | + | It contains no suid-binaries or other dangerous things |
| - | echo -e 'From: valid@email.com\r\nSubject: | + | mail is simply forwarded to the configured mailhost. Extremely easy configuration. |
| - | </ | + | |
| - | smtp.gmail.com failed; omitting -f failed; omitting "From: " resulted | + | |
| - | + | ||
| - | This is a very small package if you can find an smtp server which works and you can configure | + | |
| - | + | ||
| - | ===== Using ssmtp ===== | + | |
| [[https:// | [[https:// | ||
| - | ==== Description | + | ==== Installation |
| < | < | ||
| - | A secure, effective and simple way of getting mail off a system to your | + | opkg install ssmtp |
| - | mail hub. It contains no suid-binaries or other dangerous things - no | + | |
| - | mail spool to poke around in, and no daemons running in the background. | + | |
| - | mail is simply forwarded to the configured mailhost. Extremely easy | + | |
| - | configuration. | + | |
| </ | </ | ||
| - | |||
| - | ==== Installation ==== | ||
| - | |||
| - | < | ||
| ==== Usage ==== | ==== Usage ==== | ||
| Line 182: | Line 117: | ||
| ssmtp expects its two configuration files named ''/ | ssmtp expects its two configuration files named ''/ | ||
| - | <code> | + | < |
| - | # / | + | |
| root=arnold@gmx.net | root=arnold@gmx.net | ||
| mailhub=mail.gmx.net: | mailhub=mail.gmx.net: | ||
| Line 193: | Line 127: | ||
| </ | </ | ||
| - | <code> | + | < |
| - | # / | + | |
| # Format: local_account: | # Format: local_account: | ||
| root: | root: | ||
| - | </code | + | </code> |
| To use the program, with SMTP auth: | To use the program, with SMTP auth: | ||
| Line 225: | Line 158: | ||
| You may also need '' | You may also need '' | ||
| + | |||
| + | |||
| + | ===== Using mailsend ===== | ||
| + | |||
| + | ==== Description ==== | ||
| + | |||
| + | Mailsend is a simple command line program to send mail via SMTP protocol. | ||
| + | |||
| + | Being quite lightweight and not requiring any configuration, | ||
| + | |||
| + | [[https:// | ||
| + | |||
| + | ==== 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: | ||
| + | |||
| + | < | ||
| + | opkg install mailsend | ||
| + | opkg install mailsend-nossl | ||
| + | </ | ||
| + | |||
| + | ==== Usage ==== | ||
| + | |||
| + | Simple usage: | ||
| + | |||
| + | <code bash> | ||
| + | mailsend -f root@openwrt -t foo@example.com -smtp smtp.example.com -sub "My subject" | ||
| + | </ | ||
| + | |||
| + | For advanced usage (MIME attachments, | ||
| + | |||
| + | < | ||
| + | mailsend -h | ||
| + | mailsend -example | ||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | ===== 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 '' | ||
| + | |||
| + | [[https:// | ||
| + | |||
| + | ==== Installation and Configuration ==== | ||
| + | |||
| + | < | ||
| + | opkg install mini-sendmail | ||
| + | </ | ||
| + | |||
| + | 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): | ||
| + | |||
| + | < | ||
| + | opkg install http:// | ||
| + | </ | ||
| + | |||
| + | ==== Example ==== | ||
| + | |||
| + | <code bash> | ||
| + | mini_sendmail -ssmtp.mail.yahoo.com -p465 -t foo@example.com < input_file | ||
| + | |||
| + | usage: mini_sendmail [-f< | ||
| + | </ | ||
| + | |||
| + | 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: | ||
| + | </ | ||
| + | smtp.gmail.com failed; omitting -f failed; omitting "From: " resulted in transmission, | ||
| + | |||
| + | 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. | ||
| + | |||