个人工具

“UbuntuHelp:DialupEmailHowto”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/DialupEmailHowto}}
 
{{From|https://help.ubuntu.com/community/DialupEmailHowto}}
 
{{Languages|UbuntuHelp:DialupEmailHowto}}
 
{{Languages|UbuntuHelp:DialupEmailHowto}}
 
 
== How To Set Up Email on a Dialup Connection ==
 
== How To Set Up Email on a Dialup Connection ==
 
 
This sets up local handling of mail so a dialup user can read and queue mail while on or off line.  
 
This sets up local handling of mail so a dialup user can read and queue mail while on or off line.  
 
 
This information assumes a standard Ubuntu "warty" setup.
 
This information assumes a standard Ubuntu "warty" setup.
 
 
(Here's the scenario -- I set up Ubuntu on a PC for my Mother-in-law, but she has only one phone line and no broadband. I didn't want to have to explain the error messages she would see if she attemtped to read or compose email when the machine is not online. All the "hooks" exist to automatically retrieve and deliver the email over a ppp connection, but they must be set up.)
 
(Here's the scenario -- I set up Ubuntu on a PC for my Mother-in-law, but she has only one phone line and no broadband. I didn't want to have to explain the error messages she would see if she attemtped to read or compose email when the machine is not online. All the "hooks" exist to automatically retrieve and deliver the email over a ppp connection, but they must be set up.)
 
 
=== Contents ===
 
=== Contents ===
 
 
* 0) Before you start -- Information you need
 
* 0) Before you start -- Information you need
 
* 1) Set up modem (ppp and modemlights)
 
* 1) Set up modem (ppp and modemlights)
第18行: 第12行:
 
* 4) Set the system clock when online (ntpdate)
 
* 4) Set the system clock when online (ntpdate)
 
* 5) Configure email client (Evolution)
 
* 5) Configure email client (Evolution)
 
 
* Finishing touches
 
* Finishing touches
 
* Smooth fonts in Warty
 
* Smooth fonts in Warty
 
* Postfix documentation
 
* Postfix documentation
 
* Comments
 
* Comments
 
 
=== 0) Before you start -- Information you need ===
 
=== 0) Before you start -- Information you need ===
 
 
* The phone number & other modem settings for your Internet Server Provider (ISP)  
 
* The phone number & other modem settings for your Internet Server Provider (ISP)  
 
* Your username and password at your ISP
 
* Your username and password at your ISP
第31行: 第22行:
 
* Your email provider's SMTP server name
 
* Your email provider's SMTP server name
 
* Your email provider's POP or IMAP server name
 
* Your email provider's POP or IMAP server name
 
 
In the examples here, the email provider is fastmail.fm, whose smtp server is smtp.messagingengine.com and whose pop/imap server is mail.messagingengine.com. Fastmail is an actual email ISP whose SMTP and IMAP servers are available to fee-paying subscribers. Please substitute these examples with your own information...
 
In the examples here, the email provider is fastmail.fm, whose smtp server is smtp.messagingengine.com and whose pop/imap server is mail.messagingengine.com. Fastmail is an actual email ISP whose SMTP and IMAP servers are available to fee-paying subscribers. Please substitute these examples with your own information...
 
 
=== 1) Set up modem (ppp and modemlights) ===
 
=== 1) Set up modem (ppp and modemlights) ===
 
 
see [DialupModemHowto]
 
see [DialupModemHowto]
 
 
Test to make sure the system seems to connect properly -- open a web page while connected, etc.
 
Test to make sure the system seems to connect properly -- open a web page while connected, etc.
 
 
=== 2) Set up incoming mail (fetchmail) ===
 
=== 2) Set up incoming mail (fetchmail) ===
 
 
Fetchmail is already installed in Warty, but
 
Fetchmail is already installed in Warty, but
 
 
* some scripts need modification to respect the ppp connection, *and*
 
* some scripts need modification to respect the ppp connection, *and*
 
* there is no configuration file, so fetchmail will not start.
 
* there is no configuration file, so fetchmail will not start.
 
 
Modify the script that runs when the modem connects which is located at /etc/ppp/ip-up.d/fetchmail
 
