+
+function mail_new_incoming_notify($user) {
+
+ $profile = $user->getProfile();
+ $name = $profile->getBestName();
+
+ $headers['From'] = $user->incomingemail;
+ $headers['To'] = $name . ' <' . $user->email . '>';
+ $headers['Subject'] = sprintf(_('New email address for posting to %s'),
+ common_config('site', 'name'));
+
+ $body = sprintf(_("You have a new posting address on %1\$s.\n\n".
+ "Send email to %2\$s to post new messages.\n\n".
+ "More email instructions at %3\$s.\n\n".
+ "Faithfully yours,\n%4\$s"),
+ common_config('site', 'name'),
+ $user->incomingemail,
+ common_local_url('doc', array('title' => 'email')),
+ common_config('site', 'name'));
+
+ mail_send($user->email, $headers, $body);
+}
+
+function mail_new_incoming_address() {
+ $prefix = common_good_rand(8);
+ $suffix = mail_domain();
+ return $prefix . '@' . $suffix;
+}