Webhosting platform

Hosting powered by RESTENA

Sending e-mail

You can send e-mails from PHP pages as well as from CGI scripts. In both cases the e-mails are handled by /usr/sbin/sendmail, e-mails are transmitted to the outgoing mail server which will forward them to the right destinations.

You can send e-mail from SSH access the same way as for PHP pages or CGI scripts,

Outgoing mailserver configuration

the command to run being: sendmail <destination@example>, the mail content including headers are taken from stdin.

The relay server only accepts authenticated connections, the authentication is based on the FTP login and a password shared with the outbound proxy.

/usr/sbin/sendmail reads its configuration (relay server, authentication credentials) from .msmtprc located in your FTP root. The file looks like the one below:

account default
 domain w3.restena.lu
 host smtp-server.restena.lu

 syslog LOG_MAIL
 logfile ~/.msmtp.log

 from webmaster@your-site.lu
 auth plain
 user <FTP login>
 password <proxy password>

Except deletion of .msmtprc or password change, you should not worry about this configuration file, it is initialized by our own.

You will find the log of sent e-mails in the file .msmtp.log at the root of the webspace.

DKIM

Starting 16 September 2020 outgoing mails from your webspace will get DKIM-signed if two configuration files are present:

  • .dkim.key: This file must contain a valid private key for DKIM signing as generated by opendkim-keygen or similar (can also be generated with openssl openssl genrsa -out .dkim.key 1024 (for a 1024 bit RSA key)
  • .dkim.sel: This file must contain the DKIM selector as well as the signature domain name, both separated by a '@'.
    For a value of '2020@your-site.lu' a receiving mail server would look for a 2020._domainkey.your-site.lu TXT record with DKIM information.

Note that opendkim is strict about conformity of the mail it should sign. If your mail misses 'From' or 'Date' headers the sending will fail.

SPF

If for your domain you are defining a SPF DNS record in order to help prevent third-parties sending mail in your name you need to mention the outbound server used by your website in the SPF record: a:smtp-server.restena.lu., you can also use include:_spf.hosting-restena.lu..