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 | ||
| doc:howto:smtp.client [2016/04/18 19:11] – [Example] lizby | docs:guide-user:services:email:smtp.client [2024/10/14 22:52] – typo fix bartprokop | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| ===== Overview ===== | ===== Overview ===== | ||
| - | The table below is based on Chaos Calmer (15.05). | + | The table shows all clients ported to OpenWrt: |
| - | ^ Name ^ Version ^ Dependencies ^ Size ^ Features | + | ^ Name |
| - | | msmtp | 1.6.2-1 | //libopenssl// | 37785 | SSL, smarthost only, sendmail-compatible, | + | | [[docs: |
| - | | msmtp-nossl | 1.6.2-1 | | 33503 | smarthost only, sendmail-compatible, | + | | [[packages: |
| - | | mailsend | 1.17b15-2 | + | | [[packages: |
| - | | mailsend-nossl | 1.17b15-2 | + | | [[packages: |
| - | | ssmtp | 2.64-1.1 | // | + | | [[packages: |
| - | | mini-sendmail | //not present on CC// | | 4726 | smarthost only, no configuration required | | + | | [[packages: |
| + | | mini-sendmail | ||
| + | | [[packages: | ||
| + | | [[docs: | ||
| - | " | + | " |
| ===== Using mailsend ===== | ===== Using mailsend ===== | ||
| Line 27: | Line 30: | ||
| Being quite lightweight and not requiring any configuration, | Being quite lightweight and not requiring any configuration, | ||
| + | [[https:// | ||
| ==== Installation ==== | ==== 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: | 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 ==== | ==== Usage ==== | ||
| Line 62: | Line 68: | ||
| 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). | ||
| + | |||
| + | [[https:// | ||
| ==== Installation ==== | ==== Installation ==== | ||
| - | < | + | < |
| + | Installing '' | ||
| ==== Configuration ==== | ==== Configuration ==== | ||
| + | For router configuration, | ||
| + | |||
| + | < | ||
| + | default: admin@example.com | ||
| + | </ | ||
| + | |||
| Place your configuration in '' | Place your configuration in '' | ||
| - | Here is an example configuration using Fastmail' | + | Here is an example configuration using Gmail that worlks with 2FA and an app password: |
| < | < | ||
| Line 77: | Line 92: | ||
| # If it exists, it usually defines a default account. | # If it exists, it usually defines a default account. | ||
| # This allows msmtp to be used like / | # This allows msmtp to be used like / | ||
| - | account previous_default | + | # cat /etc/msmtprc |
| - | + | ||
| - | # The SMTP smarthost. | + | |
| - | host mailhub.oursite.example | + | |
| - | + | ||
| - | # Construct envelope-from addresses of the form " | + | |
| - | #auto_from on | + | |
| - | #maildomain oursite.example | + | |
| - | + | ||
| - | # Use TLS. | + | |
| - | #tls on | + | |
| - | # | + | |
| - | + | ||
| - | # Syslog logging with facility LOG_MAIL instead of the default LOG_USER. | + | |
| - | syslog LOG_MAIL | + | |
| - | #////// | + | |
| + | defaults | ||
| + | aliases / | ||
| account default | account default | ||
| - | host mail.messagingengine.com | + | host smtp.gmail.com |
| - | from something@your-domain.tld | + | port 465 |
| auth on | auth on | ||
| - | user something@your-domain.tld | ||
| - | password your-password-here | ||
| - | |||
| tls on | tls on | ||
| tls_starttls off | tls_starttls off | ||
| + | |||
| + | from abc@gmail.com | ||
| + | user abc@gmail.com | ||
| + | password app_passwd_here | ||
| + | |||
| + | syslog LOG_MAIL | ||
| </ | </ | ||
| - | The part below '' | + | Now symlink |
| - | Unless | + | Also you may configure env variables |
| ==== Sending mail ==== | ==== Sending mail ==== | ||
| - | < | + | < |
| + | echo -e " | ||
| + | </ | ||
| Note that // | Note that // | ||
| Line 125: | Line 131: | ||
| | mini-sendmail | | mini-sendmail | ||
| + | [[https:// | ||
| ==== Installation and Configuration ==== | ==== Installation and Configuration ==== | ||
| Line 132: | Line 138: | ||
| 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): | 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 ==== | ==== Example ==== | ||
| - | |<code bash> | + | <code bash> |
| mini_sendmail -ssmtp.mail.yahoo.com -p465 -t foo@example.com < input_file | mini_sendmail -ssmtp.mail.yahoo.com -p465 -t foo@example.com < input_file | ||
| usage: mini_sendmail [-f< | usage: mini_sendmail [-f< | ||
| - | </ | + | </ |
| Note that there must not be a space between the option and the value; e.g. "-p 465" is incorrect. | 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 | Several sample configurations found on the internet failed, but as of 160413, this worked | ||
| - | |<code bash> | + | <code bash> |
| echo -e 'From: valid@email.com\r\nSubject: | echo -e 'From: valid@email.com\r\nSubject: | ||
| - | </ | + | </ |
| smtp.gmail.com failed; omitting -f failed; omitting "From: " resulted in transmission, | 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. | 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. | ||
| + | |||
| ===== Using ssmtp ===== | ===== Using ssmtp ===== | ||
| + | |||
| + | [[https:// | ||
| ==== Description ==== | ==== Description ==== | ||
| Line 170: | Line 181: | ||
| ssmtp expects its two configuration files named ''/ | ssmtp expects its two configuration files named ''/ | ||
| - | |< | + | < |
| # / | # / | ||
| root=arnold@gmx.net | root=arnold@gmx.net | ||
| Line 179: | Line 190: | ||
| UseTLS=YES | UseTLS=YES | ||
| # | # | ||
| - | </ | + | </ |
| - | |< | + | < |
| # / | # / | ||
| # 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 191: | Line 202: | ||
| <code bash> | <code bash> | ||
| cat /etc/banner | ssmtp -vvv -auultranerd@universum.tb -ap123password456 someguy@gmx.net | cat /etc/banner | ssmtp -vvv -auultranerd@universum.tb -ap123password456 someguy@gmx.net | ||
| - | </ | + | </ |
| + | |||
| + | |||
| + | ===== Using BusyBox sendmail ===== | ||
| + | |||
| + | - [[https:// | ||
| + | - [[https:// | ||
| + | |||
| + | ==== Description ==== | ||
| + | |||
| + | The BusyBox sendmail is a smallest possible implementation but it must be compiled. It works only in smarthost mode. | ||
| + | |||
| + | ==== Installation ==== | ||
| + | |||
| + | Enable the applet during compilation in menuconfig: '' | ||
| + | Additionally you may want to enable [[https:// | ||
| + | |||
| + | ==== Usage ==== | ||
| + | You need to configure '' | ||
| + | Instead of the variable you may use an option '' | ||
| + | |||
| + | You may also need '' | ||
| + | |||