# help needed for mail setup

## reaz82

hi.

i have cable internet from road runner (time warner). my pc's are connected via a router to the cable modem. therefore i have an internal lan. i'd like to set up one workstation so that it can fetch mail from a remote server and deliver it to me on my workstation. this will also enable me to write email on my box and deliver via smtp from my box to the internet. so far i have been able to use the documentation to set up postfix and that enables me to send people email.. however they see it coming from eros.austin.rr.com (i chose eros as my hostname and austin.rr.com as my domain name which is wrong.. i need help with this too if possible).. so what are the suggestions..? i'd be happy to provide more info if necessary..

thank you

----------

## jimlynch11

why not just create an email address with twcable...that way you can just connect to their servers and let them do all the backend work, and you dont have to worry about setting it all up...

also, check out this thread:

https://forums.gentoo.org/viewtopic.php?t=56633&highlight=

----------

## reaz82

 *jimlynch11 wrote:*   

> why not just create an email address with twcable...that way you can just connect to their servers and let them do all the backend work, and you dont have to worry about setting it all up...

 

true but i already have an email account at the university for receiving email.. i want to fetch that email to my pc so that i can use something like mutt or pine to read it off my computer.. it's much faster this way due to the lag i face when i connect to university servers..

----------

## jkcunningham

My system at home is similar to what you are trying to set up. I don't use my cable ISP mail servers, because I have a different account I use common to numerous locations. I am using postfix to send. You can tell it what your ReplyTo: address is in several ways in /etc/postfix/main.conf, etc. but I believe that's overkill. All you really need to do is add a couple lines to your .bashrc that say:

```

export $EMAIL=you@correct.org

export $REPLYTO=$EMAIL

```

and procmail uses one of these values by default (probably the REPLYTO). If it doesn't find this, it makes up one of its own using user@<localhostname>.<localhostdomain>

-Jeff

----------

## reaz82

 *jkcunningham wrote:*   

> My system at home is similar to what you are trying to set up. I don't use my cable ISP mail servers, because I have a different account I use common to numerous locations. I am using postfix to send. You can tell it what your ReplyTo: address is in several ways in /etc/postfix/main.conf, etc. but I believe that's overkill. All you really need to do is add a couple lines to your .bashrc that say:
> 
> ```
> 
> export $EMAIL=you@correct.org
> ...

 

what is procmail? i do not have it merged into my system.. ok this will solve my problem of sending email with the correct reply to address.. i think i might require help understanding how fetchmail works.. so far i merged it and got it up and running.. it seems to go to my remote imap mailbox and read the contents but i do not know or understand what it does next... can anyone help me configure it so that it brings the remote mail to my pc?

thank you

----------

## reaz82

i still need help setting up fetchmail to fetch remote mail and setting up such that i can read the mail locally? does it do that automatically do that??

how do i check mail once i have it set up

----------

## jkcunningham

Sorry, I meant postfix. Procmail you use as an MTA between fetchmail and your  mailbox(es) on the receive side. Here's my rc files for the receive side, if it helps:

```

# ~/.fetchmailrc

set postmaster "username"

set bouncemail

set no spambounce

set properties ""

# set check for mail interval in number of seconds 

set daemon 120

poll getmail.somedomain.com with proto POP3

       user 'sillyavatar' there with password 'password' is 'username' here

       options fetchall stripcr warnings 3600 mda '/usr/bin/procmail -f -'

```

```

# ~/.procmailrc

SHELL=/bin/sh       # Shell used to run procmail.

                            # Be sure this points to sh.  DO NOT substitute a

                            #different shell unless you really know UNIX

LINEBUF=4096      #Needed to keep Procmail from choking on long

                            #"recipes", or instructions on what to do with

                            #particular kinds of email.

PATH=$HOME/bin:/bin:/usr/bin:/usr/local/bin

                            #Path for your programs -- this is probably best

                            #left alone.

#++++++++#

VERBOSE=on        #Change this to "on" when you try a new recipe

