Synchronizing Remote Accounts for Backup and Reflector


Backup and Reflector customers should keep a list of valid email recipients updated with No-IP.com. This allows No-IP to refuse mail from invalid recipients at the SMTP level. This means less processing overhead for your mail server and No-IP’s, as well as less spam. And it is a good thing to do for the Internet community at large.

No-IP has a simple interface for synchronizing your valid recipients. Just post a comma separated list to the URL below.

URL: http://www.noip.com/members/mail/remoteaccts-rpc.php

Required variables:

  • Email: The email address you use to log into No-IP.com.
  • Password: The password you use to log into No-IP.com.
  • Domain: The domain that the list applies to.
  • Action: Can be REPLACEALL, APPEND, REMOVE.
  • Accounts: A comma separated list of accounts without the domain part.

Here is a simple example using the Unix/Linux Curl command:

#!/bin/sh

EMAIL=”user@no-ip.com”
PASSWORD=”ExamplePassword”
DOMAIN=”domain.com”

tr “\n” ‘,’ | xargs printf \
“email=${EMAIL}&password=${PASSWORD}&domain=${DOMAIN}&action=REPLACEALL&accounts=%s” \
| curl –data @- https://www.noip.com/members/mail/remoteaccts-rpc.php

Note: Arguments should really be run through a URI encoder.

Say you have your list of recipients in accounts.txt, one per line, whenever you want to synchronize your valid recipients just run:

./sync-accounts.sh < accounts.txt

There are a number of possible results:

  • 200 Update successful
  • 500 Authentication failed
  • 510 Unsupported Action
  • 520 Domain does not exist
  • 521 Invalid domain format
  • 530 Invalid accounts string
  • 590 Systems error. Try again later.

Here is a more complete perl example:

#!/usr/bin/perl -w

use LWP::UserAgent;
use strict;

my $myemail = ‘user@no-ip.com’;
my $mypass = ‘ExamplePassword’;
#my $url = ‘http://www.noip.com/members/mail/remoteaccts-rpc.php’;
my $url = ‘https://www.noip.com/members/mail/remoteaccts-rpc.php’;

die “Usage: $0 domain < accounts.txt” if @ARGV != 1;
my $domain = $ARGV[0];

sub urlencode {
my $s = shift;
$s =~ s/([^A-Za-z0-9\-_.!~*])/sprintf(“%%%02X”, ord($1))/seg;
return $s;
}

my @accounts = ;
chomp @accounts;
my $accounts_string = join ‘,’, @accounts;

my $ua = LWP::UserAgent->new;
my $req = HTTP::Request->new(POST => $url);
$req->content_type(‘application/x-www-form-urlencoded’);

$req->content(
sprintf(‘email=%s&password=%s&domain=%s&action=REPLACEALL&accounts=%s’,
urlencode($myemail),
urlencode($mypass),
urlencode($domain),
urlencode($accounts_string)
)
);

my $res = $ua->request($req);

if($res->is_success) { print $res->content; }
else { print $res->status_line, “\n”; }