# [SOLVED] fetchmailrc query

## taipan67

In a user-specific ~/.fetchmailrc file that looks something like this...

```
set daemon 300

set postmaster <this username>

set nobouncemail

set logfile ~/fetchmail.log

## GMX account

poll imap.gmx.com

   user "<username>@gmx.com" pass "<password>"

## Multiple sub-accounts on ISP's mail-server

poll <isp.server.fqdn>

   user "1st-username" pass "1st-password"

   user "2nd-username" pass "2nd-password"

   user "3rd-username" pass "3rd-password"

   user "4th-username" pass "4th-password"

```

...Can i define one MDA to cover every server-poll, and also define an 'ssl' requirement once only, again to cover every server-poll, or must i repeat the same information 5 times, once on each user-line. Both the 'mda' and 'ssl' keywords are defined in the fetchmail-manpage as 'user options' as opposed to 'global' or 'server' options, so i'm unsure about placing either definition on a poll-line or with the global settings, and i want to ask for advice first rather than just using a 'trial-and-error' approach.

Thanks in advance...   :Wink: 

----------

## taipan67

Ended up going with 'trial-and-error' - the result is that this...

```
## Multiple sub-accounts on ISP's mail-server

poll <isp.server.fqdn>

   user "1st-username" pass "1st-password"

   user "2nd-username" pass "2nd-password"

   user "3rd-username" pass "3rd-password"

   user "4th-username" pass "4th-password"

   mda /usr/libexec/dovecot/deliver
```

...works for 'username-4', but fails for 'username-2' with...

```
fetchmail: Trying to connect to 127.0.0.1/25...connection failed.

fetchmail: connection to localhost:smtp [127.0.0.1/25] failed: Connection refused.

fetchmail: SMTP connect to localhost failed

......

fetchmail: SMTP transaction error while fetching from <2nd-username>@<isp.server.fqdn> and delivering to SMTP host localhost
```

...(I've edited the account-details for privacy's sake) - evidently fetchmail isn't aware that an MDA is required for every username, and reverts to it's default behaviour of delivery to the local mail-server (which doesn't exist).

Changing '~/.fetchmailrc' to this...

```
## Multiple sub-accounts on ISP's mail-server

poll <isp.server.fqdn>

   user "1st-username" pass "1st-password"

   mda /usr/libexec/dovecot/deliver

   user "2nd-username" pass "2nd-password"

   mda /usr/libexec/dovecot/deliver

   user "3rd-username" pass "3rd-password"

   mda /usr/libexec/dovecot/deliver

   user "4th-username" pass "4th-password"

   mda /usr/libexec/dovecot/deliver
```

...makes it work as intended - i just think it's bloody ridiculous that one piece of information needs to be replicated in this way! I thought i'd try the fetchmail user-lists for an answer, but Firefox-3 refuses to accept their certificate at 'BerliOS' - dunno if i can be bothered to work my way around that...   :Rolling Eyes: 

Does anybody know of a more elegant solution that i can use..?   :Sad: 

----------

## taipan67

A bit late in the game i know, but i've just had occasion to revisit this problem, and i found the solution, in case anybody also needs it.

In a nutshell, my 'fetchmailrc' that previously looked something like this:-

```
set daemon 300 

set postmaster <this username> 

set nobouncemail 

set logfile ~/fetchmail.log 

## GMX account 

poll imap.gmx.com proto imap

   user "<username>@gmx.com" pass "<password>" ssl sslcertck

   mda /usr/lib/dovecot/deliver

## Multiple sub-accounts on ISP's mail-server 

poll <isp.server.fqdn> proto imap

   user "1st-username" pass "1st-password" ssl sslcertck

   mda /usr/lib/dovecot/deliver

   user "2nd-username" pass "2nd-password" ssl sslcertck

   mda /usr/lib/dovecot/deliver

   user "3rd-username" pass "3rd-password" ssl sslcertck

   mda /usr/lib/dovecot/deliver

   user "4th-username" pass "4th-password" ssl sslcertck

   mda /usr/lib/dovecot/deliver
```

...now looks something like this:-

```
set daemon 300 

set postmaster <this username> 

set nobouncemail 

set logfile ~/fetchmail.log 

## Server/user defaults

defaults proto imap

   user "dummy_name" ssl sslcertck mda /usr/lib/dovecot/deliver

## GMX account 

poll imap.gmx.com

   user "<username>@gmx.com" pass "<password>"

## Multiple sub-accounts on ISP's mail-server 

poll <isp.server.fqdn>

   user "1st-username" pass "1st-password"

   user "2nd-username" pass "2nd-password"

   user "3rd-username" pass "3rd-password"

   user "4th-username" pass "4th-password"
```

The main trick is to use a dummy user-name in the 'defaults' section just to create a 'user' section, because the various options are either server or user-specific, and can be over-ridden by later entries anyway.   :Cool: 

Hope that's of use to someone...   :Wink: 

----------

