Page 1 of 15

[plugin: Mail2List] Send mail to your list via email client

PostPosted: 11:24am, Wed 14 Feb, 2007
by SaWey
Hi,

I've made a plugin that allows you to send emails from your home computer to your phplist server.

The only thing you have to do is go to your phpbb site and process the newly arrived messages.


This is now B├Ęta, and it would be nice if some people could test it and give me feedback.

Just download the plugin, extract it in the plugins folder and change 2 things in the mailtolist/get_email.class.php:
->path to attachments dir
->URL to attachments dir
Then it has to work.

Please feel free to give all kinds of feedback.
SaWey


Download here


[EDIT:] the download contains a new version,
please check the latest posts on how to make the changes.


A wiki page is available at http://docs.phplist.com/MailToList

PostPosted: 7:26pm, Wed 14 Feb, 2007
by Hernol
I've made everything, but still no plugin...
Can you write some instructions of what it does and how to achieve that please ;)

PostPosted: 8:11pm, Wed 14 Feb, 2007
by SaWey
Do you have the default plugin enabled?
That's the one pointing to this one.

Try enabling that and see if it works.

PostPosted: 8:44pm, Mon 26 Feb, 2007
by SaWey
Again this plugin is updated,

we're almost getting to a final release.

To test this version, download is provided in the first post.


If you had the previous version installed, you will have to add some tables in phplist_popaccount:
Code: Select all
`queue` VARCHAR( 3 ) NOT NULL DEFAULT 'yes', `del_message` VARCHAR( 3 ) NOT NULL DEFAULT 'yes'


Here are the changes:

Priority high (really need to be fixed):
[fixed] -txt/php-attachments arent still recognized [/fixed]
[fixed]- all other attachments missing the filesize in the messageview [/fixed]
[fixed]- every message is categorized as multipart (text and html) even if it is only send as text or only as html [/fixed]
- mail with (not recognized) txt-attachment: html-messagetext isnt shown when editing message after queing (in Tinmce-Editor)


Priority middle (should be done):
- mail with zip-attachment: the texteditor (tinymce) shows the html-text. When send only with txt nothing is shown.
[fixed]- An option to delete settings rather than leaving the entries empty in the DB [/fixed]
[fixed=only one emailadress per list allowed]- when two lists have same mail-adress Handling now is: message is only send to the first list.[/fixed]
[fixed]-- Better: Either mail will be send to both lists or dont allow that two lists have same address.[/fixed]

Priority low (would be nice, but not necessary):
[fixed]- On clicking "Apply Settings" a message "settings have been saved" on the next screen.[/fixed]
[fixed]- A mail2list-settings-overview-page.[/fixed]
[fixed]- Status: "All 2 mails sent to listadress@mydomain.com
have been forwarded to <listname>." (So changing the text "phplist" to the corresponding listname)[/fixed]
[fixed]- better line breaks on "Mail to List Processing page" so that the different calls for each list are better separated. Perhaps a simple HR would do. [/fixed]
[NOT FIXABLE WITHOUT HARDCODING][* make images available inline (not linked to att dir)] [/NOT FIXABLE]
This can't be done because we can't write new headers for the email.
There has to be a lot of hardcoding in the main phplist code before this can be done.
I'll try to look at it when i have a lot of time.
[fixed][* ability to store messages without queuing them] [/fixed]
[in progress]- option for leaving messages on pop3. option for only fetch new mails. [/in progress]

PostPosted: 11:40pm, Wed 28 Feb, 2007
by SaWey
Another version has been released!!!

this time the sql-tables have changed, to be more independent of the phplist original tables.

If you had an old version installed, you will have to execute the following sql:


