# ADSL Mail Setup

## AscendantMage

Heya, all   :Laughing: 

I'm getting really frustrated not getting mail-fetching to work, so I'll post here...

My computer is connected through the net on an ADSL connection, using DHCP to get my IP number. The ISP does not assign hostnames to the individual IPs.

My setup is (supposed to be ? ) :

* fetchmail running as a daemon fetching mail from the mailserver

* postfix handling mail (in & out)

* procmail sorting mail through the SpamAssassin filter to get rid of the majority of spam

How do I configure the postfix main.cf to get it to run properly ?

Whenever I run fetchmail (either as a daemon as root, or locally as a user), it never seems to get the mail through... it just stops on the first message, not flushing it.

Any suggestions ?

Anyone experienced with a similar setup ???

----------

## AscendantMage

 *AscendantMage wrote:*   

> Heya, all  
> 
> My setup is (supposed to be ? ) :
> 
> * fetchmail running as a daemon fetching mail from the mailserver
> ...

 

All right, now I tried exim in the same place. It complains that it can't deliver to localhost.

This is driving me nuts.

Is there a simpler setup ?

All I want is my machine to...

- fetch mail from my two mailaccounts (one IMAP, one POP3) + my girlfriends account (IMAP)

- run the downloaded mail through procmail/SpamAssassin with a .forward file

- put the sorted mail into the respective .maildirs

Is this impossible to get working properly when you're on an ADSL with no FQDN ????

----------

## sieter

What´s the error-message?

I´m running exim with an adsl line too...

Try #exim -bt -d9 root@localhost,

should tell you a bit more   :Wink: 

----------

## AscendantMage

 *sieter wrote:*   

> What´s the error-message?
> 
> I´m running exim with an adsl line too...
> 
> Try #exim -bt -d9 root@localhost,
> ...

 

Reinstalled exim.

Your suggested comman only returned that it failed to connect to localhost - and the d9 gave me an error message...

I've gone back to postfix - I got it to work ONCE before installing Gentoo 1.4 - but unfortunately, the settings from then gives me errors... Sh*t.

----------

## sieter

Eh, sorry, 

exim 4 uses a space in "-d 9"

 :Embarassed: 

If you can´t connect to localhost, the probably the daemon isn´t started?

did you add it with rc-update add...?

Also try telnet localhost smtp and see if you get an answer....

... or do your postfix thing...   :Rolling Eyes: 

----------

## AscendantMage

 *sieter wrote:*   

> Eh, sorry, 
> 
> exim 4 uses a space in "-d 9"
> 
> If you can´t connect to localhost, the probably the daemon isn´t started?
> ...

 

Gave that a shot - mind you, I haven't changed  exim.conf at all.

Somethings not quite right with the debug setting you're suggesting; anyways here's the output (quite long...)

root@phoenix [ ~ ] # exim -bt -d 9 root@localhost

Exim version 4.12 uid=0 gid=0 pid=14727 D=fddcaefd

Berkeley DB: Sleepycat Software: Berkeley DB 3.2.9: (January 24, 2001)

Support for: PAM Perl TCPwrappers OpenSSL

Authenticators: cram_md5 plaintext spa

Routers: accept dnslookup ipliteral manualroute queryprogram redirect

Transports: appendfile/maildir/mbx autoreply pipe smtp

changed uid/gid: forcing real = effective

  uid=0 gid=0 pid=14727

  auxiliary group list: <none>

configuration file is /etc/exim/exim.conf

log selector = 0106ccd8

trusted user

admin user

originator: uid=0 gid=0 login=root name=root

sender address = root@phoenix.tiscali.no

Address testing: uid=0 gid=12 euid=0 egid=12

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Testing 9@phoenix.tiscali.no

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Considering 9@phoenix.tiscali.no

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

routing 9@phoenix.tiscali.no

--------> dnslookup router <--------

local_part=9 domain=phoenix.tiscali.no

checking domains

phoenix.tiscali.no in "@"? yes (matched "@")

phoenix.tiscali.no in "! +local_domains"? no (matched "! +local_domains")

cached lookup data = NULL

dnslookup router skipped: domains mismatch

--------> system_aliases router <--------

local_part=9 domain=phoenix.tiscali.no

calling system_aliases router

rda_interpret (string): ${lookup{$local_part}lsearch{SYSTEM_ALIASES_FILE}}

search_open: lsearch "SYSTEM_ALIASES_FILE"

system_aliases router: defer for 9@phoenix.tiscali.no

  message: failed to expand "${lookup{$local_part}lsearch{SYSTEM_ALIASES_FILE}}": failed to open SYS   

TEM_ALIASES_FILE for linear search: No such file or directory

9@phoenix.tiscali.no cannot be resolved at this time:

  failed to expand "${lookup{$local_part}lsearch{SYSTEM_ALIASES_FILE}}": failed to open SYSTEM_ALIAS   

ES_FILE for linear search: No such file or directory

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Testing root@localhost

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Considering root@localhost

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

routing root@localhost

--------> dnslookup router <--------

local_part=root domain=localhost

checking domains

localhost in "@"? no (end of list)

localhost in "! +local_domains"? yes (end of list)

cached lookup data = NULL

calling dnslookup router

dnslookup router called for root@localhost

  domain = localhost

DNS lookup of localhost (MX) gave NO_DATA

returning DNS_NODATA

DNS lookup of localhost (A) succeeded

127.0.0.1 in "0.0.0.0 : 127.0.0.0/8"? yes (matched "127.0.0.0/8")

ignored host localhost [127.0.0.1]

dnslookup router declined for root@localhost

"more" is false: skipping remaining routers

no more routers

