email_in.pl - The Bugzilla Inbound Email Interface
./email_in.pl [-vvv] < email.txt Reads an email on STDIN (the standard input). Options: --verbose (-v) - Make the script print more to STDERR. Specify multiple times to print even more.
This script processes inbound email and creates a bug, or appends data to an existing bug.
The script expects to read an email with the following format:
From: [email protected] Subject: Bug Summary @product ProductName @component ComponentName @version 1.0 This is a bug description. It will be entered into the bug exactly as written here. It can be multiple paragraphs. -- This is a signature line, and will be removed automatically, It will not be included in the bug description.
For the list of valid field names for the
@ fields, including a list of which ones are required, see "create" in Bugzilla::WebService::Bug. (Note, however, that you cannot specify
@description as a field-- you just add a comment by adding text after the
The values for the fields can be split across multiple lines, but note that a newline will be parsed as a single space, for the value. So, for example:
@summary This is a very long description
Will be parsed as "This is a very long description".
If you specify
@summary, it will override the summary you specify in the Subject header.
[email protected] (the value of the
From header) must be a valid Bugzilla account.
Note that signatures must start with '-- ', the standard signature border.
Bugzilla determines what bug you want to modify in one of two ways:
@id 123456in the first lines of the email.
If you do both,
@id takes precedence.
You send your email in the same format as for creating a bug, except that you only specify the fields you want to change. If the very first non-blank line of the email doesn't begin with
@, then it will be assumed that you are only adding a comment to the bug.
Note that when updating a bug, the
Subject header is ignored, except for getting the bug ID. If you want to change the bug's summary, you have to specify
@summary as one of the fields to change.
Please remember not to include any extra text in your emails, as that text will also be added as a comment. This includes any text that your email client automatically quoted and included, if this is a reply to another email.
To add CCs, you can specify them in a comma-separated list in
To remove CCs, specify them as a comma-separated list in
If your request cannot be completed for any reason, Bugzilla will send an email back to you. If your request succeeds, Bugzilla will not send you anything.
If any part of your request fails, all of it will fail. No partial changes will happen.
The script does not do any validation that the user is who they say they are. That is, it accepts any 'From' address, as long as it's a valid Bugzilla account. So make sure that your MTA validates that the message is actually coming from who it says it's coming from, and only allow access to the inbound email system from people you trust.
The email interface only accepts emails that are correctly formatted per RFC2822. If you send it an incorrectly formatted message, it may behave in an unpredictable fashion.
You cannot send an HTML mail along with attachments. If you do, Bugzilla will reject your email, saying that it doesn't contain any text. This is a bug in Email::MIME::Attachment::Stripper that we can't work around.
You cannot modify Flags through the email interface.