source: trunk/dports/mail/vm-pop3d/Portfile

Last change on this file was 125738, checked in by mf2k@…, 3 years ago

adodb argus-monitor base blt cacti cdpr doclifter eventlog expect gkrellm honeyd iwidgets kchmviewer libdnsres monarch moodss moomps nagios nagios-plugins nedi netmrg network-weathermap nfdump nfsen nrg nrpe nsca ntop p5-archive-zip p5-cgi p5-cgi-speedycgi p5-convert-asn1 p5-libintl-perl p5-mhonarc p5-net p5-perl-ldap rancid rrdtool scotty sendpage smokeping snort sympa syslog-ng tclx tftp-hpa tktable uplog vm-pop3d xserve-raid-tools zabbix: Ports abandoned by markd. (#44782)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.3 KB
Line 
1# $Id: Portfile 125738 2014-09-25 14:43:03Z ryandesign@macports.org $
2
3PortSystem      1.0
4
5name                            vm-pop3d 
6version                         1.1.6
7revision                        2
8categories                      mail
9license                         GPL-2
10maintainers                     nomaintainer
11platforms                       darwin
12
13description                     POP3 server for Postfix that supports virtual domains and mailboxes
14long_description                A POP3 server that supports virtual domains and virtual mailboxes \
15                                such that users and mailboxes need not be associated with local\
16                                Unix accounts.
17
18homepage                        http://www.reedmedia.net/software/virtualmail-pop3d/                                   
19master_sites                    http://www.ibiblio.org/pub/Linux/system/mail/pop/ \
20                                ftp://sunsite.unc.edu/pub/Linux/system/mail/pop/
21
22checksums                       md5 0399cc06f5329a6eaebec05d959a6ec1
23patchfiles                      patch-vm-pop3d.init
24destroot.destdir                prefix=${destroot}${prefix}
25
26depends_lib                     port:postfix
27configure.args                  --enable-virtual
28
29variant server {
30    startupitem.create    yes
31    startupitem.start "${prefix}/share/${name}/vm-pop3d.init start"
32    startupitem.stop "${prefix}/share/${name}/vm-pop3d.init stop"
33}
34
35pre-configure {
36# Set vm-pop3d.h apop file path
37        reinplace "s|/etc/apop|${prefix}/etc/${name}/apop|g" \
38                "${worksrcpath}/vm-pop3d.h"
39
40# Set vm-pop3d.h virtual directory domain spool path
41        reinplace "s|/var/spool/virtual|${prefix}/var/${name}/spool|g" \
42                "${worksrcpath}/vm-pop3d.h"
43
44# Set vm-pop3d.h virtual directory domain password path
45        reinplace "s|/etc/virtual|${prefix}/etc/${name}|g" \
46                "${worksrcpath}/vm-pop3d.h"
47}
48
49post-destroot {
50# Create spool and passwd file paths for the virtual domains
51        xinstall -m 755 -d ${destroot}${prefix}/var/${name}/spool
52        xinstall -m 755 -d ${destroot}${prefix}/etc/${name}
53        system "chown postfix:postfix ${destroot}${prefix}/var/${name}/spool"
54
55# Create lock file path
56        xinstall -m 755 -d ${destroot}${prefix}/var/${name}/lock
57
58# Keep the empty virtual spool and passwd file paths
59destroot.keepdirs \
60        ${destroot}${prefix}/var/${name}/spool \
61        ${destroot}${prefix}/var/${name}/lock \
62        ${destroot}${prefix}/etc/${name}
63
64# Install documentation type stuff
65        xinstall -d ${destroot}${prefix}/share/doc/${name}
66        xinstall -m 644 ${worksrcpath}/AUTHORS ${destroot}${prefix}/share/doc/${name}
67        xinstall -m 644 ${worksrcpath}/CHANGES ${destroot}${prefix}/share/doc/${name}
68        xinstall -m 644 ${worksrcpath}/COPYING ${destroot}${prefix}/share/doc/${name}
69        xinstall -m 644 ${worksrcpath}/FAQ ${destroot}${prefix}/share/doc/${name}
70        xinstall -m 644 ${worksrcpath}/INSTALL ${destroot}${prefix}/share/doc/${name}
71        xinstall -m 644 ${worksrcpath}/README ${destroot}${prefix}/share/doc/${name}
72        xinstall -m 644 ${worksrcpath}/TODO ${destroot}${prefix}/share/doc/${name}
73
74# Fix and copy the init script
75        reinplace "s|daemon vm-pop3d|${prefix}/sbin/vm-pop3d --user postfix --group postfix|g" \
76                "${worksrcpath}/vm-pop3d.init"
77
78        reinplace "s|/usr/local/sbin|${prefix}/sbin|g" \
79                "${worksrcpath}/vm-pop3d.init"
80
81        reinplace "s|/var/lock/subsys|${prefix}/var/${name}/lock|g" \
82                "${worksrcpath}/vm-pop3d.init"
83
84        reinplace "s|/etc/rc.d/init.d/functions|/etc/rc.common|g" \
85                "${worksrcpath}/vm-pop3d.init"
86
87        xinstall -d -m 755  ${destroot}${prefix}/share/${name}
88       
89        xinstall -m 755 ${worksrcpath}/vm-pop3d.init ${destroot}${prefix}/share/${name}
90}
91
92post-activate {
93
94ui_msg "\n#### To setup vm-pop3d with Postfix ####
95
96Notice: The paths to files used by vm-pop3d are hard coded at compile time so
97         if you deviate from the paths described below vm-pop3d will not work.
98
991) Setup Postfix (if first-time setup) and create spool directories
100   for your vm-pop3d virtual domains.
101
102        cd ${prefix}/etc/postfix
103        sudo cp master.cf.sample master.cf
104        sudo cp main.cf.sample main.cf
105 
106        sudo mkdir ${prefix}/var/${name}/spool/my-vdomain1.com
107        sudo chown postfix:postfix ${prefix}/var/${name}/spool/my-vdomain1.com
108        sudo chmod 775 ${prefix}/var/${name}/spool/my-vdomain1.com
109
110
1112) Configure Postfix for virtual mailboxes
112
113   Add to main.cf
114
115        virtual_mailbox_base = ${prefix}/var/${name}/spool
116        virtual_mailbox_maps = hash:${prefix}/etc/${name}/vmailbox_maps
117        virtual_mailbox_domains = hash:${prefix}/etc/${name}/vdomain_maps
118        virtual_uid_maps = static:<postfix user's uid>
119        virtual_gid_maps = static:<postfix user's gid>
120        virtual_mailbox_lock = dotlock
121        virtual_minimum_uid = <postfix user's uid>
122
123   NOTE: Do NOT include the virtual domain name in main.cf's \$mydestination
124         or Postfix will reject mail to this domain since local (Unix) accounts
125         for virtual domains do not exist.
126
127
1283) Create virtual mailbox lookup tables
129
130        sudo touch ${prefix}/etc/${name}/vdomain_maps (contents below)
131
132   my-vdomain1.com     placeholder (any text)
133   my-vdomain2.com     placeholder
134
135        sudo touch ${prefix}/etc/vm-pop3d/vmailbox_maps (contents below)
136
137   user1@my-vdomain1.com         my-vdomain1.com/user1
138   user2@my-vdomain1.com         my-vdomain1.com/user2
139
140        sudo postmap ${prefix}/etc/${name}/vdomain_maps (make .db hash files)
141        sudo postmap ${prefix}/etc/${name}/vmailbox_maps
142
143
1444) Restart Postfix and test SMTP message delivery to virtual domains
145
146        sudo postfix reload
147
148   Now send an email to an account in a virtual domain; look here to see if
149   messages are arriving:
150
151        ls ${prefix}/var/${name}/spool/my-vdomainx.com for messages.
152
153   Check the error logs for either delivery errors or (after next step)
154   POP errors:
155
156        tail /var/log/mail.log
157
158
1595) Create virtual domain passwd files, substituting real domain names for my-vdomain
160
161        cd ${prefix}/etc/${name}
162        sudo mkdir my-vdomain1.com
163        cd my-vdomain1.com
164        sudo htpasswd -c passwd user1 (-c creates the file 'passwd' to hold the 1st vdomain1 user)
165        sudo htpasswd passwd user2 (don't need -c for subsequent users of the vdomain1)
166
167
1686) Set vm-pop3d to launch at startup with launchctl, start it, and test POP access to virtual domains with telnet
169
170   OS X 10.4 - Run launchctl so Nagios will start at system boot
171        sudo launchctl load -w /Library/LaunchDaemons/org.macports.vm-pop3d.plist
172
173   OS X 10.3 and previous - A startup item was created in /Library/StartupItems
174        Add \"VMPOP-3D=-YES-\" to the /etc/hostconfig file to run vm-pop3d at system boot
175
176   Start vm-pop3d manually:
177        sudo ${prefix}/share/vm-pop3d/vm-pop3d.init start (stop|status)
178
179        telnet localhost 110  (response ->)  +OK POP3 Welcome to vm-pop3d 1.x.x
180        USER <user@domain>
181        PASS <password>
182        LIST (to see messages)
183        RETR 1 (to view message #1)
184
185   Documentation is in ${prefix}/share/doc/${name}\n"
186}
Note: See TracBrowser for help on using the repository browser.