Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
docs:guide-user:services:email:smtp.client [2023/04/02 10:25] – [Table] stokitodocs: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                                             ^ Version                    ^ Dependencies                                      ^ Size    ^ Features                                                                                                                                                                             ^
-| [[docs:techref:busybox|BusyBox]] sendmail        | 1.33 //must be compiled//  | //libopenssl//                                    | 14 KB   | SSL, smarthost only, sendmail-compatible, SMTP auth                                                                                                                                  | +| [[docs:techref:busybox|BusyBox]] sendmail        | 1.33 //must be compiled//  | //libopenssl//                                    | 14KB   | SSL, smarthost only, sendmail-compatible, SMTP auth                                                                                                                                  | 
-| [[packages:pkgdata:msmtp]]                       | 1.8                        | //libgnutls//                                     51 KB   | SSL, smarthost only, sendmail-compatible, SMTP auth                                                                                                                                  | +| [[packages:pkgdata:msmtp]]                       | 1.8                        | //libgnutls//                                     51KB   | SSL, smarthost only, sendmail-compatible, SMTP auth                                                                                                                                  | 
-| [[packages:pkgdata:msmtp-nossl]]                 | 1.8                        |                                                   47 KB   | smarthost only, sendmail-compatible, SMTP auth                                                                                                                                       | +| [[packages:pkgdata:msmtp-nossl]]                 | 1.8                        |                                                   47KB   | smarthost only, sendmail-compatible, SMTP auth                                                                                                                                       | 
-| [[packages:pkgdata:mailsend]]                    | 1.19                       | //libopenssl//                                    | 39 KB   | SSL, smarthost only, no configuration required, MIME, attachements, IPv6, SMTP auth                                                                                                  | +| [[packages:pkgdata:mailsend]]                    | 1.19                       | //libopenssl//                                    | 39KB   | SSL, smarthost only, no configuration required, MIME, attachements, IPv6, SMTP auth                                                                                                  | 
-| [[packages:pkgdata:mailsend-nossl]]              | 1.19                                                                         37 KB   | smarthost only, no configuration required, MIME, attachements, IPv6, SMTP auth                                                                                                       | +| [[packages:pkgdata:mailsend-nossl]]              | 1.19                                                                         37KB   | smarthost only, no configuration required, MIME, attachements, IPv6, SMTP auth                                                                                                       | 
-| [[packages:pkgdata_owrt18_6:ssmtp]]              | 2.64                       | //libopenssl//                                    | 11 KB   | SSL support, smarthost only, SMTP auth, no longer available since OpenWRT 21.02                                                                                                      | +| [[packages:pkgdata_owrt18_6:ssmtp]]              | 2.64                       | //libopenssl//                                    | 11KB   | SSL support, smarthost only, SMTP auth. No longer available since OpenWRT 21                                                                                                      | 
-| mini-sendmail                                    | //package not present//    |                                                   5 KB    | smarthost only, no configuration required                                                                                                                                            +| mini-sendmail                                    | //no package//    |                                                   5KB    | smarthost only, no configuration required. No longer available since OpenWRT 17                                                                                                                                           
-| [[packages:pkgdata:emailrelay]]                  | 2.3                        | //libc// //libssp// //libopenssl// //libstdcpp// 350 KB  | SMTP proxy and store-and-forward message transfer agent (MTA); can be used similar to postfix with mail queue in combination with msmtp and mutt. In v2.5 can deliver mail directly +| [[packages:pkgdata:emailrelay]]                  | 2.3                        | //libc// //libssp// //libopenssl// //libstdcpp// 350KB  | SMTP proxy and store-and-forward message transfer agent (MTA); can be used similar to postfix with mail queue in combination with msmtp and mutt. In v2.5 can deliver mail directly. See [[:docs:guide-user:services:email:emailrelay]]  | 
-| [[docs:guide-user:services:email:xmail|XMail ]]  | //package not present//    | //libopenssl//                                    |                                                                                                                                                                                              |+| [[docs:guide-user:services:email:xmail|XMail ]]  | //no package//    | //libopenssl//                                    |                                                                                                                                                                                              |
  