Modify the script that runs when the modem connects which is located at /etc/ppp/ip-up.d/fetchmail
 
 
Change the '''try-restart''' command to '''start''', so that one line now says:
 
Change the '''try-restart''' command to '''start''', so that one line now says:
 
<pre><nowiki>
 
<pre><nowiki>
 
/etc/init.d/fetchmail start
 
/etc/init.d/fetchmail start
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Also modify the script that runs when the modem disconnects which is located at /etc/ppp/ip-down.d/fetchmail
 
Also modify the script that runs when the modem disconnects which is located at /etc/ppp/ip-down.d/fetchmail
 
 
 
Comment out the '''exit 0''' line in this fetchmail script so it now says:
 
Comment out the '''exit 0''' line in this fetchmail script so it now says:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
#exit 0
 
#exit 0
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Create a fetchmail config file in /etc/fetchmailrc . (Pay special attention to the placement of commas, semicolons and colons)
 
Create a fetchmail config file in /etc/fetchmailrc . (Pay special attention to the placement of commas, semicolons and colons)
 
 
<pre><nowiki>
 
<pre><nowiki>
 
#!/etc/fetchmailrc
 
#!/etc/fetchmailrc
第84行: 第60行:
 
with password my_secret;
 
with password my_secret;
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Comments regarding the script above:
 
Comments regarding the script above:
 
 
* Remember to replace *mail.messagingengine.com* with your email server name.
 
* Remember to replace *mail.messagingengine.com* with your email server name.
 
* This script uses *imap* but *pop3* also works with this provider.
 
* This script uses *imap* but *pop3* also works with this provider.
第93行: 第67行:
 
* The *stripcr* command is commented out because I don't think I need it.  
 
* The *stripcr* command is commented out because I don't think I need it.  
 
