sending mail on ubuntu through sendmail

David Fletcher dave at thefletchers.net
Wed Oct 20 10:21:10 UTC 2010


These are my notes for getting my postfix working:-

sudo aptitude install postfix

Select the option for sending mail out plus receiving using fetchmail 
(internet with smarthost).



To set up the sasl stuff (database for auth SMTP passwords) create the file
/etc/postfix/sasl/sasl_passwd
containing (in my case) the line
auth.smtp.example.com   mymailboxID at example.com:mypassword

then do
sudo chown root:root /etc/postfix/sasl/sasl_passwd
sudo chmod 600 /etc/postfix/sasl/sasl_passwd

Convert it to the required database format:-
sudo postmap hash:/etc/postfix/sasl/sasl_passwd

In main.cf:-

Add the line
home_mailbox = Maildir/
if maildir is wanted - recommended. This creates a Maildir in each user's home 
directory when messages for the user are received.

Change the relayhost line to, in my case,
relayhost = auth.smtp.example.com

Change the mynetworks line to
mynetworks = 192.168.2.0/24 localhost


Add
message_size_limit = 0
after the mailbox_size_limit line

Add to the end of main.cf
# SASL SUPPORT FOR SERVERS
#
# Added by David Fletcher using the how-to found at
# 
http://postfix.state-of-mind.de/patrick.koetter/smtpauth/smtp_auth_mailservers.html
#
# The following options set parameters needed by Postfix to enable
# Cyrus-SASL support for authentication of mail servers.
#
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
smtp_sasl_security_options =




Edit the aliases file to deliver incoming mail to the correct boxes then
sudo postalias /etc/aliases
to build the database file.

Might have to hash out the alias_maps line.

Then use:-
sudo postfix reload
to start everything working.



Hope this helps get you going. If you're using the ISP SMTP service you 
shouldn't need the SASL stuff but I use it because with postfix I can and I 
think it's cool.

Also, the home_mailbox is for receiving mail via SMTP, so you won't really 
need to worry about that either for now.

In fact I think all you need to initially do is edit the relayhost and 
mynetworks lines, then do postfix reload. Play with the rest later.

Dave

PS It can be useful and reassuring to have an old, non-production computer to 
play around with things like this.


-- 

Registered Linux user number 393408

I use and recommend the email service at 1 & 1
For domain registration, email and web hosting please visit:
http://oneandone.co.uk/xml/init?k_id=6389763




More information about the ubuntu-users mailing list