0% found this document useful (0 votes)
6 views1 page

Mail Using Postfix

This document provides instructions for configuring Postfix to send emails using Gmail's SMTP server. It includes steps for editing the main configuration file, setting up SASL authentication, and creating a password file for secure email sending. Additionally, it describes how to send emails and attachments using the mail command in the terminal.

Uploaded by

iwantsatyam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Mail Using Postfix

This document provides instructions for configuring Postfix to send emails using Gmail's SMTP server. It includes steps for editing the main configuration file, setting up SASL authentication, and creating a password file for secure email sending. Additionally, it describes how to send emails and attachments using the mail command in the terminal.

Uploaded by

iwantsatyam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

apt install postfix

apt install mailutils


cd /etc/postfix
vi /main.cf
comment
#smtp_tls_security_level=may

Add
relayhost = [smtp.gmail.com]:587
myhostname = prashant-server
and comment to old one
#myhostname = prashant-server.TL-WA850RE

And at the end of line

smtp_sasl_auth_enable = yes
smtp_tls_security_level = encrypt
smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
smtp_sasl_security_options = noanonymous

save the file


++++

cd sasl
touch sasl_passwd
vi sasl_passwd
add following
[smtp.gmail.com]:587 xyz@gmail.com:apppassword
then save and exit

then make the db file with following command


postmap sasl_passwd
after that you may remove the sasl_passwd as new sasl_passwd.db file has been
created and will be used for sending email

To send the email run following command

echo "This is Mail Content" | mail -s "Subject of Mail"


prashantsinharanchi@gmail.com
To send email with attachment use following command

echo "This is Mail Content" | mail -s "Subject of Mail" -A file1


prashantsinharanchi@gmail.com

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy