1

Topic: alias to give mails to external script

==== Provide basic information to help troubleshoot ====
- iRedMail version:  0.7.3
- Linux/BSD distribution name and version:   Debian 6.0.2
- Any related log? Log is helpful for troubleshooting.
====
hi,

i like to implement a email address (lets say pdf@my.domain) with a special funktion to convert a attachment to pdf. This is done by a shell script.

Now i like to add a alias in /etc/postfix/aliases like this

pdf:   "|/usr/local/bin/pdf-converter.sh"

But if i send a mail to pdf@my.domain i get back "unknown user".

I tried to allow
pdf@ OK
with the description in the wiki post below
http://www.iredmail.org/wiki/index.php? … al_aliases

Bit it is still the same.

Is there any chance to forward incomming mails for a special user to my script?

Thx
Stefan

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: alias to give mails to external script

I created a quick and dirty wiki tutorial for this problem:
http://iredmail.org/wiki/index.php?titl … nal.Script

Please let me know if it's not clear to you.

Reference: http://wiki.zimbra.com/wiki/Configuring … ed_scripts

3

Re: alias to give mails to external script

Hi,

yes it is clear and worked perfect for me. After setup the transport to my script i get still the user unknown message but after i set up this mailbox just as a dummy it works.

Is there a way to allow for example pdf@my.domain without creating this user? Because the mailbox isn´t needed, the mail needs only to be processed my my script.

Thanks,

Stefan

ZhangHuangbin wrote:

I created a quick and dirty wiki tutorial for this problem:
http://iredmail.org/wiki/index.php?titl … nal.Script

Please let me know if it's not clear to you.

Reference: http://wiki.zimbra.com/wiki/Configuring … ed_scripts

==== Provide basic information to help troubleshoot ====
- iRedMail version:
- Linux/BSD distribution name and version:
- Any related log? Log is helpful for troubleshooting.
====

4

Re: alias to give mails to external script

stefan73er wrote:

Is there a way to allow for example pdf@my.domain without creating this user? Because the mailbox isn´t needed, the mail needs only to be processed my my script.

You must let Postfix know you have this account exist, either in MySQL/LDAP or in a hash file.

5

Re: alias to give mails to external script

ZhangHuangbin wrote:
stefan73er wrote:

Is there a way to allow for example pdf@my.domain without creating this user? Because the mailbox isn´t needed, the mail needs only to be processed my my script.

You must let Postfix know you have this account exist, either in MySQL/LDAP or in a hash file.

==== Provide basic information to help troubleshoot ====
- iRedMail version:
- Linux/BSD distribution name and version:
- Any related log? Log is helpful for troubleshooting.
====

yes i know. i tried it this way

http://www.iredmail.org/wiki/index.php? … al_aliases

but is does not work.

Thx,

Stefan

6

Re: alias to give mails to external script

That tutorial doesn't work for you. Try this one:

- Prepend new alias file in Postfix "virtual_mailbox_maps":

virtual_mailbox_maps = hash:/etc/postfix/special_users, [...OMIT OTHER EXISTING SETTINGS...]

- Create file /etc/postfix/special_users:

pdf@my.domain /tmp/

- Run postmap command:

# postmap hash:/etc/postfix/special_users

- Restart Postfix.