How would i configure/set up postfix to send email from my local pc ?
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How would i configure/set up postfix to send email from my local pc ?
It's debian.
I have installed postfix.
Code:
aptitude install postfix bsd-mailx mailutils
During installation i selected Internet site.
This is the /etc/postfix/main.cf
Code:
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
myhostname = site1.example.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = myhost.localhost.localdomain, site1.example.com, localhost.example.com, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
The hostname = 'myhost'
Code:
cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
127.0.0.1 mysite.com myhost
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Code:
mail -s 'subject' temp@yahoo.com
It's waiting in terminal, it looks it's doing nothing.
From /var/log/mail.log i got
Code:
Nov 4 12:56:03 site1 postfix/error[2517]: CFA837F9A5: to=<temp@yahoo.com>, relay=none, delay=29200, delays=29094/106/0/0.09, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to mta5.am0.yahoodns.net[66.94.236.34]:25: Connection timed out
Probably your settings is to send email from a gmail account.
Is it possible to send email from local pc address like , useraccount@localhost.localdomain ?
The link might be OK; pastebin is down at the moment.
Quote:
Originally Posted by cola
Can you post the contents of that script ?
Bigger than I like to post but seeing as pastebin is down:
Code:
#! /bin/bash
# Purpose:
# Configures postfix for sending via a relay (smart host). Suitable for
# sending mail from a postfix server behind a NATting router.
# Usage:
# See usage function below (search for "function usage") or use -h option.
# Environment:
# Developed and tested on Debian Squeeze with
# * bash 4.1.5
# * postfix 2.7.1
# History:
# 23oct11 Charles
# * First version
# Wishlist (in approx descending order of importance/triviality):
# * None
# Programmers' notes: error and trap handling:
# * All errors are fatal and exit or finalise() is called.
# * At any time, a trapped event may transfer control to finalise().
# Programmers' notes: variable names and values
# * Directory name variables are called *_dir and have values ending in /
# * File name variables are called *_afn have values beginning with /
# * Logic flag variables are called *_flag and have values $true or $false
# * $buf is a localised scratch buffer.
# * $lf is a line feed.
# Programmers' notes: maximum line length ruler
# -------+---------+---------+---------+---------+---------+---------+---------+
# 10 20 30 40 50 60 70 80
# Programmers' notes: function call tree
# +
# |
# +-- initialise
# | |
# | +-- ck_email_address
# | |
# | +-- ck_ip_address
# | |
# | +-- usage
# |
# +-- configure
# |
# +-- finalise
#
# Utility functions called from various places:
# ck_file fct msg
# Function definitions in alphabetical order. Execution begins after the last function definition.
#--------------------------
# Name: ck_email_address
# Purpose: checks argument is a valid email address
# $1 - value to test
#--------------------------
function ck_email_address {
fct "${FUNCNAME[ 0 ]}" "started with argument $1"
if [[ $1 =~ ^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$ ]]; then
fct "${FUNCNAME[ 0 ]}" "returning 0"
return 0
else
fct "${FUNCNAME[ 0 ]}" "returning 1"
return 1
fi
} # end of function ck_email_address
#--------------------------
# Name: ck_ip_address
# Purpose: checks argument is a valid IP address
# $1 - value to test
# Acknowledgments to Mitch Frazier and Linux Journal: http://www.linuxjournal.com/content/validating-ip-address-bash-script
#--------------------------
function ck_ip_address {
fct "${FUNCNAME[ 0 ]}" "started with argument $1"
local array oIFS retval
retval=1
if [[ $1 =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
oIFS=$IFS
IFS='.'
array=( $1 )
IFS=$oIFS
[[ ${array[0]} -le 255 && ${array[1]} -le 255 && ${array[2]} -le 255 && ${array[3]} -le 255 ]]
retval=$?
fi
fct "${FUNCNAME[ 0 ]}" "returning $retval"
return $retval
} # end of function ck_ip_address
#--------------------------
# Name: fct
# Purpose: function call trace (for debugging)
# $1 - name of calling function
# $2 - message. If it starts with "started" or "returning" then the output is prettily indented
#--------------------------
function fct {
if [[ ! $debugging_flag ]]; then
return 0
fi
fct_ident="${fct_indent:=}"
case $2 in
'started'* )
fct_indent="$fct_indent "
msg 'I' "DEBUG: $fct_indent$1: $2"
;;
'returning'* )
msg 'I' "DEBUG: $fct_indent$1: $2"
fct_indent="${fct_indent# }"
;;
* )
msg 'I' "DEBUG: $fct_indent$1: $2"
esac
} # end of function fct
#--------------------------
# Name: finalise
# Purpose: cleans up and gets out of here
#--------------------------
function finalise {
fct "${FUNCNAME[ 0 ]}" 'started'
local buf msg msgs my_retval retval
# Set return value
# ~~~~~~~~~~~~~~~~
# Choose the highest and give message if finalising on a trapped signal
my_retval="${prgnam_retval:-0}"
if [[ $1 -gt $my_retval ]]; then
my_retval=$1
fi
case $my_retval in
129 | 130 | 131 | 143 )
case $my_retval in
129 )
buf='SIGHUP'
;;
130 )
buf='SIGINT'
;;
131 )
buf='SIGQUIT'
;;
143 )
buf='SIGTERM'
;;
esac
msg 'I' "finalising on $buf"
;;
esac
# Final log messages
# ~~~~~~~~~~~~~~~~~~
finalising_flag=$true # Used to avoid infinite recursion
msgs=
if [[ $global_warning_flag ]]; then
msgs="$msgs${lf}There were WARNINGs"
if [[ $my_retval -eq 0 ]]; then
my_retval=1
fi
fi
if [[ "$msgs" != '' ]]; then
msgs="${msgs#$lf}" # strip leading linefeed
msg 'E' "$msgs"
fi
msg 'I' "Exiting with return value $my_retval"
# Exit
# ~~~~
fct "${FUNCNAME[ 0 ]}" 'exiting'
exit $my_retval
} # end of function finalise
#--------------------------
# Name: initialise
# Purpose: sets up environment and parses command line
#--------------------------
function initialise {
local alias args array i_opt_flag emsg r_opt_flag username
# Configure shell environment
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~
export PATH=/usr/sbin:/sbin:/usr/bin:/bin
IFS=$' \n\t'
set -o nounset
umask 0022
unalias -a
# Configure traps
# ~~~~~~~~~~~~~~~
# Set up essentials for finalise() and what it may call before setting traps
# because finalise() may be called at any time after then
false=
true=true
debugging_flag=$false
finalising_flag=$false
global_warning_flag=$false
prgnam=${0##*/} # program name w/o path
trap 'finalise 129' 'HUP'
trap 'finalise 130' 'INT'
trap 'finalise 131' 'QUIT'
trap 'finalise 143' 'TERM'
# Utility variables
# ~~~~~~~~~~~~~~~~~
lf=$'\n' # ASCII linefeed, a.k.a newline
prg_ver='0.0'
# Parse command line
# ~~~~~~~~~~~~~~~~~~
aliases=
args="${@:-}"
emsg=''
i_opt_flag=$false
my_ips=
pf_fqdn=
r_opt_flag=$false
unactioned_aliases=
while getopts a:dhi:p:r:V opt 2>/dev/null
do
case $opt in
a )
array=( $OPTARG )
for (( i=0; i<${#array[*]}; i++ ))
do
username=${array[i]%:*}
alias=${array[i]#*:}
ck_email_address "$alias" || emsg="$emsg${lf}Option -a: invalid email address: $alias"
grep -q "$username:$alias" /etc/aliases \
&& unactioned_aliases="$unactioned_aliases${lf}$username: $alias" \
|| aliases="$aliases${lf}$username: $alias"
done
aliases=${aliases#$lf}
;;
d )
debugging_flag=$true
;;
h )
usage verbose
exit 0
;;
i )
i_opt_flag=$true
array=( $OPTARG )
for (( i=0; i<${#array[*]}; i++ ))
do
ck_ip_address ${array[i]} || emsg="$emsg${lf}Option -i: invalid IP address: ${array[i]}"
my_ips="$my_ips ${array[i]}"
done
my_ips=${my_ips# }
;;
p )
pf_fqdn=$OPTARG
[[ $pf_fqdn =~ ^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,12}$ ]] \
|| emsg="$emsg${lf}Option -p: invalid domain name: $pf_fqdn"
;;
r )
r_opt_flag=$true
IFS=':'
array=( $OPTARG )
IFS=
if [[ ${#array[*]} -ne 4 ]]; then
emsg="$emsg${lf}Option -r: incorrect number of relaying SMTP server info components: $OPTARG"
else
relay_fqdn=${array[0]}
[[ $relay_fqdn =~ ^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}$ ]] \
|| emsg="$emsg${lf}Option -r: invalid domain name: $relay_fqdn"
relay_port=${array[1]}
[[ $relay_port =~ ^[0-9]+$ ]] || emsg="$emsg${lf}Option -r: relaying SMTP port not numeric: $relay_port"
relay_username=${array[2]}
relay_password=${array[3]}
fi
;;
V )
echo "$prgnam version $prg_ver"
exit 0
;;
* )
emsg="$emsg${lf}Invalid option '$opt'"
esac
done
# Test for mandatory options not set
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[[ $i_opt_flag = $false || $my_ips = '' ]] && emsg="$emsg${lf}Mandatory option -i not given or empty option argument"
[[ $pf_fqdn = '' ]] && emsg="$emsg${lf}Mandatory option -p not given or empty option argument"
if [[ $r_opt_flag = $false ]]; then
emsg="$emsg${lf}Mandatory option -r not given"
elif [[ ${#array[*]} -eq 4 ]]; then
[[ $relay_fqdn = '' ]] && emsg="$emsg${lf}Option -r: server_FQDN empty"
[[ $relay_port = '' ]] && emsg="$emsg${lf}Option -r: port empty"
[[ $relay_username = '' ]] && emsg="$emsg${lf}Option -r: username empty"
[[ $relay_password = '' ]] && emsg="$emsg${lf}Option -r: password empty"
fi
# Test for extra arguments
# ~~~~~~~~~~~~~~~~~~~~~~~~
shift $(( $OPTIND-1 ))
if [[ $* != '' ]]; then
emsg="$emsg${lf}Invalid extra argument(s) '$*'"
fi
# Report any errors
# ~~~~~~~~~~~~~~~~~
if [[ $emsg != '' ]]; then
echo "${emsg#$lf}" >&2
usage
exit 1
fi
# Note whether being run from a terminal
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# The "standard" test is to check $PS1 but this test is more reliable
buf="$( ps -p $$ -o tty 2>&1 )"
case $buf in
*TT*-* )
interactive_flag=$false
;;
*TT* )
interactive_flag=$true
;;
* )
echo "$prgnam: Unable to determine if being run interactively. ps output was: $buf" >&2
exit 1
esac
# Up to this point any messages have been given using echo followed by exit 1. Now
# the essentials for _msg() and finalise() have been established, all future messages
# will be sent using _msg() and error mesages will then call finalise().
fct "${FUNCNAME[ 0 ]}" 'started (this message delayed until messaging initialised)'
msg 'I' "$prgnam version $prg_ver started with command line '$args'"
[[ $unactioned_aliases != '' ]] \
&& msg W "Reqested aliases already in /etc/aliases. Ignored:$unactioned_aliases"
# Exit if not running interactively
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if [[ ! $interactive_flag ]]; then
msg 'E' 'Not running interactively'
fi
fct "${FUNCNAME[ 0 ]}" "returning.
aliases: $aliases
my_ips: $my_ips
pf_fqdn: $pf_fqdn
relay_fqdn: $relay_fqdn
relay_port: $relay_port
relay_username: $relay_username
relay_password: $relay_password"
} # end of function initialise
#--------------------------
# Name: configure
# Purpose: configures the postfix server
#--------------------------
function configure {
fct "${FUNCNAME[ 0 ]}" 'started'
# Sanity checks
# ~~~~~~~~~~~~~
type postfix >/dev/null 2>&1 || msg 'E' "postfix command not found. Is postfix installed?"
msg 'I' "$prgnam: checking existing postfix installation ..."
postfix check && echo 'OK' || while true
do
read -p 'Continue? Y to continue, Q to quit > '
case $REPLY in
y|Y ) break ;;
q|Q ) finalise 0 ;;
* ) echo "Invalid response '$REPLY'"
esac
done
# Derive variables
# ~~~~~~~~~~~~~~~~
pf_uq_hostname=${pf_fqdn%%.*} # uq = unqualified
pf_domain_name=${pf_fqdn#*.}
relay_uq_hostname=${relay_fqdn%%.*}
relay_domain_name=${relay_fqdn#*.}
# Configure postfix
# ~~~~~~~~~~~~~~~~~
msg 'I' "$prgnam: configuring postfix ..."
set -e # Let command errors terminate script
echo $pf_uq_hostname > /etc/mailname
cd /etc/postfix
postconf -e smtpd_tls_CAfile=/etc/postfix/cacert.pem
postconf -e smtpd_tls_cert_file=/etc/postfix/${pf_uq_hostname}-cert.pem
postconf -e smtpd_tls_key_file=/etc/postfix/${pf_uq_hostname}-key.pem
postconf -e smtp_tls_CAfile=/etc/postfix/cacert.pem
postconf -e smtp_use_tls=yes
postconf -e smtpd_use_tls=yes
postconf -e myhostname=$pf_fqdn
postconf -e myorigin=/etc/mailname
postconf -e mydestination=$pf_fqdn,localhost.$pf_domain_name,localhost
postconf -e relayhost=[$relay_fqdn]:$relay_port
postconf -e mynetworks="127.0.0.0/8 $my_ips"
postconf -e inet_interfaces=all
postconf -e default_transport=smtp
postconf -e relay_transport=smtp
postconf -e smtp_sasl_auth_enable=yes
postconf -e smtp_sasl_security_options=noanonymous
postconf -e smtp_sasl_tls_security_options=noanonymous
postconf -e smtp_sasl_password_maps=hash:/etc/postfix/sasl_passwd
postconf -e smtp_generic_maps=hash:/etc/postfix/generic
postconf -e transport_maps=hash:/etc/postfix/transport
postconf -e virtual_alias_maps=hash:/etc/postfix/virtual
echo "# this is for the sasl_passwd${lf}[$relay_fqdn]:$relay_port $relay_username:$relay_password" > /etc/postfix/sasl_passwd
echo "# this is for the transport${lf}$relay_domain_name smtp:[$relay_fqdn]:$relay_port" > /etc/postfix/transport
echo "# this is for the generic${lf}bli@$relay_fqdn $relay_username" > /etc/postfix/generic
echo "# this is for the virtual${lf}root root@localhost" > /etc/postfix/virtual
postmap virtual generic sasl_passwd transport
chmod 400 /etc/postfix/sasl_passwd
cat /usr/lib/ssl/certs/Equifax_Secure_CA.pem >> /etc/postfix/cacert.pem
if [[ $aliases != '' ]]; then
msg 'I' "$prgnam: setting up aliases ..."
echo "$aliases" >> /etc/aliases
newaliases
fi
set +e
msg 'I' "$prgnam: restarting postfix ..."
/etc/init.d/postfix restart
fct "${FUNCNAME[ 0 ]}" 'returning'
return 0
} # end of function configure
#--------------------------
# Name: msg
# Purpose: generalised messaging interface
# Usage: msg class msg_text
# class must be one of I, W or E indicating Information, Warning or Error
# msg_text is the text of the message
# Return code: always zero (exits on error)
#--------------------------
function msg {
local buf indent line message_text preamble
class="${1:-}"
case "$class" in
I | 'E' )
;;
'W' )
global_warning_flag=$true
;;
* )
echo "$prgnam: msg: invalid arguments: '$args'" >&2
exit 1
esac
message_text="$2"
case "$class" in
I )
echo "$message_text" >&1
;;
W )
echo "WARNING: $message_text" >&1
;;
E )
echo "ERROR: $message_text" >&2
[[ ! $finalising_flag ]] && finalise 1
;;
esac
return 0
} # end of function msg
#--------------------------
# Name: usage
# Purpose: prints usage message
#--------------------------
function usage {
fct "${FUNCNAME[ 0 ]}" 'started'
echo "usage: $prgnam [-a alias_list] [-d] [-h] -i ip_address_list -p postfix_server_FQDN -r relay_info_list [-V]" >&2
if [[ ${1:-} != 'verbose' ]]
then
echo "(use -h for help)" >&2
else
echo " where:
-a A space separated list of local_user:alias items to be used as aliases.
Required by most relay servers when the local postfix server FQDN is
not publicly DNS resolvable.
-d turns debugging trace on.
-h prints this help and exits.
-i local IP address. If more than one, a space-separated list of local IP addresses.
-p local postfix server fully qualified domain name (FQDN).
-r relaying SMTP server information as:
server_FQDN:port:username:password
The components must not include a : character
-V prints the program version and exits.
" >&2
fi
fct "${FUNCNAME[ 0 ]}" 'returning'
} # end of function usage
#--------------------------
# Name: main
# Purpose: where it all happens
#--------------------------
initialise "${@:-}"
configure
finalise 0
Quote:
Originally Posted by cola
What is LSI ?
LS1 is the name of the server postfix is running on; it's nothing special; you best replace it with your own.
Quote:
Originally Posted by cola
I don't have those .db files in /etc/postfix
Which could be part of why it is not working!
Quote:
Originally Posted by cola
Probably your settings is to send email from a gmail account.
Is it possible to send email from local pc address like , useraccount@localhost.localdomain ?
No, the settings are to send mail from a server (error reports etc.) to a sysadmin/personal mail address via Gmail's SMTP server (smart host in postfix terminology). Most (all?) mail service providers will reject mail from domains that are not DNS resolvable. useraccount is OK but localhost.localdomain is not -- for the very good reasons that a) it could be used for spam and b) any reply could not be delivered.
How can i know the server prefix ?
How can i replace the localhost.localdomain with something else that would work ? (useraccount@localhost.localdomain)
And how do you send email with mail command from terminal ? Can you post that command ?
Have you sent email using that main.cf(you posted before) from your local pc with this account 'useraccount@localhost.localdomain' ?
What is the 'from' address you used to send email ? Is this your assigned/specific/fixed 'catkin@gmail.com' every time you send email ?
What's the 'to' address ? Are you able to send email to any email account such as abc@gmail.com or abc@yahoo.com ?
I changed the /etc/mailname to 'myhost.site1.example.com' , this is the main.cf
Code:
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_auth_only = no
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
myhostname = site1.example.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = myhost.localhost.localdomain, site1.example.com, localhost.example.com, localhost
relayhost = [smtp.googlemail.com]:587
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
From terminal
Code:
echo "Hello world" | mail -s 'subject' abc@yahoo.com
cat /var/log/mail.log
Code:
Nov 4 19:19:28 site1 postfix/smtp[6160]: 20B548AA99: to=<user1@myhost.site1.example.com>, relay=smtp.googlemail.com[74.125.127.16]:587, delay=5, delays=0.1/0/3.9/1, dsn=5.7.0, status=bounced (host smtp.googlemail.com[74.125.127.16] said: 530 5.7.0 Must issue a STARTTLS command first. lt8sm17902795pbb.0 (in reply to MAIL FROM command))
Nov 4 19:19:29 site1 postfix/qmgr[6153]: 20B548AA99: removed
It probably doesn't matter what you use; try localhost.
Quote:
Originally Posted by cola
How can i replace the localhost.localdomain with something else that would work ? (useraccount@localhost.localdomain)
As I already wrote, @localhost.localdomain will not work. The /etc/aliases file is used to change something like useraccount@localhost.localdomain to something that can work.
Quote:
Originally Posted by cola
And how do you send email with mail command from terminal ? Can you post that command ?
It does not matter. The mail log line in your next post shows you are creating a mail locally and it is being picked up for delivery by postfix.
Quote:
Originally Posted by cola
Have you sent email using that main.cf(you posted before) from your local pc with this account 'useraccount@localhost.localdomain' ?
No. Mostly the mail is generated by root which is aliased to root.<server name>@<valid public email domain name>. You could use something like cola@gmail.com.
Quote:
Originally Posted by cola
What is the 'from' address you used to send email ? Is this your assigned/specific/fixed 'catkin@gmail.com' every time you send email ?
As the last answer.
Quote:
Originally Posted by cola
What's the 'to' address ? Are you able to send email to any email account such as abc@gmail.com or abc@yahoo.com ?
Yes.
Last edited by catkin; 11-05-2011 at 06:57 AM.
Reason: disabled "Automatically parse links in text"
Nov 4 19:19:28 site1 postfix/smtp[6160]: 20B548AA99: to=<user1@myhost.site1.example.com>, relay=smtp.googlemail.com[74.125.127.16]:587, delay=5, delays=0.1/0/3.9/1, dsn=5.7.0, status=bounced (host smtp.googlemail.com[74.125.127.16] said: 530 5.7.0 Must issue a STARTTLS command first. lt8sm17902795pbb.0 (in reply to MAIL FROM command))
Nov 4 19:19:29 site1 postfix/qmgr[6153]: 20B548AA99: removed
The problem is indicated by "Must issue a STARTTLS command first". There's something wrong with your postfix TLS configuration. You haven't mentioned the files I marked in green above. AFAIK they are necessary to do what you want to do.
I am no postfix expert so cannot examine main.cf and see problems. I cribbed how to configure postfix to do what I (and you) want to do so encapsulated it in the script for convenience.
If you backed up the /etc/postfix directory and the /etc/aliases and /etc/mailname files you could safely run my script. It has to be run as root so caution is prudent and it is a long script so difficult to examine. All the action happens in function configure (search for "function configure"). The script has been successfully used on two servers.
No. Mostly the mail is generated by root which is aliased to root.<server name>@<valid public email domain name>. You could use something like cola@gmail.com.
What is the 'from' address in your case ? Did/do you use catkin@gmail.com or something like that in /etc/postfix/sasl_passwd ?
What is the 'from' address in your case ? Did/do you use catkin@gmail.com or something like that in /etc/postfix/sasl_passwd ?
As above, the from address I have used is root.<server name>@<valid public email domain name>. If you do not have a <valid public email domain name> to use, you could use something like cola@gmail.com and put any user and server name information in the subject.
/etc/postfix/sasl_passwd includes the logon name for the SMTP server logon; for the Gmail SMTP server it would be something like cola@gmail.com
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.