root@localhost is undeliverable:

  Unrouteable address

search_tidyup called

>>>>>>>>>>>>>>>> Exim pid=14727 terminating with rc=2 >>>>>>>>>>>>>>>>

----------

## sieter

Ok, the debug setting should be just -d    :Rolling Eyes:  ,

nevermind,

you have to edit your /etc/exim/exim.conf:

primary_hostname = whatever.your.hostname.is

domainlist local_domains = @ : localhost <----- That caused the error I think!

# In the routers section, edit system_aliases to look like this:

data = ${lookup{$local_part}lsearch{/etc/aliases}

#Then: touch /etc/aliases

that way, your mails should be delivered correctly   :Very Happy: 

hope that helped,

sieter

----------

## AscendantMage

 *sieter wrote:*   

> Ok, the debug setting should be just -d    ,
> 
> nevermind,
> 
> you have to edit your /etc/exim/exim.conf:
> ...

 

That is one of the problems - I don't "really" have one. My ADSL ISP does not asign hostnames to each PC connected.

 *sieter wrote:*   

> 
> 
> domainlist local_domains = @ : localhost <----- That caused the error I think!
> 
> 

 

Awright, changed that

 *sieter wrote:*   

> 
> 
> # In the routers section, edit system_aliases to look like this:
> 
> data = ${lookup{$local_part}lsearch{/etc/aliases}
> ...

 

 *sieter wrote:*   

> 
> 
> that way, your mails should be delivered correctly  
> 
> hope that helped,
> ...

 

It did ! I put whatever I have in /etc/hostname in the hostname-part - and now it works. WOW ! 

 :Laughing:   :Surprised:   :Surprised:   :Very Happy: 

----------

## AscendantMage

OK.

Now it worked.

Or so, it seemed.

Whenever mail is sent to my adress, it is delivered, and I get it in my mailbox at my home computer. But people sending mail to me STILL get bounce messages.

One such is quoted below.

This doesn't make much sense to me, since I actually *get* the messages, put error messages are still sent back...

This message was created automatically by mail delivery software.

Error message is as follows:

 *Quote:*   

> 
> 
> A message that you sent could not be delivered to one or more of its
> 
> recipients. This is a permanent error. The following address(es) failed:
> ...

 

----------

## sieter

Hi,

You use the 'usr/bin/procmail ' - pipe in your .forward file, right?

So, as far as I can see from the error message, the -P option in the procmail command is no longer valid.

That means procmail returns with != 0 and exim thinks it failed;

It might be just a warning though...

So, if you use -P option , remove it;

otherwise, please post the relevant parts of your config,

happy mailing 

 :Laughing: 

sieter

----------

## AscendantMage

 *sieter wrote:*   

> 
> 
> You use the 'usr/bin/procmail ' - pipe in your .forward file, right?
> 
> So, as far as I can see from the error message, the -P option in the procmail command is no longer valid.
> ...

 

The problem seems to be there somewhere - as temporarily "disabling" the .forward file stopped the bouncing (but unfortunately also started putting mail in a /var/mail/username spool file, which is not what I wanted.

My .forward is just this:

 *Quote:*   

> 
> 
> "| /usr/bin/procmail"
> 
> 

 

My .procmailrc:

 *Quote:*   

> 
> 
> :0fw
> 
> | spamassassin -P
> ...

 

 *sieter wrote:*   

> 
> 
> It might be just a warning though...
> 
> So, if you use -P option , remove it;
> ...

 

As you can see, my configs don't contain the -P option.

So the error must be somewhere else. It doesn't seem like SpamAssassin is to blame, as it has sorted out the spam messages perfectly so far. Hmmm...

Are these the relevant info you needed ?   :Laughing: 

----------

## AscendantMage

 *AscendantMage wrote:*   

> 
> 
> My .procmailrc:
> 
> :0fw
> ...

 

NAILED it.

This sucker was to blame.

spamassassin no longer needs -P either.

Wheee !

 :Laughing:   :Laughing:   :Laughing:   :Laughing: 

----------

## sieter

Yep,

it´s spamassassin -P that throws the warning   :Rolling Eyes: 

from the README in Spamassasin:

[/quote]

Please note that the use of the following commandline parameters for

spamassassin and spamd have been deprecated!  They will still work in

the 2.5x series (a warning will be displayed), but they will be removed

in the next major release.  If you currently use these flags, please

remove them.  The flags are:	--add-from, --pipe, -F, -P

 *Quote:*   

> 
> 
> You wont need -P any more if you use version >= 2.5...
> 
> If that doesn´t do it, try Q0621 from the exim-FAQ at
> ...

 

----------

## AscendantMage

OK.

All the previous tips and tricks seemed to work - or at least so it seems. I haven't had the need to send mail to anyone since the last time I struggled with the mail setup - but I had to a couple of days ago.

I then discovered that the mail was never sent - but the exim mailer returned the following errors:

(the names have been changed to protect the innocent)   :Very Happy: 

```

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its

recipients. This is a permanent error. The following address(es) failed:

  someone@somewhere.com

    SMTP error from remote mailer after MAIL FROM:<myuser@myFICTIVEDOMAIN.MYISP.no> SIZE=4010:

    host mailwall1.statoil.com [143.97.143.27]: 553 5.1.8 <myuser@myFICTIVEDOMAIN.MYISP.no>... Domain of s\

ender address myuser@myFICTIVEDOMAIN.MYISP.no does not exist

```

Now what ?

Exim wouldn't run at ALL without a FQDN; or so it seemed, but it won't send mail out 'cause the domain doesn't register as a FQDN. Damn !   :Twisted Evil: 

Help REALLY needed.

[/quote]

----------

