DISQUS

Blade's blog: wp-mail.php

  • Gnam · 5 years ago
    I still get the "Ooops POP3: premature NOOP OK, NOT an RFC 1939 Compliant server" error when trying to post my email via the http://www.example.com/wordpress/wp-mail.php link...

    :(
  • chad · 5 years ago
    wow. i was trying to get the other hack for this running, but i wasnt getting it right.
    worked.

    one snag, i didnt have pear installed, and I am on a shared host, so I went to pear, and got pear.php and just dropped it in the wordpress directory.

    i was impressed how multiple images came out inline, sent using Mac OSX 10.3 Mail.

    The other snag, was that I might be sending from various emails (like from phone, etc), so at first my email got rejected. I had to setup the different users in WP. Can it be optional to set the account it is supposed to post under?

    And one more thing... I would like to use this for moblogging. Is it possible for thumbnails be created of the images, with a link to the original image (like this hack http://tellitinlove.com/archives/2004/05/31/wp_...)

    Keep up the great work!
  • chad · 5 years ago
    some more testing.
    my phone sends email with "< " and ">" around the email, so the sender is rejected.
    it looks like "<email>".

    also, although apple's mail sent the email fine with multiple inline images, when sending with mozilla mail, it inserts all the html into the blog. this should be removed?</email>
  • Dan · 5 years ago
    ]+)\2$/',$from,$matches))
    {
    $from = $matches[2];
    }

    which should solve your problem.
  • Dan · 5 years ago
    Dammit, it ate my code, try this:

    if (preg_match('/^[^
    ]+([< "])([^]+)\2$/',$from,$matches))
    {
    $from = $matches[2];
    }
    < />< />
  • Dan · 5 years ago
    And it did it again...I'll give john the update...
  • chad · 5 years ago
    dan, it ate my code too.
    i meant to write the less than and greater than sign... angle brackets. < and >
    < and >< />
  • Owen · 5 years ago
    Interesting implementation!

    A few caveats and suggestions: I agree that it would be very nice to allow some addresses that are not in the user database to post so that I could allow my phone to email the script. Thumbnails would be nice, too. You should mention that PEAR is required - it wasn't a problem, but added a step I wasn't expecting.

    It didn't seem to fix all of the linebreaks in my message. This is an issue with these mail-based posting scripts when used with the WP formatting functions.

    It would be very cool if you could use the name of the category rather than the number to choose a category in which to post.

    In all, it's a very effective method of getting files posted via email. Good job!
  • Michiel · 5 years ago
    Great hack!! Would it be possible to create a thumbnail from the picture so that the thumbnail is post to the blog and when you click on it the original picture will be shown in a pop-up? Again, a great hack!
  • eden · 5 years ago
    I´ve been trying to get this thing to work but I´m afraid I´m stuck at the "pear" stage.. where and how can I "get pear"? *confused*
  • JohnBlade · 5 years ago
    Eden,
    I have updated the wp-mail.zip to include PEAR.php. Try and re-download the zip file again and have a go!
  • Matt · 5 years ago
    I'm attempting to set up a cron for wp-mail.php but it doesn't appear I have 'GET' on my machine. I'm running Mac OS X. Might anyone have a suggestion for what I need to install to provide the 'GET' ability?

    TIA -

    Matt
  • Erich Kolb · 5 years ago
    This hack rocks!
  • Lane · 5 years ago
    If you use mod_rewrite, photo and file paths break. Looking at:

    //global $photosdir;
    $photosdir = 'wp-photos/';
    $filesdir = 'wp-filez/';

    Should I change this to be an absolute path?
  • Quotes · 8 months ago
    Thanks for the code, I appreciate it.
  • Matt · 5 years ago
    I don't seem to be able to automate the checking of wp-mail via the cron. When I use it with wget, i get the following:

    Server:/etc matt$ wget http://192.168.0.25/wordpress/wp-mail.php
    --13:15:03-- http://192.168.0.25/wordpress/wp-mail.php
    => `wp-mail.php'
    Connecting to 192.168.0.25:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: unspecified [text/html]
    wp-mail.php: Permission denied

    Cannot write to `wp-mail.php' (Permission denied).

    Any idea what I need to change to automate this process?

    Regards -

    Matt
  • Matt · 5 years ago
    One further note. I notice that now, for some reason, even when I visit the URL with a traditional browser, this enhanced wp-mail is no longer deleting the message from the POP account even though it shows it processing it (and it never ends up on the blog).
  • Matt · 5 years ago
    Actually, I've discovered that the posts are indeed occuring using your enhanced wp-mail.php but two issues:

    1) When using WGET from the command-line to call the page, the posts are grabbed but the mail is not deleted from the account. So the next time wp-mail is called, the same posts are added again.

    2) The time seems to be off by a few hours so the posts are added in the past.

    Any ideas?

    Regards -

    Matt
  • Lane · 5 years ago
    Matt, try creating a user with posting ability that has the email address that you are sending the posts to.
  • Matt · 5 years ago
    Have created both a user with the account sent from and a user for the account sent to. Item is posted, but not deleted from POP server. So it's reposted every time i check wp-mail. I wonder if my ISP's POP server is somehow not compliant?
  • Christine · 5 years ago
    This is a fabulous idea! If only I could get it to work. I get this error when I run the script in a browser window.
    ***************
    Database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE user_email='christine@colormepink.com'' at line 1]
    SELECT id FROM WHERE user_email='christine@colormepink.com'

    invalid sender: christine@colormepink.com
    ***************
    If someone could shed some light on what the heck I'm doing wrong I would be unendingly grateful. Thank you.
  • Jeff · 5 years ago
    Thank you so much, I've been looking for a script like this for a long time! It doesn't seem to work with photo attachments from my Nokia 3650, but there are blank anchor tags in the post HTML. ??

    Anyone know of a way to resize those images on the fly? I want them to fit in with the rest of the images on my site (350px wide)
  • Eric · 5 years ago
    This works beautifully!

    My phone attaches a long footer to the end of the pic-message. Gotta love Verizon. Is there a way to have wp-mail stop parsing the message when it hits an indicator within the message? That way I could include something like ### to the body of my message and it would not process the attached footer.
  • Scooterphish · 5 years ago
    Dude! Rock!
    I second the option to remove text footers from emails sent (a la T-mobile) or delete all text after (and including) a certain string value ("--" or "##" etc).
    I'd send you a paypal donation, dude. Seriously.
  • Jeff · 5 years ago
    Personally, I don't get any footers attached from T-Mobile. But I do have a problem with the MIME encoding on the Nokia 3650.
  • Nik · 5 years ago
    I get the same error as Christine. For the error, check http://niklas.saers.com/blog/john.html . Also, note a typo in your README-file, your file isn't called mailmimedecode.php but mimedecode.php. Small thingy. Anyways, it'd be good if you'd allow for multiple email accounts per user.
  • rust · 5 years ago
    For the time problem, I think I found the fixy. If you do the math, it seems "wp-mail.php" was subtracting the time difference twice. Change the line that says $post_date = date('Y-m-d H:i:s', time($ddate) + ($time_difference * 3600)); to say $post_date = gmdate('Y-m-d H:i:s', time($ddate) + ($time_difference * 3600)); and it should be fine. :)
  • Neil · 5 years ago
    For those of us who haven't mastered the intricacies of Regex's yet, can you tell me how to specify which categories the email posts to?
  • Tim · 5 years ago
    I love the hack, but I have run into two problems. First, the <!--more--> I use in the body of the email to mark where the post should be broken is being converted by the htmlentities function. Is there any way to avoid this?

    Second, I am getting a peculiar error with the categories. My email was processed, but when I went to the front page of my blog, I got the following error where the category should be:

    'Category:
    Warning: Invalid argument supplied for foreach() in /home/geodog/public_html/strangelove/
    wp-includes/template-functions-category.php on line 65'

    When I went to the editing page to correct it, I found the following error under the categories column:

    'Warning: in_array(): Wrong datatype for second argument in /home/geodog/public_html/strangelove/
    wp-admin/admin-functions.php on line 41'

    This is probably not a problem specific to your hack, as I am having it with the regular wp-mail.php as well, but I was hoping that you might be able to shed some light on it.

    As my contribution back, here is some code which should answer the request above about deleting footers:
    Insert this at the appropriate place:

    # variable for string after which we don't want file. Obviously
    # must be unique. I am using dashes as an example.

    $stop_here = "---------"

    # find it using strpos

    $pos = strpos($content, $stop_here);

    # subtract unwanted content
    $content = substr($content, 0, $pos);



    Thanks in advance for any help you can provide.
    Tim
  • Pam · 5 years ago
    Currently I'm getting the same error as #29 here.. however last week when testing, the wp-mail worked perfectly.. any ideas on the problem? I have n't changed anything, I was out of town is all.
  • mid0ri · 5 years ago
    I want to make wp-mail.php to work on Japanese e-mail. Would you mind showing me which part of the code I should put:
    $subject = eregi("(.*)=\?iso-2022-jp\?B\?([^\?]+)\?=(.*)",$subject,$regs);
    $subject = $regs[1].base64_decode($regs[2]).$regs[3];
    $subject = htmlspecialchars(mb_convert_encoding($subject, "EUC-JP", "auto"));

    and also

    $content = mb_convert_encoding($content, "EUC-JP", "auto");

    so that I can have e-mail in Japanese EUC_JP shown correctly?
  • Jeff · 5 years ago
    Well, I'm also getting the same problem as Tim and Pam... and it seems to be all of the sudden as well! Anyone else?
  • R@lf · 5 years ago
    I'm getting the same errors as Tim, Pam and Jeff. Never worked in this case. I keep getting a category error.. when I change it manually afterwards there is no problem.
  • Michael · 5 years ago
    To get categories from your subjects, write them like so.

    [category_id]Subject Test

    [2]Weirdos From Space


    If brave, try to achieve "[Travel]Visiting Canada" via the following.

    $sql = "
    SELECT *
    FROM $tablepost2cat
    WHERE post_id = $post_ID
    AND ( category_id = $post_category
    OR cat_name = '$post_category' )
    ";
    $exists = $wpdb->get_row($sql);


    Thanks for the efforts John,

    Michael
  • Michael · 5 years ago
    Opps, ignore the later sql part of my comment. That's way, way wrong. Sorry.
  • Michael · 5 years ago
    Now category by name and post_name for permalinks work. Two sections mainly edited.

    http://peimic.com/wp/wp-mail.php.txt

    Cheers,

    Michael
  • joe · 5 years ago
    I'm getting the same problem as Jeff and Tim and Pam--something with timezone? Maybe?

    Happens with the regular Wordpress wp-mail, too, and there's a bug report in --so maybe it will be fixed.
  • Andy · 5 years ago
    Thanks for this, it works like a charm. I really use this so i can send emails from my phone to my blog. I am using this to send message from an o2 UK mobile phone. All that i needed to change was adding a str_replace line to remove the advert at the top of the message. Thanks once again.
  • Joseph Boykin · 5 years ago
    I like Michael's changes to the script, however, I believe I found a bug where, if an unknown text category was specified, we try to use that category as opposed to, say, using the default category.

    I believe the code:
    $post_category = ( !is_null($id) ) ? $id : $post_categories[0];
    should be:
    $post_category = ( !is_null($id) ) ? $id : get_settings('default_category');
  • Dan · 5 years ago
    I've installed your hack today. It's able to get the subject line of the email (for the post title); however, it doesn't get the body of the email (the content) and the attachments. Any ideas why this would be so? Thanks.
  • Robert · 5 years ago
    When I post from Outlook the body of the mail is displayed, but when I send e-mail from my mobile phone there is only the header showing... and the attached picture is ignored in both case.
    Maybe I am missing something?
  • jebba · 5 years ago
    Hey, I got it installed. As someone above pointed out, in the README you reference an incorrect filename (mailmime instead if mime) and you should probably mention dropping in PEAR.php in the top dir.

    I've been able to post, but the images aren't showing up. I created the wp-photos and wp-filez dirs and chmod 777 them, but nothing appears in them. I get the "Mission complete, message 1 deleted" and see that the image is in the wp-mail.php page. At the bottom the "Posted content:" is blank. Ideas?
  • jebba · 5 years ago
    FWIW, I got it going with my phone (nokia 6820), but not with kmail. You'd think it'd be the other way around. Anyway, I only care about it working with the fone.... I'd be happy to test any other code you crank out. Thanks 10kx. http://jebba.blagblagblag.org FWIW
  • Greg · 5 years ago
    Solved my little T-Mobile footer problem. Sending via and not an MMS works wonders. Sheesh.
    This script mod rocks.
  • DJ · 5 years ago
    Great work on this, it's really useful.

    I have found a bug however. My mobile uses a from address of "<mobile>" which your script can't successfully extract and so does a lookup in the DB for the address including the </mobile><mobile> which obviously doesn't work.

    I fixed it by adding the following line at line 72:

    $from = ereg_replace("((\< )|(\>))", "", $from);

    There may be a better way of doing it, but this works. I haven't done extensive testing but it doesn't seem to break anything.

    Cheers again for the good work!</mobile>
  • DJ · 5 years ago
    Dammit. The important parts of my last post were stripped :-(

    I'll e-mail it to you :-)
  • Tony Crockford · 5 years ago
    I was getting a locked inbox whenever no mail was found (e.g everytime the cron triggered wp-mail.php) I think it was because the POP3 server didn't like the script just closing.

    I amended thus:


    $count = $pop3->login(get_settings('mailserver_login'), get_settings('mailserver_pass'));
    if (0 == $count) {
    $pop3->quit();
    die(__('There does not seem to be any new mail.'));
    }


    which seemed to fix it.

    might help someone, wondering why it works once and once only.

    ;)
  • Hans-Göran Puke · 5 years ago
    This is a great hack! Just what I was looking for.
    Just one small problem to report: When posting something with Swedish characters (or any other non-US characters I suppost) in the SUBJECT, they don't get translated correctly. MIME converts these to Quoted-Printable, but wp-email.php does not seem to convert them back.
    Maybe someone can fix this easily (my blog is in Swedish)?
  • Hans-Göran Puke · 5 years ago
    Actually, I have discovered one more problem: When sending an e-mail fron my Sony-Ericsson T630 phone and attaching a photo, only the text part makes it to the blog. Mailing to my office e-mail account, I get both the text and photo, so something seems to be wrong here. How can I help you to debug this?
  • Caj · 5 years ago
    I have the same problem as Hans-Göran, but with danish characters. My solution is perhaps not the best, but it works for me:
    In wp-mail.php after the line:
    "$subject = trim($structure->headers['subject']);"
    place this line:
    $subject = htmlentities($subject);
  • Martijn Hulst · 5 years ago
    Well, it works great on my (test)-site, but I wonder, can I choose code to make text 'bold', 'italic'. The standard doesn't work, so is there something else to make this...?
  • Micke · 5 years ago
    What about this PEAR-file: How do I use it?
    And does it work with "non-US characters" ?

    Great hack.
  • Greg · 5 years ago
    Micke, RE: the PEAR.php file - just put it in the same directory as the wp-mail.php file.
  • Steve Lapointe · 5 years ago
    Has anyone thought of modifying this to work with a .qmail file instead of using cron? I know that on my host, I can set up a ".qmail-example" file, which could redirect any mail for example@myhost.com to a script. Unfortunately, I'm not sure exactly what would be needed to make this work... My php skills are sorely lacking.
  • AIMJournals · 5 years ago
    This was posted a while back (Comment number 18) but no one ever gave a good answer...

    Posts are not getting deleted by this script! Is there something I need to change somewhere? Please help! It's really annoying!
  • Lars · 5 years ago
    Has anybody figured out how to post photos by using a cell phone? I have the same problem as Hans-Göran Puke. When I send an email with an attached photo from my SE T610 only the text part shows up in the blog. There seems to be a problem with mimedecode.
  • Scooterphish · 5 years ago
    Well, Lars, I don't think it's a problem with mimedecode, because I'm using the script to send pictures from my cell phone. Gotta be something a) with the way the phone sends messages or b) your provider c) unknown factor ?
  • Lars · 5 years ago
    @Scooterphish

    Maybe I wasn´t precise enough. I don´t think that there is something wrong with mimedecode. Apparently it works for many people. But definitely there is a problem with the interaction of the WP-Mail-Hack and i.e. the SE T610 cell phone.
    I cannot change the way my cell phone is sending emails but there could be a chance to get it working by modifying the WP-Hack. That is why I was thinking about mimedecode.
  • alan · 5 years ago
    I was having the same problem.

    I changed: fwrite($fp, $part->body);
    to: fwrite($fp, base64_decode($part->body));

    and it works for me now.

    (Using a Treo 600, btw.)
  • Lars · 5 years ago
    Thanks Alan, I tried your change to wp-mail.php but this doesn´t work for me. I think my problem is connected to the multipart handling.
  • cail · 5 years ago
    Hi John, how could I make your wp-mail.php support email coding in UTF-8?
    I found it support the title, not the content of the UTF-8 coded email. Could you give me some suggestion?
  • dr Dave · 5 years ago
    Hi John,
    This is a great plugin, but looking at the code, I must warn you there's is a huge security issue with it.
    You should not be letting people upload random type of files. And you should definitely not let people upload, for example, PHP files within the web root.
    Imagine the potentially devastating consequences if somebody get ahold of whatever mail address a blog author uses: he can easily send an email forging the From address and upload a malignant php file that could wreak all sorts of havoc on the server.

    At the very least, it should limit uploadable files to zip, gz and other compressed formats and maybe accept other formats after compressing them automatically. That way there won't be any easy way to run executables on the server (it would still be a good idea to impose a strict control on what can be uploaded and how big it can be, imho).

    I hope this will be of some help to you and do not hesitate to email me if you want to discuss this. Do not hesitate to hide this comment if you feel you'd rather not have it shown to visitors.

    cheers,
  • Gaston · 5 years ago
    I am having the sam error that a lot of people have / had with foreach() and Filed under:
    Warning: Invalid argument supplied for foreach() in C:\Domains\gastonl.com\wwwroot\moblog\wp-includes\template-functions-category.php on line 65
    Have someone solved this?
    I saw at least 4 posts about this, but with no fix.
    Any help?
  • Cash Keith · 5 years ago
    This hack is awesome. I just reloaded with word press from b2 and am loving what I have seen so far. Thanks again for all your work.
  • JohnBlade · 5 years ago
    Thanks for all your support guys - I have updated my wp-mail mod and have made a new post.
    http://blade.lansmash.com/index.php?p=93

    Would love to hear what other people think of my updated mod!
  • Party Poker · 5 years ago
  • Background Check · 5 years ago
  • Payday Loans · 5 years ago
  • Levitra · 5 years ago
  • Satellite TV Dish Network · 5 years ago
  • Penis Enlargement Pills · 5 years ago
    penis enlargement pills penis enlargement pills and penis enlargement products will help raise your confidence. Just like they helped to raise mine!
  • Adam Fields · 5 years ago
    Great hack!

    I had the problem where the email was getting posted, but not deleted from the server. I traced it to the pop3 quit command not getting properly processed.

    I added this to replace the pop3->quit();


    ----------------------------------
    $status = $pop3->quit();

    print 'Quit status = ' . $status . "
    ";

    if ( $status ) {
    print "Quitting...

    ";
    } else {
    print '

    Oops '.$pop3->ERROR.'

    ';
    }

    print "Done.

    ";
    -------------------------------------

    Sometimes, it didn't print anything, so I lowered the timeout value in wp-includes/class-pop3.php from 60 seconds to 10. It seems to work reliably now.
  • Cory · 5 years ago
    I'd like to say this mod rocks! Just one question, anyone know how to modify the script so I can use the mail filter option rather than using cron jobs?
  • Video Poker · 5 years ago
  • Video Poker · 5 years ago
  • Brian · 5 years ago
    Hey - I'm a big dumb animal, could someone explain to me...like I'm a 3 year old...how to go in and add a "safe list" of email address that I can email the blog page from? I wanted to test emailing pictures to myself and I get rejection on the wp-mail page saying the sender is not authorized. Ugh....I'm a NOOOOB!
  • SEO Expert · 5 years ago
    Great Post.
  • ASP.NET Web Hosting · 4 years ago
    What other problems do you have besides being unemployed, a moron and a dork?
    --------------------------------------------------


    Website Hosting Packages - Windows 2003 Server
    Web design hosting site
    http://www.efextra.net
    </hr
    >
  • texas holdem · 4 years ago
    I think there is nothing to be commnented
    texas holdem
    here :) right free 
    online texas holdem
    here. But right away here
    http://www.texas-holdem-p.com you can find the right info for play texas holdem
    now.
  • online poker · 4 years ago
    I think there is nothing to be commnented
    online poker
    here :) right free 
    online poker
    here. But right away here
    http://www.online-poker-888.us you can find the right info for play online poker
    now.
  • online poker · 4 years ago
    Here are many reasons I post here , thanks for posts before but I really
    recommen this website online poker . Please refer to our
    friends and play online poker also free
    online poker
    http://www.online-poker-888.us to our best greetings.
  • online poker · 4 years ago
  • Matt Fletcher · 4 years ago
    Small bugs in lines 202 and 212, the paths given are relative, and so stop working when looking at the entry's own page or archive pages (rather than the homepage). I think this might have something to do with rewrite rules, but I am a newbie to Wordpress so I may be wrong. Also, to be really picky, an extra space before the closing slash of the img tag on line 202 would make the pictures accessible to more browsers.

    But other than that, ace!
  • &#97;&#117;t&#111; &#105;ns&#1 · 4 years ago
    It's a great website of yours. I surfed by and found it very informative. Bookmarked and check you back in a while
  • bradley · 4 years ago
    I have everything setup, but it never seems to disconnect from the pop server. It does not delete the message from the server either, I’ve search the net and everyone seems to be having this problem, but there have not been any resolutions posted.
  • mike · 4 years ago
    can this hack be used with pictorialis [ http://mindfulmusings.net/bb/ ] ???
  • &#111;nl&#105;n&#101; p&#111;k · 4 years ago
    This is a great page. And the contents are really that worth reading. I will add this to my own library
  • texas holdem · 4 years ago
  • texas hold em · 4 years ago
    http://www.texas-hold-em-a.com texas hold em online poker texas hold em
  • texas holdem · 4 years ago
  • ph&#101;nt&#101;rm&#105;n&#101 · 4 years ago
    Super Informationen verpackt in einem tollen Design.
  • Lutz Linke · 4 years ago
    Suggestion: the POP3 delete should be placed _after_ the "Invalid sender" check! So invalid sender's postings stay in the mailbox but might be allowed by the admin (by adding a user account or by adding the post's content manually).
  • BigRed · 4 years ago
    I'm still off by one hour now. I've changed the code for gmdate. But now i need to suptract one hour. I sent the email at 12 pm. But it shows 1pm instead, so its ahead by one hour. How do i subtract the one hour.
  • Templates · 4 years ago
  • Templates · 4 years ago
  • Templates · 4 years ago
  • Templates · 4 years ago
  • Templates · 4 years ago
  • cr&#101;d&#105;t c&#97;rds · 4 years ago
    You may find it interesting to visit the sites dedicated to debt consolidation
    ...
  • &#105;ns&#117;r&#97;nc&#101; q · 4 years ago
    You may find it interesting to check some relevant pages dedicated to insurance quotes
    ...
  • &#105;ns&#117;r&#97;nc&#101; q · 4 years ago
    You may find it interesting to check some relevant pages dedicated to insurance quotes
    ...
  • online · 4 years ago
    nice site!
  • free blackjack · 4 years ago
    Nice site. Congratulations for Webmaster. Good luck with your site guys! I enjoyed the visit good stuff
  • ws&#111;p · 4 years ago
    Please visit some helpful info about wsop
    ...
  • football betting · 4 years ago
    i really like your work it's beautiful. I wish you the best of luck in your career
  • poker · 4 years ago
    it's great,interesting.thanks for the tip. EXCELLENT
  • play poker · 4 years ago
    I really like your sit. Just was told about it a couple of days ago. Thank You!
  • Propecia · 4 years ago
  • Celebrex · 4 years ago
  • Zyban · 4 years ago
  • Zyban · 4 years ago
  • Brian · 4 years ago
    Some pathless cave-in had obliterated all trace of the underground passage, while the rain had washed so much earth back into the excavation that I could not tell how deeply I had dug that msn ,” Gardiner said of his exercise...
  • Brian · 4 years ago
    Some pathless cave-in had obliterated all trace of the underground passage, while the rain had washed so much earth back into the excavation that I could not tell how deeply I had dug that msn ,” Gardiner said of his exercise...
  • john wayne books · 15 hours ago
    I posted your article to my myspace profile.

    respect
    Milli
    ______________________________________________
  • limo hire birmingham · 14 hours ago
    i would love to read more from you on this

    regards
    Hestin
    ______________________________________________