So what does it do ?
PopFetch periodically connects to a POP server and collects all mail for a specific
email account. It then feeds that mail to a local SMTP server so that it is ready
for collection by email clients on the local network.
When PopFetch feeds the messages to the SMTP server it addresses them to the same
recipient
PopFetch can be set to change the domain name of the recipient address(es) before it
passes them on to the SMTP server so that the SMTP server delivers them to local users,
e.g. if PopFetch collects messages from a POP server at netwin.co.nz ,
say for john@netwin.co.nz,
and PopFetch is set to re-address for say branch_office.netwin.co.nz, then it will
re-address the message to john as,
john@branch_office.netwin.co.nz
In conjunction with Netwin's DSMTP, SMTP server . . .
PopFetch works in conjunction with DSMTP (Netwin's SMTP server) so that when it starts
a dial up networking connection, DSMTP can deliver all mail waiting to be sent to
non-local addresses.
What happens when a message cannot be delivered?
POPFetch always copies the current message that it is retrieving to
file (msg.dat), it then tries to send the message immediately on to the
SMTP server. If for any reason this delivery fails, POPFetch stops
and closes all TCPIP connections and waits for the next
dial up time, at which point it will try to send the unsuccessful
message again.
If the message cannot be delivered, because the information stored in msg.dat
is corrupt, or the message cannot be sent to any users - even the default address to
say that a user cannot be reached, then POPFetch will write the message
to a 'duds' file, duds.dat. There is a safety net setting, max_duds with a
default of 10, such that if POPFetch detects that it has delivered
the max_duds number of messages in a row to duds.dat then it will shut
itself down (stop the popfetch service on NT).
Notes:
-
If a message fails to be delivered to the SMTP server,
POPFetch stops and closes all TCPIP connections and waits for the next
dial up time, at which point it will try to send the unsuccessful
message again.
- Every time the ras_timer period is reached, popfetch will try to retrieve mail for all accounts
specified by a pf_user line.
- If a message cannot be delivered, for example if the recipient does
not exist or the SMTP server rejects the recipient address, then the fallback
address will receive the message instead. POPFetch adds some informational
lines to the message body stating which recipients have received the message
and which have not.
- log_path \dmail\log (\getall.log)
- work_dir defaults to no path, then log_path def to work dir
- Ras timer sets period of dial rather than interval, by default
(isinterval=FALSE)
- POPFetch knows that the next line of an SMTP response is part of the same
comment when the fourth character of the response is a dash, '-'.
- reads headers that go over multiple lines. The only header where this
matters for POPFetch is the header set by pf_header
- if the pf_header setting cannot be found in the message to be sent out,
POPFetch looks for the 'X-Rcpt-To: ' header, followed by the 'To: ' header,
then if even that header cannot be found it will send the message to the
default address, if that does not exist then the
message will be appended to the duds file, duds.dat
- -DFLT_WORK_PATH does not exist - i.e. use exe directory
- minimum ras_timer setting of 5 minutes if doing RAS
dial, i.e. if you have a ras_entry or ras_number setting, otherwise there is no mimimum
setting.
- The ras dial up is considered to have succeeded if another program is controlling the dial
session - there is a pf_wait setting to set a 'try-again' time to counter the fact that the other
process might still be doing the dialup. This wait period is only used if POPFetch cannot reach
the servers when it wakes up.
- If a message fails to be delivered to multiple recipients then POPFetch will only send
one message to the pf_dflt_address, with a paragraph added to the top of the message specifying
which recipients did not receive the message.
POPFetch Settings
POPFetch reads DMail's configuration file, dmail.conf,
to find its settings. E.g. \winnt\system32\dmail.conf on Windows platforms and
/etc/dmail.conf on Unix based platforms.
On all platforms, no matter whether you want RAS dialup or not, POPFetch uses
the setting
ras_timer x to decide when it
should next check for new mail. So this is the first setting you should
set. Settings specifically for POPFetch all
begin 'pf_' in dmail.conf.
On windows NT it can also use the other DSMTP RAS Dial settings,
to do RAS Dialup before each check so that it can reach the
POP server from which it is to download mail.
The settings relevant to POPFetch are:
POPFetch will create a log file, popfetch.log, in the directory and at
the level set by the DMail settings, log_path and log_level. See
Other DMail Settings That POPFetch Uses below.
RAS Settings:
POPFetch specific settings:
Other DMail settings that POPFetch uses:
Details of POPFetch specific settings:
-
pf_user <username> <password> <pop_ip_address>
You can have multiple pf_user lines. Each line sets
an email POP account that POPFetch should check for
mail. As such the pf_user setting takes parameters of the
username, password and IP address for the POP server where the
mail account exists.
You MUST have at least one pf_user setting.
Example:
pf_user bob secret 1.2.3.4
-
pf_header
...
Example:
pf_header
-
pf_isinterval
...
Example:
pf_isinterval
-
pf_domain
...
Example:
pf_domain
-
pf_header
...
If the pf_header setting cannot be found in the message to be sent out,
POPFetch looks for the 'X-Rcpt-To: ' header, followed by the 'To: ' header,
then if even that header cannot be found it will send the message to the
default address, if that does not exist then the
message will be appended to the duds file, duds.dat
pf_header is not case sensitive
handles multiple addresses, over multiple lines in header lines
Example:
pf_header
-
pf_max_duds
...
The max_duds setting has a default of 10, and will not take settings
below 1.
Example:
pf_max_duds
-
pf_dflt_address
...
If a message fails to be delivered to multiple recipients then POPFetch will only send
one message to the pf_dflt_address, with a paragraph added to the top of the message specifying
which recipients did not receive the message.
Example:
pf_dflt_address
-
pf_retry_delay
...
Example:
pf_retry_delay
Example settings in dmail.conf might be:
pf_user fred passwd 1.2.3.4
pf_user fred2 passwd 4.3.2.1
pf_domain local.domain
pf_max_duds 15
pf_dflt_address fallback@local.domain
pf_retry_delay 60
ras_timer 5
ras_number 1,,12345678
ras_entry
ras_username our_account
ras_password account_password
ras_domain
ras_smtpip 1..2.3.4
ras_timeout 10
Files used by POPFetch
Note: POPFetch attempts to use the file paths as used by the rest of DMail.
If it cannot then POPfetch will simply work in the directory that the
executable is running from.
So most of the files below you will find in DMail's work path as set by the
work_path setting in
dmail.conf.
msg.dat - temporary storage of a message.
dmail.conf - where settings are stored (DMail's configuration file).
duds.dat - all messages that fail to be delivered anywhere are appended
to this file.
popfetch.log - the popfetch log file, found in the DMail
log_path directory.
Downloading POPFetch
Starting with the 2.8 versions of DMail, you will find popfetch included in the
DMail distribution set. So look in the temporary unpack directory, dmtemp.
NB: you do not need to use the 2.8 version of DMail, you can simply copy the popfetch executable
out of the unpack directory.
If you can not find it there, then please contact
DMail Support, as on some platforms
we do not yet build it by default (you should find it on Windows and Linux platforms).