Mail

Using your ISP's SMTP server with postfix

Unlike esmtp, using your ISP's SMTP server with postfix will still allow local mail to be delivered. Any hosts listed in the mydestination option will be exempt from the SMTP relay.

Set up ISP info

Create /etc/postfix/sasl_passwd, like so:

mail.my-isp.org      username:password

Protect this file, since it has a plaintext password:

chown root.root /etc/postfix/sasl_passwd && chmod 600 /etc/postfix/sasl_passwd

Create sasl_passwd DB file

postmap hash:/etc/postfix/sasl_passwd

Setting up test user email accounts on a domU

Replace domU below with the hostname of your virtual machine and username with your personal user account.

On domU

Install a mail transfer agent and imap server

sudo apt-get install postfix dovecot

Set up postfix

Create a /etc/postfix/virtual file with entries like so:

@domU username@domU
@localhost username@domU

Generate the virtual.db:

postmap /etc/postfix/virtual

Tell postfix about your new virtual setup by adding the following to /etc/postfix/main.cf:

Replacing sendmail with esmtp

esmtp is a drop-in replacement for sendmail. If you're on DSL and everyone in the world blacklists your IP, you can set up esmtp with your DSL-provided SMTP information and continue sending mail as usual.

Install

# apt-get install esmtp

Configure

Edit /etc/esmtprc. You'll probably just need to change hostname, username, and password.

Link it up

# ln -sf /usr/bin/esmtp /usr/sbin/sendmail

Syndicate content