-"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.+"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 ===== ===== Using mailsend =====
Line 72: Line 72:
  
 ==== Installation ==== ==== Installation ====
-<code>opkg install msmtp</code>+<code>opkg install msmtp-mta</code> 
 +Installing ''%%msmtp-mta%%'' package will also create necessary ''%%sendmail%%'' symlink. If you do not need ''%%sendmail%%'' command (unlikely) then install only ''%%msmtp%%'' package.
  
 ==== Configuration ==== ==== Configuration ====
 +For router configuration, you very likely do not want to receive emails to local mailboxes. Define aliases file ''%%/etc/aliases.msmtp%%'' to send all local mails to your admin email:
 +
 +<code>
 +default: admin@example.com
 +</code>
 +
 Place your configuration in ''%%/etc/msmtprc%%''. There is an existing ''%%default%%''-block in the included config file so if you want to call ''%%msmtp%%'' without specifying an account, then you need to rename the existing ''%%default%%''-block to something else. Place your configuration in ''%%/etc/msmtprc%%''. There is an existing ''%%default%%''-block in the included config file so if you want to call ''%%msmtp%%'' without specifying an account, then you need to rename the existing ''%%default%%''-block to something else.
  
Line 88: Line 95:
  
 defaults defaults
 +aliases /etc/aliases.msmtp
 +
 account default account default
  
Line 103: Line 112:
 </code> </code>
  
-Now symlink ''%%msmtp%%'' to ''%%sendmail%%'' with ''%%ln -s /usr/bin/msmtp /usr/sbin/sendmail%%''.+Now symlink ''%%msmtp%%'' to ''%%sendmail%%'' with ''%%ln -s /usr/bin/msmtp /usr/sbin/sendmail%%'' - this is not necessary if ''%%msmtp-mta%%'' was installed instead of ''%%msmtp%%''. 
 + 
 +Also you may configure env variables ''EMAIL'' for From address and ''SMTPSERVER'' to specify smarthost. 
 ==== Sending mail ==== ==== Sending mail ====
 <code> <code>
Line 148: Line 160:
  
 ===== Using ssmtp ===== ===== Using ssmtp =====
 +
 +[[https://tracker.debian.org/pkg/ssmtp|Official site]]
  
 ==== Description ==== ==== Description ====
Line 182: Line 196:
 # Format: local_account:outgoing_address:mailhub # Format: local_account:outgoing_address:mailhub
 root:arnold@gmx.net:mail.gmx.net:465 root:arnold@gmx.net:mail.gmx.net:465
-</code+</code
- +
- +
  
 To use the program, with SMTP auth: To use the program, with SMTP auth:
Line 192: Line 203:
 cat /etc/banner | ssmtp -vvv -auultranerd@universum.tb -ap123password456 someguy@gmx.net cat /etc/banner | ssmtp -vvv -auultranerd@universum.tb -ap123password456 someguy@gmx.net
 </code> </code>
 +
 +
 +===== Using BusyBox sendmail =====
 +
 +  - [[https://busybox.net/downloads/BusyBox.html#sendmail|Documentation]]
 +  - [[https://git.busybox.net/busybox/tree/mailutils/sendmail.c|Sources]]
 +
 +==== 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: ''BusyBox options'',  ''Mail'' and ''sendmail''.
 +Additionally you may want to enable [[https://busybox.net/downloads/BusyBox.html#makemime|makemime]] applet that helps to send files with attachments.
 +
 +==== Usage ====
 +You need to configure ''SMTPHOST'' env variable with the smarthost SMTP server to use.
 +Instead of the variable you may use an option ''-S server[:port]'' to specify the SMTP server.
 +
 +You may also need ''SMTP_ANTISPAM_DELAY'' env to bypass the Greylisting antispam if it enabled for submission.
 +
 +
  • Last modified: 2024/12/14 23:20
  • by stokito