• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 420
  • Last Modified:

fetchmail from remote host to remote host

I'd like to use fetchmail to fetch email from a remote smtp server and deliver to another remote smtp server using each servers IP address while DNS change is in progress between both (hence both mailboxes receive email depending on the end-users DNS server).
0
mtasking
Asked:
mtasking
  • 3
  • 3
  • 2
  • +1
1 Solution
 
AdamsConsultingCommented:
I've done many e-mail server moves like you are doing, and a problem with what you propose is that fetchmail uses individual IMAP/POP access, so you would need all of your user's usernames and passwords.

Instead, I would recommend the following:

1. Lower the Time To Live (TTL) settings on your DNS A records to 5 minutes
2. Setup and test the new-email server
3. Schedule some downtime
4. Change the IP address that your mail exchanger's DNS A record resolves to
5. Wait five minutes and hut down the SMTP service on the old e-mail server
6. Start copying over all e-mail using server to server copy from the old server to the new one
0
 
dkikalisCommented:
Fetchmail goes from POP to local email host.  This is okay if the local email server is Linux or you has a windows version of it.   I have used Mercury32 from here http://www.pmail.com/m32_461.htm.  This tool is a mail system in it's own right however it's very light and easy to install ect.  It has a fetchmail type facility but can also send mail smtp.

Coping email over is only an otpion if you are going from two linix machines (assuming the userID's are teh same)
0
 
Maciej SsysadminCommented:
You can't to it directly in fetchmail.
As others wrote - fetchmail fetches emails from remote host to your local box. If you want to have them on other remote host you have to options:
1. launch fetchmail on that remote host directly
2. forward fetched emails from your local host to remote one (with ~/.forward or with ~/.procmailrc).
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
mtaskingAuthor Commented:
Thank you for your help and input. The closest answer so far is the suggestion to launch fetchmail on the remote host, however, it's a windows box.
A while back I had fetchmail to pull from a remote host and relay to a remote host but I lost the script. I do remember that I tested on the command line first and then added all users to a .fetchmailrc config file.
See example "Set up Fetchmail" here: http://www.scalix.com/wiki/index.php?title=HowTos/Fetchmail
Example is just not working for me.
0
 
Maciej SsysadminCommented:
-S option means - send received emails through provided smtp host. This can be achieved with procmail (with formail to change your from name to something appropriated) also.
To use -S option, you need to provide smtp server which will accept emails from you (from address provided in --smtpname option).

Please post some detailed informations on what is not working for you. Some error messages can be helpful (they can be available on your terminal, ir you are running fetchmail from commandline, or maybe in /var/log/maillog or /var/log/messages or something like that).

You may want to run fetchmail on your windows box with cygwin - didn't try this, but it may work. Or, maybe just find some windows application which fetches emails :)
0
 
mtaskingAuthor Commented:
If I use this:

fetchmail -v -p pop3 -S x.x.x.x --smtpname johndoe@domain.com -u johndoe@domain.com y.y.y.y

After giving the correct password I see in the verbose output that email is correctly being fetched from y.y.y.y - but instead of delivery to x.x.x.x my local smtp server queues the message locally. My maillog shows this too - local delivery instead of remote forwarding. It may not help that the user actually exists on this local machine, however I'd like to force delivery to x.x.x.x. I changed the transport mechanism in postix to smtp[x.x.x.x] for this user which causes the message to be blocked due to non-local delivery on the remote server.
0
 
AdamsConsultingCommented:
That fetchmail command is delivering messages to the same server that it's pulling them from. Try this:

fetchmail -v -p pop3 -S x.x.x.x --smtpname johndoe@[z.z.z.z] -u johndoe@domain.com y.y.y.y

Where you replace z.z.z.z with the IP address of the destination SMTP server.
0
 
AdamsConsultingCommented:
Note that the square brackets in my example are required, and not meant to show an optional parameter.
0
 
mtaskingAuthor Commented:
That's it, thank you.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now