Code: Select all
-- -------------------------------------------
-- New SQL to input
-- Original config will be deleted!!!!!!
-- -------------------------------------------
ALTER TABLE `phplist_list` DROP `toemail` ,
DROP `template` ,
DROP `footer` ;
-- -------------------------------------------
-- -------------------------------------------
CREATE TABLE `phplist_mail2list_list` (`listid` INT( 10 ) NOT NULL PRIMARY KEY, `toemail` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL, `template` INT( 10 ) NOT NULL , `footer` TEXT NOT NULL) ENGINE = innodb;
-- -------------------------------------------
-- -------------------------------------------
CREATE TABLE `phplist_mail2list_allowsend` (`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,`email` VARCHAR( 255 ) NOT NULL ,`name` VARCHAR( 255 ) NOT NULL ,`sent` INT( 50 ) NOT NULL DEFAULT '0') ENGINE = innodb;
-- -------------------------------------------
-- -------------------------------------------
CREATE TABLE `phplist_mail2list_popaccounts` (`listid` INT( 10 ) NOT NULL PRIMARY KEY, `host` VARCHAR( 255 ) NOT NULL ,`port` VARCHAR( 255 ) NOT NULL ,`login` VARCHAR( 50 ) NOT NULL ,  `pass` VARCHAR( 50 ) NOT NULL, `mail_status` VARCHAR( 10 ) NOT NULL DEFAULT '0/0', `queue` VARCHAR( 3 ) NOT NULL DEFAULT 'yes', `del_message` VARCHAR( 3 ) NOT NULL DEFAULT 'yes' ) ENGINE = innodb;
-- -------------------------------------------
-- -------------------------------------------
DROP TABLE `phplist_allowsend`, `phplist_popaccounts`;
-- -------------------------------------------



When executed, all old configuration will be gone.

plugin

PostPosted: 9:26pm, Thu 01 Mar, 2007
by directfactory
hi

As i understand this plugin is in order to send mails to my lists directly from my outlook.

Question : will the attachment be like in regular mail or they have to download from the server?

i don't know how to install this plugin.. so far i have extracted in but i don't know what to do next..

Please advise

PostPosted: 2:06am, Fri 02 Mar, 2007
by SaWey
Hi,

You can look at the wiki page, i think that should explain everything.

You can find it here

If you can't figure it out, let me know.

PostPosted: 8:48pm, Tue 20 Mar, 2007
by flyinprogramer
Ok, i'd just like to say, amazing plugin. I've got it set up, and i can "send" a message, but it only sends the footer, nothing i type in ever gets sent, my template doesn't get sent, nothing... other than the footer. You'd think it'd be a tmp directory problem. but i've tried EVERY combination of calling the folder that's there, and nothing works. Are there any settings in the phplist config that would conflict with the way this is setup? And suggestions?

Oh yeah, and i don't have this problem with phplist, and i tried using the same and different tmp directories, nothing seems to be working...

help... please!

PostPosted: 10:19pm, Tue 20 Mar, 2007
by SaWey
Can you check your db and see if the mails are stored in there?

Are you sure you have configured everything right?

Grz

My Problem is solved!

PostPosted: 3:05am, Wed 21 Mar, 2007
by flyinprogramer
If you plan on using this plugin with Gmail, you're going to probably need to add this code to your get.email.class.php file in order to get it to work.

The Code:

#if plain text
if (strtoupper($p->subtype)=='PLAIN')1;
#if HTML
else if (strtoupper($p->subtype)=='HTML')1;
$this->partsarray[$i][text] = array('type'=>$p->subtype,'string'=>$part);

Where to add?

Right around line 270, after this:

if ($filename!='' ){

$this->partsarray[$i][attachment] = array('filename'=>$filename,'string'=>$part, 'encoding'=>$p->encoding,'part_no'=>$i,'type'=>$p->type,'subtype'=>$p->subtype);
}

(so find this ^, find the last } in this piece of code, press return, and then paste The Code)

That should fix her right up! Thanks again for all your help SaWay! By the way, SaWay coded this, not me, i'm just posting it to save him time. And since I did post it, technically i suppose this is an unofficial patch/work-around. So, no guarantees that it won't have any side affects (a.k.a. its possible this might break something, unlikely, but still possible).

gmail erases the content

PostPosted: 10:03pm, Mon 02 Apr, 2007
by mitchpc
gmail erases the content
I made sure that the added codse you mentioned above is in plugin. But, it still does the same. Just footer. I have chose very simple template just with [CONTENT]

Database Error

PostPosted: 7:23pm, Mon 30 Apr, 2007
by blair.sawler
Hi

I just installed Mail2List, am hoping to get it working. I get the following errors on the admin page when I go to configure it. Hope someone can help. Thanks!

Database error 1064 while doing query 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 'COLLATE latin1_swedish_ci NOT NULL, `template` INT( 10 ) NOT NU

Database error 1064 while doing query 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 'ENGINE = innodb' at line 1

Database error 1064 while doing query 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 'ENGINE = innodb' at line 1
Database had to be updated, please reload the page.

PostPosted: 10:20pm, Mon 30 Apr, 2007
by SaWey
Hey,

there's somethibg wrong with initiating the plugin.
I don't know what can cause this.

If you have access to phpMyAdmin or somthing like that, you can execute the following query to initialise the plugin:
(be sure to replace the 'phplist'-prefix of the tables if you use another prefix)
Code: Select all
-- Database: `phplist`
--

-- --------------------------------------------------------

--
-- Tabel structuur voor tabel `phplist_mail2list_allowsend`
--

CREATE TABLE `phplist_mail2list_allowsend` (
  `id` int(11) NOT NULL auto_increment,
  `email` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `sent` int(50) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;


--
-- Tabel structuur voor tabel `phplist_mail2list_list`
--

CREATE TABLE `phplist_mail2list_list` (
  `listid` int(10) NOT NULL,
  `toemail` varchar(255) NOT NULL,
  `template` int(10) NOT NULL,
  `footer` text NOT NULL,
  PRIMARY KEY  (`listid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


--
-- Tabel structuur voor tabel `phplist_mail2list_popaccounts`
--

CREATE TABLE `phplist_mail2list_popaccounts` (
  `listid` int(10) NOT NULL,
  `host` varchar(255) NOT NULL,
  `port` varchar(255) NOT NULL,
  `login` varchar(50) NOT NULL,
  `pass` varchar(50) NOT NULL,
  `mail_status` varchar(10) NOT NULL default '0/0',
  `queue` varchar(3) NOT NULL default 'yes',
  `del_message` varchar(3) NOT NULL default 'yes',
  PRIMARY KEY  (`listid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


If this works, try to add a user to the whitelist, if that doesn't work please post your errors here.

Grz
SaWey

PostPosted: 11:48pm, Mon 30 Apr, 2007
by blair.sawler
I wondered how the db was being updated! Thanks will give that a try and let you know.

PostPosted: 11:58pm, Mon 30 Apr, 2007
by blair.sawler
HI there. I got errors when importing tge script: :(

Running phpMyAdmin 2.7.0-pl2 and MySQL 4.0.16

Here is the result.


SQL query:

Code : -- Database: `phplist`
--
-- --------------------------------------------------------
--
-- Tabel structuur voor tabel `phplist_mail2list_allowsend`
--
CREATE TABLE `phplist_mail2list_allowsend` (

`id` int( 11 ) NOT NULL AUTO_INCREMENT ,
`email` varchar( 255 ) NOT NULL ,
`name` varchar( 255 ) NOT NULL ,
`sent` int( 50 ) NOT NULL default '0',
PRIMARY KEY ( `id` )
) ENGINE = InnoDB DEFAULT CHARSET = latin1 AUTO_INCREMENT =3;



MySQL said:

#1064 - 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 'Code:

CREATE TABLE `phplist_mail2list_allowsend` (