Просмотр исходного кода

Fixed issue#326 - Create emails via fetchmail / procmail.

Martin Edenhofer 8 лет назад
Родитель
Сommit
743700fe25
3 измененных файлов с 87 добавлено и 42 удалено
  1. 6 2
      app/models/channel/driver/mail_stdin.rb
  2. 0 40
      doc/X-Headers.txt
  3. 81 0
      doc/x-headers.md

+ 6 - 2
app/models/channel/driver/mail_stdin.rb

@@ -12,13 +12,17 @@ e. g.
 
   cat test/fixtures/mail1.box | rails r 'Channel::Driver::MailStdin.new'
 
+e. g. if you want to trust on mail headers
+
+  cat test/fixtures/mail1.box | rails r 'Channel::Driver::MailStdin.new(trusted: true)'
+
 =end
 
-  def initialize
+  def initialize(params = {})
     Rails.logger.info 'read main from STDIN'
 
     msg = ARGF.read
 
-    process({}, msg)
+    process(params, msg)
   end
 end

+ 0 - 40
doc/X-Headers.txt

@@ -1,40 +0,0 @@
-X-Zammad-Priority: (1 low|2 normal|3 high)
-------------------------------------------
-Set priority of ticket (for whole list check your database).
-
-X-Zammad-Group: [one system group]
-----------------------------------
-Presort of group (highest sort priority).
-
-X-Zammad-Owner: [login of agent]
---------------------------------
-Assign ticket to agent.
-
-X-Zammad-Ignore: [yes|true]
--------------------------
-Ignore this email.
-
-X-Zammad-State: (new|open|...)
-------------------------------
-Set state of ticket (for whole list check your database)! Be careful!
-
-X-Zammad-Article-Sender: (Agent|System|Customer)
--------------------------------------------------
-Info about the sender.
-
-X-Zammad-Article-Type: (email|phone|fax|sms|webrequest|note|twitter status|direct-message|facebook|...)
--------------------------------------------------------------------------------------------------------
-Article type (for whole list check your database).
-
-X-Zammad-Article-Visibility: (internal|external)
-------------------------------------------------
-Article visibility.
-
-X-Zammad-Customer-Email: [email address]
-----------------------------------------
-Set customer via explicit email.
-
-X-Zammad-Customer-Login: [login]
---------------------------------
-Set customer via explicit login.
-

+ 81 - 0
doc/x-headers.md

@@ -0,0 +1,81 @@
+# Ticket-Attributes
+
+For ticket creation use "X-Zammad-Ticket-Attribute: some value", if you want to change
+ticket attributes on follow up, use "X-Zammad-Ticket-FollowUp-Attribute: some value".
+
+
+## X-Zammad-Ticket-Priority
+
+Example: X-Zammad-Ticket-Priority: (1 low|2 normal|3 high)
+
+Set priority of ticket (for whole list check your database).
+
+
+## X-Zammad-Ticket-Group
+
+Example: X-Zammad-Ticket-Group: [one system group]
+
+Presort of group (highest sort priority).
+
+
+## X-Zammad-Ticket-Owner
+
+Example: X-Zammad-Ticket-Owner: [login of agent]
+
+Assign ticket to agent.
+
+
+## X-Zammad-Ticket-State
+
+Example: X-Zammad-Ticket-State: (new|open|...)
+
+Set state of ticket (for whole list check your database)! Be careful!
+
+## X-Zammad-Customer-Email
+
+Example: X-Zammad-Customer-Email: [email address]
+
+Set customer via explicit email.
+
+
+## X-Zammad-Customer-Login
+
+Example: X-Zammad-Customer-Login: [login]
+
+Set customer via explicit login.
+
+
+# Article-Attributes
+
+Every time if an article is created (new ticket or/and follow up) you can use
+"X-Zammad-Article-Attribute: some value".
+
+
+## X-Zammad-Article-Sender
+
+Example: X-Zammad-Article-Sender: (Agent|System|Customer)
+
+Info about the sender.
+
+
+## X-Zammad-Article-Type
+
+Example: X-Zammad-Article-Type: (email|phone|fax|sms|webrequest|note|twitter status|direct-message|facebook|...)
+
+Article type (for whole list check your database).
+
+
+##  X-Zammad-Article-Visibility
+
+Example: X-Zammad-Article-Visibility: (internal|external)
+
+Article visibility.
+
+
+# Ignore Header
+
+If you want to ignore whole email, just set the "X-Zammad-Ignore" header.
+
+Example: X-Zammad-Ignore: [yes|true]
+
+Ignore this email.