#++++++++#          #so that Procmail will log literally every step

                            #it takes.  DO NOT LEAVE IT ON, though, because

                            #it creates huge logfiles.

MAILDIR=${HOME}/Mail        #Make sure this directory exists.  Create

                            #the directory ${MAILDIR}/backup at this time.

DEFAULT=/var/spool/mail/username

                            # This variable MUST be set properly, or procmail

                            # will eat your email for lunch.  

  ### note: postfix delivers regular mail to $DEFAULT

LOGFILE=${HOME}/procmail.log

#LOGFILE=${MAILDIR}/log  #Logs message disposition.  

ADMINFOLDER=${MAILDIR}/admin  #for bounced mail, mail from root,

                                        #postmaster, abuse, etc. 

FORMAIL=/usr/bin/formail    #Needed for autoreply recipes.  Modify this to                  

                                        #point to your system's copy of formail.

SENDMAIL=/usr/sbin/sendmail #useful for autoreply recipes.  

                                        # Modify this to point to your system's copy 

                                        # of sendmail.

# BEGIN RECIPES

#----------------------------------------------------------------------------

# First create a backup cache of 100 most recent messages in case

# you screw this up. 

# For this to work, you must first create the directory

# ${MAILDIR}/backup. This is a mh format mail file

# You can disable it once everything is hunky-dory

:0 c

${HOME}/.mail.backup

  :0 ic

  | cd backup && rm -f dummy `ls -t msg.* | sed -e 1,100d`

# Regenerate "From" lines to make sure they are valid

:0 fhw

| formail -I "From " -a "From "

#----------------------------------------------------------------------------

# Mail from cron's

#:0:

#* ^From:.*[Cc]ron [Dd]aemon|\

#  ^Subject: heartbeat

#cron/

#----------------------------------------------------------------------------

# Mail from myself

:0:

* ^(From).*(myaliase1|myaliase2)

notes/

#----------------------------------------------------------------------------

# SOLICITED SPAM MAIL

# Put mail from various pests into special mailbox 

:0:

* ^(From).*(amazon.com|science-mailer|@aaas.org)

BULKFOLDER/

#----------------------------------------------------------------------------

# Notices

:0:

* ^From:.*Red Hat Network|\

  ^From:.*@linuxmail\.org|\

  ^From.*@forums\.gentoo\.org

notices/

#----------------------------------------------------------------------------

# Pipe the mail through spamassassin (replace 'spamassassin' with 'spamc'

# if you use the spamc/spamd combination)

# The condition line ensures that only messages smaller than 250 kB

# (250 * 1024 = 256000 bytes) are processed by SpamAssassin. Most spam

# isn't bigger than a few k and working with big messages can bring

# SpamAssassin to its knees.

:0fw: spamassassin.lock

* < 256000

| spamassassin

## NOTE: must have trailing '/' on Maildir directory names for this to

## work right. Without them, the mail does not go in the /new directory

# Mails with a score of 15 or higher are almost certainly spam (with 0.05%

# false positives according to rules/STATISTICS.txt). Let's put them in a

# different mbox. (This one is optional.)

:0:

* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

spam-yes/

# All mail tagged as spam (eg. with a score higher than the set threshold)

# is moved to "probably-spam".

:0:

* ^X-Spam-Status: Yes

spam-probably/

#----------------------------------------------------------------------------

# This is the way to shitcan an email totally

:0

* ^From: biggerdicks@cyberscam\.com

/dev/null

#----------------------------------------------------------------------------

# Accept all the rest to your default mailbox

:0:

${DEFAULT}

```

I hope that helps. You will want to emerge Mail-SpamAssassin and anything else you have missing. The logs will clue you in on what's wrong. Turn verbosity off once its right. 

Have fun. 

-Jeff

----------

## jkcunningham

BTW: the syntax in the .procmailrc produces maildir format mailboxes. If you want mbox, take off the trailing slashes on the destination directories and add locks (":0:" instead of ":0"). Go read the procmail manual for details.

----------

