Gatemail

From ISPWiki

Jump to: navigation, search

If you want your customers' email to be forwarded to the billing -> "Support center" -> E-mail, you need to customize your mail server. Use the /usr/local/ispmgr/sbin/gatemail utility to process the email and configure the mail server.

Contents

Configuring Sendmail

For example, you have a mailbox called support@example.com located on the same server. You need to forward incoming email to this server by editing /etc/mail/aliases and adding the line:

support:   "|/usr/local/ispmgr/sbin/gatemail"

Thus, the incoming email sent to the support user will be forwarded to the gatemail file.

The line may differ depending on the settings of your mail server (e.g. use of virtusertable, virtual users).

For the Redhat-like systems, such as CentOS Linux you will need to create a symbolic link by adding gatemail into the list of allowed programs:

ln -s /usr/local/ispmgr/sbin/gatemail /etc/smrsh/gatemail

Configuring Exim on FreeBSD (the FreeBSD-8-ISPmanager template)

In the /usr/local/etc/exim/domains file you need to specify

example.com:example.com::no

In the /usr/local/etc/exim/aliases file you need to specify

support@example.com:|/usr/local/ispmgr/sbin/gatemail:group


Configuring Postfix

  • Add this in the bottom of master.cf:
billmanager-pipe	unix - n n - - pipe
flags= user=apache argv=/usr/local/ispmgr/sbin/gatemail
  • Add this in main.cf if non existent already.
transport_maps = hash:/etc/postfix/transport
  • Add the custom transports:
mail1@example.com billmanager-pipe
mail2@example.com billmanager-pipe
  • Do the following:
postmap /etc/postfix/transpor
/etc/init.d/postfix reload

If a remote server receives your email messages

If a remote server receives email messages, on the billing server you should create a mailbox with a name that will be difficult for others to guess. On the mail server that normally receives emails, add a redirect to the newly created mailbox. So, you will be able to receive mail from any number of mailboxes.

If you are using Procmail

Beside the main parameters, add the following information into .procmailrc of the mailbox:

:0
|/usr/local/ispmgr/sbin/gatemail

Or you can add into the main (/etc/procmailrc) .procmailrc the following records:

:0 
* ^TO<mailbox>
|/usr/local/ispmgr/sbin/gatemail

.procmailrc of a mailbox is normally located in:

  • Linux
/var/www/<user>/data/email/<mail domain>/<mailbox>/.procmailrc
  • FreeBSD
/home/<user>/data/email/<mail domain>/<mailbox>/.procmailrc
Was this helpful? Yes | No
Personal tools