* To leave the messages on the mail server, uncomment the *with keep* line. (Fetchmail will only retrieve a message once, but with the *keep* command the original will stay on the server after it's retrieved.)
 
* To leave the messages on the mail server, uncomment the *with keep* line. (Fetchmail will only retrieve a message once, but with the *keep* command the original will stay on the server after it's retrieved.)
 
 
Fetchmail insists on secure permissions for the fetchmail configuration file, so set them securely --
 
Fetchmail insists on secure permissions for the fetchmail configuration file, so set them securely --
 
 
<pre><nowiki>
 
<pre><nowiki>
 
# sudo chmod 0600 /etc/fetchmailrc
 
# sudo chmod 0600 /etc/fetchmailrc
 
</nowiki></pre>
 
</nowiki></pre>
 
 
=== 3) Set Up outgoing mail (postfix) ===
 
=== 3) Set Up outgoing mail (postfix) ===
 
 
The postfix mail server comes installed on Warty, but by default it only delivers system warnings and other messages to the first user on the system. This procedure assumes your ISP requires TLS authentication (which verifies your identity to show you're not a spammer trying to take over their SMTP server).
 
The postfix mail server comes installed on Warty, but by default it only delivers system warnings and other messages to the first user on the system. This procedure assumes your ISP requires TLS authentication (which verifies your identity to show you're not a spammer trying to take over their SMTP server).
 
 
<pre><nowiki>
 
<pre><nowiki>
 
# sudo dpkg-reconfigure postfix
 
# sudo dpkg-reconfigure postfix
 
</nowiki></pre>
 
</nowiki></pre>
 
 
(Many of the following responses are the system defaults)
 
(Many of the following responses are the system defaults)
 
* Choose: satellite system  
 
* Choose: satellite system  
第118行: 第86行:
 
* Mailbox size limit: 0
 
* Mailbox size limit: 0
 
* Local address extension character: +
 
* Local address extension character: +
 
 
Edit the postfix config which is located at /etc/postfix/main.cf
 
Edit the postfix config which is located at /etc/postfix/main.cf
 
Scroll down to the end of the file and add the following lines:
 
Scroll down to the end of the file and add the following lines:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
# lines below added by >you< on >date<
 
# lines below added by >you< on >date<
 
# See http://www.michael-prokop.at/postfix/
 
# See http://www.michael-prokop.at/postfix/
 
 
#Most ISPs block port 25 these days; most ISPs offer port 587 as an alternate.  (Some support ports other than the MSP port, such as 26, 2525, etc.)
 
#Most ISPs block port 25 these days; most ISPs offer port 587 as an alternate.  (Some support ports other than the MSP port, such as 26, 2525, etc.)
 
# Also, the square brackets are supposed to be there-do NOT leave them out.
 
# Also, the square brackets are supposed to be there-do NOT leave them out.
 
relayhost = [mail.messagingengine.com]:587
 
relayhost = [mail.messagingengine.com]:587
 
 
# TLS authentication
 
# TLS authentication
 
smtp_use_tls = yes
 
smtp_use_tls = yes
第135行: 第99行:
 
smtp_sasl_password_maps = hash:/etc/postfix/smtp_auth
 
smtp_sasl_password_maps = hash:/etc/postfix/smtp_auth
 
smtp_sasl_security_options = noanonymous
 
smtp_sasl_security_options = noanonymous
 
 
# Settings for dialup
 
# Settings for dialup
 
defer_transports = smtp
 
defer_transports = smtp
 
disable_dns_lookups = yes
 
disable_dns_lookups = yes
 
 
# Address envelopes to avoid bounces
 
# Address envelopes to avoid bounces
 
masquerade_domains = /etc/mailname
 
masquerade_domains = /etc/mailname
 
</nowiki></pre>
 
</nowiki></pre>
 
 
(Lines beginning with "#" are comments.)  
 
(Lines beginning with "#" are comments.)  
 
 
Add authentication information to config file located here /etc/postfix/smtp_auth
 
Add authentication information to config file located here /etc/postfix/smtp_auth
 
(one line only)
 
(one line only)
 
 
<pre><nowiki>
 
<pre><nowiki>
 
mail.messagingengine.com my_email_address:my_secret_password
 
mail.messagingengine.com my_email_address:my_secret_password
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Put return address host into mailname file located at /etc/mailname
 
Put return address host into mailname file located at /etc/mailname
 
 
<pre><nowiki>
 
<pre><nowiki>
 
fastmail.fm
 
fastmail.fm
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Change the line to the part of your email address *after* the @ sign.
 
Change the line to the part of your email address *after* the @ sign.
 
 
Now, add the updated info to postfix database & restart postfix. (Run this procedure any time you must make changes to the smtp_auth settings; it converts the contents of /etc/postfix/smtp_auth into /etc/postfix/smtp_auth.db, a format postfix expects.)
 
Now, add the updated info to postfix database & restart postfix. (Run this procedure any time you must make changes to the smtp_auth settings; it converts the contents of /etc/postfix/smtp_auth into /etc/postfix/smtp_auth.db, a format postfix expects.)
 
 
<pre><nowiki>
 
<pre><nowiki>
 
# sudo postmap /etc/postfix/smtp_auth
 
# sudo postmap /etc/postfix/smtp_auth
 
# sudo /etc/init.d/postfix restart
 
# sudo /etc/init.d/postfix restart
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Test your postfix setup from the command line by sending a message to yourself:
 
Test your postfix setup from the command line by sending a message to yourself:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
# echo "postfix works" | mail somebody_i_know@fastmail.fm
 
# echo "postfix works" | mail somebody_i_know@fastmail.fm
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Problems? Look in the outgoing mail queue:
 
Problems? Look in the outgoing mail queue:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
# mailq
 
# mailq
 
</nowiki></pre>
 
</nowiki></pre>
 
 
(The message should be gone already if you're online.)  
 
(The message should be gone already if you're online.)  
 
 
If you find a problem, and need to edit the files in /etc/postfix, run the postmap command and restart postfix like described above.
 
If you find a problem, and need to edit the files in /etc/postfix, run the postmap command and restart postfix like described above.
 
 
If you see undeliverable junk in the deferred email queue:
 
If you see undeliverable junk in the deferred email queue:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
# sudo postsuper -d ALL deferred
 
# sudo postsuper -d ALL deferred
 
</nowiki></pre>
 
</nowiki></pre>
 
 
This command removes the messages from the "deferred" queue so the system won't keep trying to deliver them.
 
This command removes the messages from the "deferred" queue so the system won't keep trying to deliver them.
 
 
There are many other postfix commands; see the links in the `Postfix Documentation`_ section.
 
There are many other postfix commands; see the links in the `Postfix Documentation`_ section.
 
 
=== 4) Set the system clock when online (ntpdate) ===
 
=== 4) Set the system clock when online (ntpdate) ===
 
 
Create a script that calls ntpdate when the modem connects:
 
Create a script that calls ntpdate when the modem connects:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
# sudo nano /etc/ppp/ip-up.d/2ntpdate
 
# sudo nano /etc/ppp/ip-up.d/2ntpdate
 
</nowiki></pre>
 
</nowiki></pre>
 
 
<pre><nowiki>
 
<pre><nowiki>
 
#!/bin/sh
 
#!/bin/sh
第207行: 第147行:
 
/etc/init.d/ntpdate restart
 
/etc/init.d/ntpdate restart
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Set permissions on the script you just wrote
 
Set permissions on the script you just wrote
 
 
<pre><nowiki>
 
<pre><nowiki>
 
# sudo chmod 755 /etc/ppp/ip-up.d/2ntpdate
 
# sudo chmod 755 /etc/ppp/ip-up.d/2ntpdate
 
</nowiki></pre>
 
</nowiki></pre>
 
 
=== 5) Configure Email Client (Evolution) ===
 
=== 5) Configure Email Client (Evolution) ===
 
 
Launch Evolution and set it to look for mail in all the right places.
 
