1. Install Sendmail on Debian 10

If you don’t have installed Sendmail using the following command to install Sendmail with other required packages using the apt package manager.

2. Configure Sendmail

After packages installation execute the sendmailconfig command to complete the basic configuration. Select all options to ‘Y‘ and press enter. Wait for the command finish. Your server is ready for sending emails. You can use the Linux command line or PHP script to send emails.

3. Receive Incomming Emails

To receive the incoming emails, you need to edit /etc/mail/sendmail.mc file and comment below line to allow receiving an email from anywhere. To comment a line in sendmail.mc, just put dnl keyword at the start of the line. Then add your domain names to /etc/mail/local-host-names file. Now use m4 is a macro processor to compile the Sendmail configuration files. m4 is stream-based, that is, it doesn’t understand about lines. Restart Sendmail service Your system is ready for incoming emails.

4. Configure Domain-based E-mail Routing

As we read above that virtusertable file used for aliasing, allowing multiple virtual domains to be hosted on one machine.

  1. All emails addressed to @example.com domain delivered to [email protected]@example.org [email protected] 2. All emails addressed to [email protected] will forward to local user jack.[email protected] jack 3. All emails addressed to @mydomain.com will forward to domain @otherdomain.com with corresponding usernames.@example.net %[email protected] 4. All emails addressed to @otherdomain.com will be rejected my mail server with acknowledging sender with the message@otherdomain.com error:nouser User unknown

After making all changes in virtusertable execute the following command to create an updated virtusertable.db file containing the new configuration. Also, make sure the following entry is added in sendmail.mc file. Add entry if not available and compile configuration file Now restart Sendmail service Thanks for reading this article. I hope this article will help you to configure Sendmail on Debian 9 (Stretch) system. References: http://www.sendmail.com/ http://www.sendmail.com/sm/open_source/docs/m4/intro_m4.html


title: “How To Install Sendmail On Debian 10 Buster Tecadmin” ShowToc: true date: “2022-11-23” author: “Christopher Bell”

1. Install Sendmail on Debian 10

If you don’t have installed Sendmail using the following command to install Sendmail with other required packages using the apt package manager.

2. Configure Sendmail

After packages installation execute the sendmailconfig command to complete the basic configuration. Select all options to ‘Y‘ and press enter. Wait for the command finish. Your server is ready for sending emails. You can use the Linux command line or PHP script to send emails.

3. Receive Incomming Emails

To receive the incoming emails, you need to edit /etc/mail/sendmail.mc file and comment below line to allow receiving an email from anywhere. To comment a line in sendmail.mc, just put dnl keyword at the start of the line. Then add your domain names to /etc/mail/local-host-names file. Now use m4 is a macro processor to compile the Sendmail configuration files. m4 is stream-based, that is, it doesn’t understand about lines. Restart Sendmail service Your system is ready for incoming emails.

4. Configure Domain-based E-mail Routing

As we read above that virtusertable file used for aliasing, allowing multiple virtual domains to be hosted on one machine.

  1. All emails addressed to @example.com domain delivered to [email protected]@example.org [email protected] 2. All emails addressed to [email protected] will forward to local user jack.[email protected] jack 3. All emails addressed to @mydomain.com will forward to domain @otherdomain.com with corresponding usernames.@example.net %[email protected] 4. All emails addressed to @otherdomain.com will be rejected my mail server with acknowledging sender with the message@otherdomain.com error:nouser User unknown

After making all changes in virtusertable execute the following command to create an updated virtusertable.db file containing the new configuration. Also, make sure the following entry is added in sendmail.mc file. Add entry if not available and compile configuration file Now restart Sendmail service Thanks for reading this article. I hope this article will help you to configure Sendmail on Debian 9 (Stretch) system. References: http://www.sendmail.com/ http://www.sendmail.com/sm/open_source/docs/m4/intro_m4.html