Postfix test send mail
To test the postfix mail server, you can use the sendmail
command or a tool like telnet
to send a test email. Here are the steps:
Method 1: Using sendmail
command
- Open a terminal as the root user or use
sudo
to gain root privileges. - Run the following command to send a test email:
sendmail -v -f [email protected] [email protected]
Replace
[email protected]
with your actual email address and[email protected]
with the email address you want to send the test email to.
The -v
option enables verbose mode, which will show you the email headers and body.
Method 2: Using telnet
command
-
Open a terminal as the root user or use
sudo
to gain root privileges. -
Run the following command to connect to the postfix mail server using
telnet
:telnet localhost 25
This will connect you to the postfix mail server on port 25.
-
Once connected, type the following command to send a test email:
HELO [email protected] MAIL FROM: [email protected] RCPT TO: [email protected] DATA Subject: Test email from postfix This is a test email sent from postfix.
. QUIT
Replace `[email protected]` with your actual email address and `[email protected]` with the email address you want to send the test email to.
The `HELO` command is used to identify your email client, `MAIL FROM` specifies the sender's email address, `RCPT TO` specifies the recipient's email address, `DATA` starts the email body, and `QUIT` terminates the connection.
After sending the test email, you can check your email account to see if the email was delivered successfully.
**Troubleshooting**
If you encounter any issues while sending the test email, you can check the postfix mail server logs to troubleshoot the problem. The logs are usually located in `/var/log/mail.log` or `/var/log/postfix.log`, depending on your Linux distribution.
You can also use the `postfix` command to test the mail server configuration:
postfix check
This command will check the postfix configuration and report any errors or warnings.