Loading ...
Sorry, an error occurred while loading the content.

Re: Fax server with postfix

Expand Messages
  • Giedrius Augys
    My question is about , how to configure postfix , when a new message arrive to particular user, postfix executes script, which grabs subject fields and puts
    Message 1 of 8 , Oct 1, 2006
    • 0 Attachment
      My question is about , how to configure postfix , when a new message arrive to particular user, postfix executes script, which grabs subject fields and puts atachment to temp dir and later using agi I will transmit fax..

      2006/10/1, Kai Fürstenberg <postfix@...>:
      Giedrius Augys schrieb:
      > Hi,
      >  I'm newbie in mail systems. So now I'm creating asterisk fax server
      > with spandsp. And I want to run  my script, when mail  arrives to
      > particular one user (in subject field would be a fax number,
      > attachment file would be tiff or pdf). And I don't know how to do this
      > and grab attachment file. Maybe you can give me some advices how to do
      > this.
      > Thanks
      Hi,

      this is not a postfix issue. Postfix is a MDA and does not modify mail
      content, nor does is split the mail into subject, body and attachment,
      nor work on these. The other way round could be a postfix issue, when
      you receive a fax and want to send it to some mailbox unsing postfix as MDA.

      Perhaps your question would be something for the Asterisk-Users mailing
      list.

      As I know there are already solutions for email-to-fax working with
      Asterisk, but I don't use this on my own Asterisk, so I can't help you
      with this.

      Kai



      --
      Pagarbiai,
      Giedrius Augys
      Siauliu Universitetas, IST
      IP telefonijos inzinierius
      Tel. 8 41 590408
      Mob. Tel. 8 678 05790
      el. pastas voipas@...
    • Kai Fürstenberg
      ... Ok, You have a install also a MTA with filtering language (e.g. procmail). Then you can use something like mailbox_transport = procmail in main.cf. You can
      Message 2 of 8 , Oct 1, 2006
      • 0 Attachment
        Giedrius Augys schrieb:
        > My question is about , how to configure postfix , when a new message
        > arrive to particular user, postfix executes script, which grabs
        > subject fields and puts atachment to temp dir and later using agi I
        > will transmit fax..
        Ok,

        You have a install also a MTA with filtering language (e.g. procmail).
        Then you can use something like
        mailbox_transport = procmail
        in main.cf. You can also work with transport_maps to do this (please
        also read the documentation).

        Postfix does not execute any scripts on a special mail, but procmail can
        do this.

        So you need both (MDA and MTA): Postfix to accept the mail and deliver
        it to the MTA which executes the script on that mail and creates a call
        file or executing the agi-script or whatever.

        Kai
      • Giedrius Augys
        I have configured postfix by this example: # Over here we are using the scheme @fax.our.domain # with Postfix and HylaFax. Here s the setup used: #
        Message 3 of 8 , Oct 1, 2006
        • 0 Attachment
          I have configured postfix by this example:

          # Over here we are using the scheme <fax number>@...
          # with Postfix and HylaFax. Here's the setup used:
          #
          #    /etc/postfix/master.cf:
          #      fax    unix    -    n    n    -    1    pipe
          #          flags= user=fax argv=/usr/bin/faxmail -d -n ${user}
          #
          #    /etc/postfix/transport:
          #        fax.your.domain   fax:localhost
          #
          #    /etc/postfix/main.cf:
          #        transport_maps = hash:/etc/postfix/transport
          #        fax_destination_recipient_limit = 1
          #

          But in my folder I cant't find a mail. Maybe the best way is tu use procmail .

          2006/10/2, Kai Fürstenberg < postfix@...>:
          Giedrius Augys schrieb:
          > My question is about , how to configure postfix , when a new message
          > arrive to particular user, postfix executes script, which grabs
          > subject fields and puts atachment to temp dir and later using agi I
          > will transmit fax..
          Ok,

          You have a install also a MTA with filtering language ( e.g. procmail).
          Then you can use something like
          mailbox_transport = procmail
          in main.cf. You can also work with transport_maps to do this (please
          also read the documentation).

          Postfix does not execute any scripts on a special mail, but procmail can
          do this.

          So you need both (MDA and MTA): Postfix to accept the mail and deliver
          it to the MTA which executes the script on that mail and creates a call
          file or executing the agi-script or whatever.

          Kai



          --
          Pagarbiai,
          Giedrius Augys
          Siauliu Universitetas, IST
          IP telefonijos inzinierius
          Tel. 8 41 590408
          Mob. Tel. 8 678 05790
          el. pastas voipas@...
        • Kai Fürstenberg
          ... I found a tutorial which describes this configuration. As I understand this configuration, your mails are not saved in a file, but sent directly to
          Message 4 of 8 , Oct 2, 2006
          • 0 Attachment
            Giedrius Augys wrote:
            > I have configured postfix by this example:
            >
            > # Over here we are using the scheme <fax number>@...
            > # with Postfix and HylaFax. Here's the setup used:
            > #
            > # /etc/postfix/master.cf:
            > # fax unix - n n - 1 pipe
            > # flags= user=fax argv=/usr/bin/faxmail -d -n ${user}
            > #
            > # /etc/postfix/transport:
            > # fax.your.domain fax:localhost
            > #
            > # /etc/postfix/main.cf:
            > # transport_maps = hash:/etc/postfix/transport
            > # fax_destination_recipient_limit = 1
            > #
            >
            > But in my folder I cant't find a mail. Maybe the best way is tu use
            > procmail .
            >

            I found a tutorial which describes this configuration.

            As I understand this configuration, your mails are not saved in a file,
            but sent directly to /usr/bin/faxmail, which does the rest by itself.

            Can you send some logs?
            BTW: postconf -n would also be welcome.


            --
            Kai
          • Sandy Drobic
            ... Please do not top post! You can use a command in alias for that user. That user must be in a domain in mydestination for an alias command to work.
            Message 5 of 8 , Oct 2, 2006
            • 0 Attachment
              Giedrius Augys wrote:
              > My question is about , how to configure postfix , when a new message arrive
              > to particular user, postfix executes script, which grabs subject fields and
              > puts atachment to temp dir and later using agi I will transmit fax..

              Please do not top post!

              You can use a command in alias for that user. That user must be in a
              domain in mydestination for an alias command to work. Otherwise you have
              to use a pipe transport as described in the link below and use a
              check_recipient_access with the action FILTER to guide the mail to the
              pipe transport.

              /etc/aliases:
              faxuser: "|/etc/postfix/faxfilter.sh"

              A sample filter script is given here:
              http://www.postfix.org/FILTER_README.html#simple_filter

              Within that script you can do anything you want with the mail. Please take
              care that the script is working reliably otherwise you might lose mail.

              Sandy

              --
              List replies only please!
              Please address PMs to: news-reply2 (@) japantest (.) homelinux (.) com
            • mouss
              ... As Sandy said, stop top posting. if you don t know what this means, google. you can configure (and apparently you already did) postfix to run a
              Message 6 of 8 , Oct 2, 2006
              • 0 Attachment
                Giedrius Augys wrote:
                > My question is about , how to configure postfix , when a new message
                > arrive
                > to particular user, postfix executes script, which grabs subject
                > fields and
                > puts atachment to temp dir and later using agi I will transmit fax..

                As Sandy said, stop top posting. if you don't know what this means, google.

                you can configure (and apparently you already did) postfix to run a
                script/program.


                now, in your script, you can call programs that get the attachment.
                Google may help you here. if you can't find, look for ripemime (it
                however require some work).
              Your message has been successfully submitted and would be delivered to recipients shortly.