Launch Evolution and set it to look for mail in all the right places.
 
 
Tools -- > Settings...
 
Tools -- > Settings...
 
 
Click the "Add" button to create a new account
 
Click the "Add" button to create a new account
 
 
* Receiving Mail: Local Delivery
 
* Receiving Mail: Local Delivery
 
* Receiving Options: check for new mail every minute or two
 
* Receiving Options: check for new mail every minute or two
 
* Sending Mail: Server Type: sendmail
 
* Sending Mail: Server Type: sendmail
 
 
=== Finishing touches ===
 
=== Finishing touches ===
 
Here are some extras to ensure things operate smoothly and easily...
 
Here are some extras to ensure things operate smoothly and easily...
 
 
* Make sure the machine starts and stops without strangeness (it should power down properly, for example).
 
* Make sure the machine starts and stops without strangeness (it should power down properly, for example).
 
* Set GDM to log in automatically if desired  
 
* Set GDM to log in automatically if desired  
第234行: 第165行:
 
* Make fonts smooth using Smooth fonts in Warty
 
* Make fonts smooth using Smooth fonts in Warty
 
* Make GRUB menu usable for another OS if desired
 
* Make GRUB menu usable for another OS if desired
 
 
=== Smooth fonts in Warty ===
 
=== Smooth fonts in Warty ===
 
 
Create the ./fonts.conf file in the home directory to make the fonts look smooth on the screen. If you already have this file, add the parts from <match target="font"> to </match>.
 
Create the ./fonts.conf file in the home directory to make the fonts look smooth on the screen. If you already have this file, add the parts from <match target="font"> to </match>.
 
 
<pre><nowiki>
 
<pre><nowiki>
 
nano ~/.fonts.conf
 
nano ~/.fonts.conf
 
</nowiki></pre>
 
</nowiki></pre>
 
 
<pre><nowiki>
 
<pre><nowiki>
 
<?xml version="1.0"?>
 
<?xml version="1.0"?>
第254行: 第181行:
 
</fontconfig>
 
</fontconfig>
 
</nowiki></pre>
 
</nowiki></pre>
 
 
=== Postfix documentation ===
 
=== Postfix documentation ===
 
 
There's lots of information for using postfix on a dialup connection at Red Hat, though it turns out the Postfix site has lots of information, too. The Debian default package settings are configured a bit differently from Red Hat's, making their advice potentially confusing.  
 
