How Do You Print the Email Addresses That Bounced after They Were Sent from Your Postfix Server?

Problem scenario
You have installed Postfix (e.g., version 3.2.0) on your Linux server. You know several emails that were sent (or attempted to be delivered) bounced. You want to have a list of those unique email addresses by themselves. What do you do?

Solution
Run this command:

sudo cat /var/log/mail | grep bounce | awk ‘ $0 ~ /@/ {print $5}’ | awk ‘{FS=”to=”; …

How Do You Get Your Linux Email Server to Deliver Email Consistently?

Problem scenario
You quickly set up an email server on a virtual machine in a public cloud. Some emails from the server are being received but some are not being received. What could be wrong?

Solution
1. If you are using Postfix, check the files in these locations:

/var/spool/postfix/private/bounce
/var/spool/postfix/bounce
/usr/lib/postfix/bounce

2. Look at the file /var/log/mail for clues about what could be wrong.

How Do You Set up a Send-Only Email (Postfix) Server on a Linux SUSE AWS Instance?

Problem scenario
You have a monitoring tool on a Linux server that needs to send out emails upon certain events happening. You want to install and configure an email server. You need to send outbound emails, but you do not need to receive inbound emails. How do you configure Linux SUSE to be able to send out regular emails over the internet?

Solution
1.

How Do You Get the /var/log/mail File to Start Over?

Problem scenario
You want to search for activity associated with a given email address. You do not want to examine historical records because you made a configuration change. How do you eliminate the old records of the file and start over?

Solution
1. Make a back up of the file. (The commands below will eliminate the original copy.)
2. Run these four commands:

sudo su –
cd /var/log
mail
exit …

How Do You Send an Email from the Command Prompt of Linux to a Long List of Recipients?

Problem scenarios
One or both of the following apply:

#1 You want to automate the sending of the exact same email to multiple people. You do not want to manually type in the recipients. You have the same subject and body that each recipient should receive. You want to customize the “from address” that the recipients see. How do you do this?

OR

#2 You are using the mail command on a Linux server.

How Do You Send an Email via a Postfix Server on Linux with the Command Prompt That Has Multiple Recipients and a Subject?

Problem scenario
You want to send one email to multiple people. You tried separating the email addresses with a comma or semicolon but you received this message: “555 5.5.4 Unsupported option:”

You do not know how to send an email with a subject via the Postfix command prompt. How do you send an email to multiple people with “Re:” content of your choice?

Solution
Prerequisite
You need to have Postfix installed and configured.

How Do You Automate a telnet Session to Send a Postfix Email on a Linux Server?

Problem scenario
You want to create a script that will send an email from a Linux server. You want it to use telnet. How do you automatically send an email using telnet?

Solution
Prerequisite
Set up Postfix. If you are running SUSE, see this posting. If you are running a RedHat derivative, see this posting.

How Do You Send an Email from a Postfix Email Server with A “Reply-to” Email Address of Your Choosing?

Problem scenario
You are using Linux. You want to send emails from your server directly (e.g., from the command prompt using telnet and helo commands) with a customized “Reply-To” email address. How do you do this so the recipient clicks “reply” the “To:” field will be pre-populated.

Prerequisite
Install Postfix. See one this posting if you are using Linux SUSE;