Useful command for mailhandler default commands
The "commands" referred to below get put into the Admin->mailhandler->list->Default commands field. A sample of commands that can be used to post incoming emails to a forum would be (including the square brackets):
type: forum
taxonomy: [My Forum]
promote: 0
status: 1
Where [My Forum] is the "term" in the "forums" vocabulary that was automatically created when a forum named "My Forum" was created (see Admin->Categories).
These can be put either on the configuration page for the mailbox, if you want them to be defaults, or at the beginning of the email:
pass: password
(If you required one on the configuration page.)
type: blog
(or story, or page. use type=comment to force a comment. can be used with nid= command)
taxonomy: [cat1,cat2]
(or whatever your categories are. The square brackets are needed.]
promote: 1
(0 if you don't want it promoted)
status: 1
(0 if you don't want it published)
comment: 2
(0 if no comments, 1 if read-only comments)
Also, in the headers of the email, if you put
In-Reply-To: nid=5
then the email becomes the new version of node 5. I'm told that there's a way to take it down to the level of comments, presumably by using In-Reply-To and the comment id#, but I haven't checked that.
format: #
This is set the format for your submission to be the input format # for you site.

format:
Use the
format: n
command to specify the Input Type used for the post and n is the filter number
To find the filter number, go to Administer, Input Formats ( http://www.example.com/admin/filters )
The Configure link for each filter will have the filter number. If you have a default configuration, the filter numbers are likely to be
Filtered HTML 1
PHP Code 2
Full HTML 3
I have found that I often have to add
format: 3
to my commands to get incoming HTML emails to look good.
Mailhandler + Technorati?
Is there a way to add tags to a mailhandler post?
SheLovesTech.com
Learning Something New Everyday
Adding tags to Mailhandler posts
Yes.
Try adding this to the commands:
taxonomy: [cats]
That will tag everything that comes in as "cats". I'm thinking about using this with a mailing list...so for example, email coming in from the Digital Divide Network mailing list could be tagged "Digital Divide Network" or something along those lines, and then I could create a navigation link to the taxonomy term (with the link labelled something like "DDN Archives". You could also use tagging to add regular content tags to incoming nodes, and have them integrated with regular nodes in different content areas.
Hope this helps.
Dave.
Ha-I finally found out..(How to create edit/ nodes and comments)
Hi,
I finally found out how to create and edit nodes and comments. Here is how
To create new node
1. In the 'To' field of the mail
2. In the subject of the mail mention the title of the node getting created
3. Write mail handler commands in the first few lines of the body
4. In the body of the mail write the text of the node
For example if you write in the subject 'test' and in the body of the mail write,
type: page
This is a test node
This will create a node of type page with title 'test' and Body/Text as 'This is a test node'
Note: type: command is required if you have not put it in the default command in the configuration. More over, if type: command is present in the default command in the configuration that takes precedenceTo edit node
1. In the 'To' field of the mail
2. In the subject of the mail mention the modified title of the node
3. Write mail handler commands in the first few lines of the body
4. In the body of the mail write the text of the node
For example if you write in the subject 'test - changed' and in the body of the mail write,
nid: 10
type: page
This is a test node which is changed
This will modify the node whose node id is 10 and is of type page with title 'test - changed' and Body/Text as 'This is a test node which is changed'
Note: nid: command is required to identify the node which is getting editedTo add a comment to the node
1. In the 'To' field of the mail
2. In the subject of the mail mention the title of the comment
3. Write mail handler commands in the first few lines of the body
4. In the body of the mail write the comment
For example if you write in the subject 'test comment' and in the body of the mail write,
nid: 10
type: comment
This is a test comment for the test node
This will add a comment to the node whose node id is 10 with title 'test comment' and comment text as 'This is a test comment for the test node'
Note: nid: command is required to identify the node for which the comment is getting added. type: command signifies that a comment is getting addedTo edit a comment to the node
1. In the 'To' field of the mail
2. In the subject of the mail mention the modified title of the comment
3. Write mail handler commands in the first few lines of the body
4. In the body of the mail write the comment
For example if you write in the subject 'test comment - changed' and in the body of the mail write,
nid: 10
cid: 5
type: comment
This is a test comment for the test node (This is changed)
This will edit the comment whose id is 5 that is attached to the node whose node id is 10 with comment title 'test comment - changed' and comment text as 'This is a test comment for the test node (This is changed)'
Note: nid: command is required to identify the node for which the comment is getting added. type: command signifies that a comment is getting added. cid: command signifies the comment id that is getting modifiedPhoo.... It took me some time to figure out. BTW... I have still not figured out how to reply to a comment!!! Any body who has experimented on this, please reply
Note: default commands (in your mailbox configuration) if any are also taken into account while the mails are processed. If you leave them empty, make sure you add those commands in the first few lines of the mail. More over the commands you specify in the first line gets appended to the default commands. Hence if the default command says type:page and in your mail you say type:story, a page is created and not story!forum?
Has anyone figured out how to post to a forum? How did you figure out all of the options? Is there a file or something? Thanks for posting that!
Posting to a Forum
Yup, use the following below in your default commands or in in the first few lines of the e-mail you want to use to generate your content.
type: forum
taxonomy: [insert name of your forum topic]
You can also use the following below to do any specific actions you wish to do.
publish: 1
promote: 1
format: 3
comment: 2
Now, I haven't been able to figure out all the options. I've tried to look for thorough documentation on these options but I haven't found "jack".
And I'm still trying to figure out how to reply to a comment.
Replying to a comment
To reply to a comment
You'll need the following
nid: 29
pid: 9
type: comment
nid is the node id (found in the node table)
pid is the parent comment id that you'd like to reply to (found in the comment table).
password
In case you are wondering, just like me:
"password" is the user's Drupal password, and not some password configured in the Mailhandler admin interface.
managing users - anonymous vs authenticated vs daemons
It seems that incoming posts are identified as being owned by the user whose email submitted it. This is all totally clever and intuative, but stumped me for a while when trying to test.
To post to your own site - as you - your email address must be the one registered at the site.
If your site is blocked to anonymous submissions, incoming emails from not-your-email get retrieved ... but go nowhere. An error appears in the watchdog saying something like -
" Mailhandler: The e-mail address 'myemail@gmail.com' may not create mail items."
or (under Organic Groups)
" Mailhandler: Your submission is invalid: title: You must join a group before posting on this web site. "
I didn't have bounce messages on.
I tried making a dummy semi-authenticated account called 'mailer' that was allowed to post, and setting
user: mailerin the default commands. Didn't seem to help. ... nor
name: mailerLooking at the code I see that mailhandler_authenticate() just doesn't let this happen. :(
I was about to hack into it to allow $node->name be set ... when I realized what a hole that would be. I'm wanting to set it in the admin (safe) zone, but it gets read from the admin+submitted commands. Meaning it would be pretty easy to spoof. :(
I'm still working on this problem. In the meantime I just added my test-submit account as a user. Maybe I'll have to forward-bounce it or something.
I had to then ensure this user was in the right role to create content etc. Pretty straightforward.
.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/