You are hereBlogs / David Grant's blog / Setting Up postfix to send outgoing mail on ubuntu
Setting Up postfix to send outgoing mail on ubuntu
I don't know why but this is one of those things that I find extremely annoying to set up. Mainly because it often requires installing a full-blown MTA to do a much simpler job than it was designed to do. Unfortunately, ssmtp and exim, the only simpler ones often suck (ssmtp especially which even the maintainer gave up on). What follows is how I got postfix working on my Feisty machine:
sudo apt-get install postfix sudo dpkg-reconfigure postfix
Here are the options to answer in order:
"satellite" (when given the list of configuration styles) <your normal user> (where to forward root's mail to) <your host name> <your ISP's smtp server> accept default (when asked what other domains to accept mail from) No (default is no synchronous updates on mail queue) 127.0.0.0/8 (accept default unless you know what you are doing) 0 (mailbox limit) + (default) all (default)
Reload or restart postfix, then do some testing:
sudo apt-get install mailx echo test |mail -s "test mail sent to external" me@gmail.com echo test |mail -s "test mail sent to normal user" <normal user name> echo test |mail -s "test mail sent to root" root
You should get an email to your external address. And if you run
you should see 2 emails there for you, one that was sent to root (but was directed to you, see /etc/aliases for why) and the other that was sent to you.
To have those mails sent to an external address instead (like your me@gmail.com address) do the following:
echo me@gmail.com > ~/.forward
Update (2007-07-19): When I changed ISPs, my new ISP did not like my From: address being david@centurion (I just named it after the case model). So I had to do the following. Add this to /etc/postfix/main.cf:
smtp_generic_maps = hash:/etc/postfix/generic
Add this to /etc/postfix/generic:
@centurion david@telus.net
I just made up an email address there to make it happy.
Don't forget to run sudo postmap /etc/postfix/generic
- David Grant's blog
- 25302 reads
I've got an error on the first message. The message is't delivered and I found a mail in my local mailbox with the following error message:
Diagnostic-Code: smtp; 554 5.7.1 : Sender
address rejected: Access denied
Any idea?
Thanks in advance
I think this is your smtp server rejecting the From: address. I have a solution for this as I recently had this problem with my new ISP. I'll put the solution up soon.
Thanks very much for your article. Solved my problems. :-)
You mentioned in your postifx article that you found a fix for the address rejected issues with the mail relay. would you mind posting it?
I believe I gave the solution in the post:
Add this to /etc/postfix/main.cf:
Add this to /etc/postfix/generic:
I just made up an email address there to make it happy.
Don't forget to run
sudo postmap /etc/postfix/generici read this topic and installed it but not finish. i can send mail from this user to another user but i can't send mail to external? what do i do to install it?
Post new comment