Re: importing mail into sendmail mailbox via pop3 from account on remote server



On 11/15/07 13:23, todd wrote:
Although I'm familiar enough with putzing around a Linux box, and I have SSH to my box, I have not used fetchmail, mutt, pine, or any other command line tool that might facilitate migrating the contents of a POP3 account straight into the sendmail, and my host hasn't installed anything either.

Ok...

I know it is oxymoronic, but does sendmail have this capability? I trolled some groups, Googled the topic, and skimmed the manual, but no luck. Anyone written a Python, PHP or Perl script that can do this? I trolled for that too and couldn't find anything.

No, Sendmail does not have this capability. Sendmail is an SMTP server (amongst other types of email servers) for sending and receiving emails. Sendmail its self does not go out and fetch emails off another server.

Theoretically I supppose it would look like:

[user@account /]$ programtofetchpop3mail pop3=mail.someotherhost.com user=oldmailbox pass=1234 box=/var/spool/mail/newmailbox cache=/var/spool/mail/newmailbox.cache

or

[user@account /]$ programtofetchpop3mail.py/php/pl pop3=mail.someotherhost.com user=oldmailbox pass=1234 box=/var/spool/mail/newmailbox cache=/var/spool/mail/newmailbox.cache

You really have answered your own question with out realizing it. You want to use something like fetchmail. Fetchmail is intended to go and fetch email off of other servers and do something useful with it.

As far as appending the new emails directly in to the mail spool, you don't really need to do that. You would have fetchmail go and fetch the messages and then re-inject them in to the SMTP interface of Sendmail which will then deliver them locally just like it would do for any other message.

I'd write my own script, but I'm not familiar enough with sendmail files to not botch the job.

You can re-invent the wheel that has been re-invented many many times over if you want to. However from what you've asked for I see no reason to do so unless you really just want to. Use the tried and (proven) true tools that already exist to solve the very problem that you are asking to solve.

If anyone could help, please email directly at todd_drain@xxxxxxxxxx I'll see the answer faster there. Thanks in advance. I'll make the response into a static page on one of my domains for people to troll for in the future... can't be the only one whose had a hard time importing remote pop3 accounts into sendmail via pop instead of having physical files.

Read up on fetchmail and try it. I think you will find that it will do exactly what you are wanting to do.



Grant. . . .

P.S. I'm sending this reply back to the news group for archival reasons and CCing you as you requested.

.



Relevant Pages

  • Re: [SLE] Fetchmail problems (was mms is not a registered protocol)
    ... >> Else, somebody patches fetchmail. ... The emails that were being ... from SuSE 8.2 to 9.1, that till I saw your message and ... I mean, I did not downgrade, but upgrade - and then noticed the problem. ...
    (SuSE)
  • [SLE] fetchmai-spamassassin imap to mozilla mailer, Where are my mails
    ... Fetchmail fetches emails from emailserv to mysuse:/var/spool/mail/ghsong. ... Now, right after upgrading to SuSE-9.0, I realized that local-user ... fetchmail command in the above method does not work any more. ...
    (SuSE)
  • Fetchmail - setup question
    ... have set fetchmail up in an hourly cron job. ... fetchmail sends an email to my internal user each time it is run. ... it is doing) and not sending the emails. ...
    (comp.os.linux.networking)
  • Re: Fetchmail - setup question
    ... > have set fetchmail up in an hourly cron job. ... fetchmail sends an email to my internal user each time it is run. ... > it is doing) and not sending the emails. ...
    (comp.os.linux.networking)
  • Fetchmail - setup question
    ... have set fetchmail up in an hourly cron job. ... fetchmail sends an email to my internal user each time it is run. ... it is doing) and not sending the emails. ...
    (comp.os.linux.setup)