There's lots of information for using postfix on a dialup connection at Red Hat, though it turns out the Postfix site has lots of information, too. The Debian default package settings are configured a bit differently from Red Hat's, making their advice potentially confusing.  
 
 
Here are links to the documentation I have found most helpful:
 
Here are links to the documentation I have found most helpful:
 
 
* Postfix @ michael-prokop.at [http://www.michael-prokop.at/postfix/ Set up postfix using TLS on a Debian box]
 
* Postfix @ michael-prokop.at [http://www.michael-prokop.at/postfix/ Set up postfix using TLS on a Debian box]
 
* [http://www.postfix.org/STANDARD_CONFIGURATION_README.html Postfix Standard Configuration]
 
* [http://www.postfix.org/STANDARD_CONFIGURATION_README.html Postfix Standard Configuration]
第267行: 第190行:
 
* [http://www.redhat.com/support/resources/faqs/RH-postfix-FAQ/book1.html Red Hat Postfix FAQ] (see section 3.14 [http://www.redhat.com/support/resources/faqs/RH-postfix-FAQ/x112.html How can I use Postfix from my dial-up machine at home?])
 
* [http://www.redhat.com/support/resources/faqs/RH-postfix-FAQ/book1.html Red Hat Postfix FAQ] (see section 3.14 [http://www.redhat.com/support/resources/faqs/RH-postfix-FAQ/x112.html How can I use Postfix from my dial-up machine at home?])
 
* [http://www.redhat.com/support/resources/howto/RH-postfix-HOWTO/book1.html Red Hat Postfix HOWTO (See Section 9 [http://www.redhat.com/support/resources/howto/RH-postfix-HOWTO/c241.html Beyond Default])
 
* [http://www.redhat.com/support/resources/howto/RH-postfix-HOWTO/book1.html Red Hat Postfix HOWTO (See Section 9 [http://www.redhat.com/support/resources/howto/RH-postfix-HOWTO/c241.html Beyond Default])
 
 
=== Comments ===
 
=== Comments ===
 
 
TommyTrussell commented on Wed Dec 15 16:58:11 +0000 2004
 
TommyTrussell commented on Wed Dec 15 16:58:11 +0000 2004
 
Subject: Entire original /etc/postfix/main.cf
 
Subject: Entire original /etc/postfix/main.cf
 
Message-ID: <20041215165811+0000@https://www.ubuntulinux.org>
 
Message-ID: <20041215165811+0000@https://www.ubuntulinux.org>
 
that he would post his entire /etc/postfix/main.cf file after editing it as described in the original instructions (from November 30, 2004).  
 
that he would post his entire /etc/postfix/main.cf file after editing it as described in the original instructions (from November 30, 2004).  
 
 
What is now below is an edited version of his second version; the edit should work/resolve the issue he had, and serve as a better example. (See the wiki history if you're interested in the previous versions.)
 
What is now below is an edited version of his second version; the edit should work/resolve the issue he had, and serve as a better example. (See the wiki history if you're interested in the previous versions.)
 
 
Revised 12/16/2004 by TommyTrussell and Aug 2007 by MrElvey
 
Revised 12/16/2004 by TommyTrussell and Aug 2007 by MrElvey
 
 
<pre><nowiki>
 
<pre><nowiki>
 
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
 
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
 
 
# For better performance, chattr -S -R /var/spool/postfix, and use a
 
# For better performance, chattr -S -R /var/spool/postfix, and use a
 
# journaled filesystem to achieve the same results as chattr +S gives.
 
# journaled filesystem to achieve the same results as chattr +S gives.
 
 
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
 
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
 
biff = no
 
biff = no
 
 
# appending .domain is the MUA's job.
 
# appending .domain is the MUA's job.
 
append_dot_mydomain = no
 
append_dot_mydomain = no
 
 
# Uncomment the next line to generate "delayed mail" warnings
 
# Uncomment the next line to generate "delayed mail" warnings
 
#delay_warning_time = 4h
 
#delay_warning_time = 4h
 
 
# Uncomment the next line to use procmail for delivery
 
# Uncomment the next line to use procmail for delivery
 
#mailbox_command = procmail -a "$EXTENSION"
 
#mailbox_command = procmail -a "$EXTENSION"
 
 
myhostname = localhost.localdomain
 
myhostname = localhost.localdomain
 
alias_maps = hash:/etc/aliases
 
alias_maps = hash:/etc/aliases
第302行: 第214行:
 
myorigin = /etc/mailname
 
myorigin = /etc/mailname
 
mydestination = localhost.localdomain, localhost
 
mydestination = localhost.localdomain, localhost
 
 
 
 
# See http://www.michael-prokop.at/postfix/
 
# See http://www.michael-prokop.at/postfix/
 
 
#Most ISPs block port 25 these days; most ISPs offer port 587 as an alternate.  (Some support ports other than the MSP port, such as 26, 2525, etc.)
 
#Most ISPs block port 25 these days; most ISPs offer port 587 as an alternate.  (Some support ports other than the MSP port, such as 26, 2525, etc.)
 
# Also, the square brackets are supposed to be there-do NOT leave them out.
 
# Also, the square brackets are supposed to be there-do NOT leave them out.
 
relayhost = [mail.messagingengine.com]:587
 
relayhost = [mail.messagingengine.com]:587
 
 
mynetworks = 127.0.0.0/8
 
mynetworks = 127.0.0.0/8
 
mailbox_command =
 
mailbox_command =
 
mailbox_size_limit = 0
 
mailbox_size_limit = 0
 
recipient_delimiter = +
 
recipient_delimiter = +
 
 
# lines below added by twt 12/16/2004
 
# lines below added by twt 12/16/2004
 
 
# TLS authentication
 
# TLS authentication
 
smtp_use_tls = yes
 
smtp_use_tls = yes
第323行: 第228行:
 
smtp_sasl_password_maps = hash:/etc/postfix/smtp_auth
 
smtp_sasl_password_maps = hash:/etc/postfix/smtp_auth
 
smtp_sasl_security_options = noanonymous
 
smtp_sasl_security_options = noanonymous
 
 
# Settings for dialup
 
# Settings for dialup
 
defer_transports = smtp
 
defer_transports = smtp
 
disable_dns_lookups = yes
 
disable_dns_lookups = yes
 
 
# Address envelopes to avoid bounces
 
# Address envelopes to avoid bounces
 
masquerade_domains = /etc/mailname
 
masquerade_domains = /etc/mailname
 
</nowiki></pre>
 
</nowiki></pre>
 
 
From TommyTrussell never could get this configuration to work reliably... but with the square brackets now above; perhaps he would...
 
From TommyTrussell never could get this configuration to work reliably... but with the square brackets now above; perhaps he would...
 
 
[[category:CategoryDocumentation]]  
 
[[category:CategoryDocumentation]]  
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2007年11月30日 (五) 16:43的版本

How To Set Up Email on a Dialup Connection

This sets up local handling of mail so a dialup user can read and queue mail while on or off line. This information assumes a standard Ubuntu "warty" setup. (Here's the scenario -- I set up Ubuntu on a PC for my Mother-in-law, but she has only one phone line and no broadband. I didn't want to have to explain the error messages she would see if she attemtped to read or compose email when the machine is not online. All the "hooks" exist to automatically retrieve and deliver the email over a ppp connection, but they must be set up.)

Contents

  • 0) Before you start -- Information you need
  • 1) Set up modem (ppp and modemlights)
  • 2) Set up incoming mail (fetchmail)
  • 3) Set up outgoing mail (postfix)
  • 4) Set the system clock when online (ntpdate)
  • 5) Configure email client (Evolution)
  • Finishing touches
  • Smooth fonts in Warty
  • Postfix documentation
  • Comments

0) Before you start -- Information you need

  • The phone number & other modem settings for your Internet Server Provider (ISP)
  • Your username and password at your ISP
  • Your username and password at your email provider (if different)
  • Your email provider's SMTP server name
  • Your email provider's POP or IMAP server name

In the examples here, the email provider is fastmail.fm, whose smtp server is smtp.messagingengine.com and whose pop/imap server is mail.messagingengine.com. Fastmail is an actual email ISP whose SMTP and IMAP servers are available to fee-paying subscribers. Please substitute these examples with your own information...

1) Set up modem (ppp and modemlights)

see [DialupModemHowto] Test to make sure the system seems to connect properly -- open a web page while connected, etc.

2) Set up incoming mail (fetchmail)

Fetchmail is already installed in Warty, but

  • some scripts need modification to respect the ppp connection, *and*
  • there is no configuration file, so fetchmail will not start.

Modify the script that runs when the modem connects which is located at /etc/ppp/ip-up.d/fetchmail Change the try-restart command to start, so that one line now says:

/etc/init.d/fetchmail start

Also modify the script that runs when the modem disconnects which is located at /etc/ppp/ip-down.d/fetchmail Comment out the exit 0 line in this fetchmail script so it now says:

#exit 0

Create a fetchmail config file in /etc/fetchmailrc . (Pay special attention to the placement of commas, semicolons and colons)

#!/etc/fetchmailrc
#
# global options
# set logging to syslog
set syslog
# set to run as daemon with poll interval (seconds)
set daemon 240
#
poll mail.messagingengine.com:
# server options
with nodns,
with protocol imap,
# user options
user remote_account_name there, is, local_account_name here,
# with stripcr,
# with keep,
with password my_secret;

Comments regarding the script above:

  • Remember to replace *mail.messagingengine.com* with your email server name.
  • This script uses *imap* but *pop3* also works with this provider.
  • Substitute your email account name (to the left of the @ sign) for *remote_account_name*.
  • Substitute your ubuntu login name for *local_account_name*.
  • The *stripcr* command is commented out because I don't think I need it.
  • To leave the messages on the mail server, uncomment the *with keep* line. (Fetchmail will only retrieve a message once, but with the *keep* command the original will stay on the server after it's retrieved.)

Fetchmail insists on secure permissions for the fetchmail configuration file, so set them securely --

# sudo chmod 0600 /etc/fetchmailrc

3) Set Up outgoing mail (postfix)

The postfix mail server comes installed on Warty, but by default it only delivers system warnings and other messages to the first user on the system. This procedure assumes your ISP requires TLS authentication (which verifies your identity to show you're not a spammer trying to take over their SMTP server).

# sudo dpkg-reconfigure postfix

(Many of the following responses are the system defaults)

  • Choose: satellite system
  • Mail name: localhost.localdomain
  • SMTP Relay host: smtp.messagingengine.com
  • Other destinations to accept mail for: localhost.localdomain, localhost
  • Force synchronous updates on mail queue: Yes
  • Local networks: 127.0.0.0/8
  • Use procmail for local delivery: No
  • Mailbox size limit: 0
  • Local address extension character: +

Edit the postfix config which is located at /etc/postfix/main.cf Scroll down to the end of the file and add the following lines:

# lines below added by >you< on >date<
# See http://www.michael-prokop.at/postfix/
#Most ISPs block port 25 these days; most ISPs offer port 587 as an alternate.  (Some support ports other than the MSP port, such as 26, 2525, etc.)
# Also, the square brackets are supposed to be there-do NOT leave them out.
relayhost = [mail.messagingengine.com]:587
# TLS authentication
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/smtp_auth
smtp_sasl_security_options = noanonymous
# Settings for dialup
defer_transports = smtp
disable_dns_lookups = yes
# Address envelopes to avoid bounces
masquerade_domains = /etc/mailname

(Lines beginning with "#" are comments.) Add authentication information to config file located here /etc/postfix/smtp_auth (one line only)

mail.messagingengine.com my_email_address:my_secret_password

Put return address host into mailname file located at /etc/mailname

fastmail.fm

Change the line to the part of your email address *after* the @ sign. Now, add the updated info to postfix database & restart postfix. (Run this procedure any time you must make changes to the smtp_auth settings; it converts the contents of /etc/postfix/smtp_auth into /etc/postfix/smtp_auth.db, a format postfix expects.)

# sudo postmap /etc/postfix/smtp_auth
# sudo /etc/init.d/postfix restart

Test your postfix setup from the command line by sending a message to yourself:

# echo "postfix works" | mail somebody_i_know@fastmail.fm

Problems? Look in the outgoing mail queue:

# mailq

(The message should be gone already if you're online.) If you find a problem, and need to edit the files in /etc/postfix, run the postmap command and restart postfix like described above. If you see undeliverable junk in the deferred email queue:

# sudo postsuper -d ALL deferred

This command removes the messages from the "deferred" queue so the system won't keep trying to deliver them. There are many other postfix commands; see the links in the `Postfix Documentation`_ section.

4) Set the system clock when online (ntpdate)

Create a script that calls ntpdate when the modem connects:

# sudo nano /etc/ppp/ip-up.d/2ntpdate
#!/bin/sh
# update time when online
/etc/init.d/ntpdate restart

Set permissions on the script you just wrote

# sudo chmod 755 /etc/ppp/ip-up.d/2ntpdate

5) Configure Email Client (Evolution)

Launch Evolution and set it to look for mail in all the right places. Tools -- > Settings... Click the "Add" button to create a new account

  • Receiving Mail: Local Delivery
  • Receiving Options: check for new mail every minute or two
  • Sending Mail: Server Type: sendmail

Finishing touches

Here are some extras to ensure things operate smoothly and easily...

  • Make sure the machine starts and stops without strangeness (it should power down properly, for example).
  • Set GDM to log in automatically if desired
  • Adjust Gnome screen resolution, colors and font sizes for user's eyes as necessary
  • Make fonts smooth using Smooth fonts in Warty
  • Make GRUB menu usable for another OS if desired

Smooth fonts in Warty

Create the ./fonts.conf file in the home directory to make the fonts look smooth on the screen. If you already have this file, add the parts from <match target="font"> to </match>.

nano ~/.fonts.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font">
<edit name="autohint" mode="assign">
<bool>true</bool>
</edit>
</match>
</fontconfig>

Postfix documentation

There's lots of information for using postfix on a dialup connection at Red Hat, though it turns out the Postfix site has lots of information, too. The Debian default package settings are configured a bit differently from Red Hat's, making their advice potentially confusing. Here are links to the documentation I have found most helpful:

Comments

TommyTrussell commented on Wed Dec 15 16:58:11 +0000 2004 Subject: Entire original /etc/postfix/main.cf Message-ID: <20041215165811+0000@https://www.ubuntulinux.org> that he would post his entire /etc/postfix/main.cf file after editing it as described in the original instructions (from November 30, 2004). What is now below is an edited version of his second version; the edit should work/resolve the issue he had, and serve as a better example. (See the wiki history if you're interested in the previous versions.) Revised 12/16/2004 by TommyTrussell and Aug 2007 by MrElvey

# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# For better performance, chattr -S -R /var/spool/postfix, and use a
# journaled filesystem to achieve the same results as chattr +S gives.
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
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
# Uncomment the next line to use procmail for delivery
#mailbox_command = procmail -a "$EXTENSION"
myhostname = localhost.localdomain
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = localhost.localdomain, localhost
# See http://www.michael-prokop.at/postfix/
#Most ISPs block port 25 these days; most ISPs offer port 587 as an alternate.  (Some support ports other than the MSP port, such as 26, 2525, etc.)
# Also, the square brackets are supposed to be there-do NOT leave them out.
relayhost = [mail.messagingengine.com]:587
mynetworks = 127.0.0.0/8
mailbox_command =
mailbox_size_limit = 0
recipient_delimiter = +
# lines below added by twt 12/16/2004
# TLS authentication
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/smtp_auth
smtp_sasl_security_options = noanonymous
# Settings for dialup
defer_transports = smtp
disable_dns_lookups = yes
# Address envelopes to avoid bounces
masquerade_domains = /etc/mailname

From TommyTrussell never could get this configuration to work reliably... but with the square brackets now above; perhaps he would...