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 This is the /etc/postfix/main.cf Code:
# See /usr/share/postfix/main.cf.dist for a commented, more complete version Code:
cat /etc/hosts Code:
mail -s 'subject' temp@yahoo.com 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 |
The key information in your log is this : "relay=none"
Check out my posts in this thread : http://www.linuxquestions.org/questi...er-909631-new/ keep us posted ( pun intended ) :-) |
Quote:
I have tried with relayhost = gmail.com , relayhost = mail.myispinternetcompany.com but it didn't work. It didn't send any mail. |
Most relay hosts will require logon and will only accept mails apparently coming from a valid domain (In the "reply to" and maybe envelope address).
For Gmail you need smtp.gmail.com and port 587 |
Quote:
Code:
relayhost = smtp.gmail.com Code:
Nov 4 17:22:40 site1 postfix/smtp[4321]: connect to smtp.gmail.com[74.125.127.109]:25: Connection timed out Can you post your configuration file (main.cf) ? |
Here it is
Code:
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU) Code:
root@LS1:/etc/postfix# lrt Code:
/root/bin/configure_postfix.sh -a 'root:<valid, non-local email address>' -i '192.168.3.51' -p 'LS1.<valid non-local domain>' -r smtp.googlemail.com:587:<user name (email address) for smtp.googlemail.com>:<passsword for smtp.googlemail.com> |
have you thought about using mozilla tunderbird?
|
Quote:
That pastebin link is broken. Can you post the contents of that script ? What is LSI ? I don't have those .db files in /etc/postfix 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 ? Some confusion about main.cf terminology What are Code:
myorigin |
Quote:
Quote:
Code:
#! /bin/bash Quote:
Quote:
Quote:
|
@catkin,
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 Code:
echo "Hello world" | mail -s 'subject' abc@yahoo.com 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)) |
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
|
Quote:
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. |
Quote:
|
Quote:
/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 |
All times are GMT -5. The time now is 06:10 PM. |