[plug] Collecting mail from a remote server

Daniel Pittman daniel at rimspace.net
Thu Dec 17 09:44:53 WST 2009


Adam Davin <byteme-its at westnet.com.au> writes:
> On Thu, 17 Dec 2009 11:05:48 +1100
> Daniel Pittman <daniel at rimspace.net> wrote:
>> Adam Davin <byteme-its at westnet.com.au> writes:
>> 
>> > I have a couple of linux boxes I take care of that only operate onsite
>> > within the local lan. They have Exim as the local mail server which takes
>> > care of delivering all the local mail.
>> >
>> > Up until recently I have been logging in via ssh and manually
>> > checking the mail.
>> >
>> > I am looking to try to automate this process to allow me to bring
>> > the mail directly into my mail client.
>> 
>>     echo '&me at another.net' | ssh myuser at example.com 'cat > .forward'
>> 
>> Then, Exim should automatically forward your email to
>> 'me at another.net'; season to taste or read the manual for more details
>> on using .forward files.[1]
>> 
>> > At present I was considering using ssh with a key agent to log in
>> > and copy / move any mail in the maildir on the remote machine into
>> > a folder on my own client. This may not, however, be "The Best Way
>> > (tm)"
>> 
>> I can't imagine why you don't want to simply forward the email to your
>> preferred address using the regular, decades old facilities to do
>> this.
>
> Most likely cause of this is lack of knowledge of the "regular, decades old
> facilities to do this"... Any pointers to these wonderful facilities, even
> if just the man files to read would be appreciated..

(Sorry.  That was a bit more snarky than it should have been.)

http://www.exim.org/exim-html-4.40/doc/html/spec_22.html#SECT22.4

Actually, sections 22.5 and 22.6 are the parts you are most interested in,
since they document the basic handling of this in Exim.

Otherwise they syntax is more or less the same as the right-hand-side of an
expression in the /etc/aliases file.

> Exim is currently only set up to deliver local mail. I played around with
> the /etc/alias file and the /etc/email-addresses files for a while trying to
> get the mail to forward but Exim couldn't resolve the external addresses or
> something of that nature.

Ah.  That won't work then; the .forward files inject the email into the normal
outbound SMTP process.  (Though I would address the problem, myself, by fixing
outbound email delivery and all. :)

> I was not sure how difficult it was to reconfigure exim to pass on mail to
> an external SMTP and was more concerned that the external smtp, given the
> linux box has no "official" domain, might reject the mail.

Well, it obviously depends on the server receiving the email, but it probably
isn't too terrible.

        Daniel

-- 
✣ Daniel Pittman            ✉ daniel at rimspace.net            ☎ +61 401 155 707
               ♽ made with 100 percent post-consumer electrons



More information about the plug mailing list