Author: hjp
Date: Wed Dec 5 08:43:33 2007
New Revision: 824
Modified:
trunk/lib/Qpsmtpd/Address.pm
Log:
Made user() and host() setters as well as getters.
Suggested by [EMAIL PROTECTED]
Modified: trunk/lib/Qpsmtpd/Address.pm
==============================================================================
--- trunk/lib/Qpsmtpd/Address.pm (original)
+++ trunk/lib/Qpsmtpd/Address.pm Wed Dec 5 08:43:33 2007
@@ -275,27 +275,35 @@
return "<".$self->address().">";
}
-=head2 user()
+=head2 user([$user])
Returns the "localpart" of the address, per RFC-2821, or the portion
before the '@' sign.
+If called with one parameter, the localpart is set and the new value is
+returned.
+
=cut
sub user {
- my ($self) = @_;
+ my ($self, $user) = @_;
+ $self->{_user} = $user if defined $user;
return $self->{_user};
}
-=head2 host()
+=head2 host([$host])
Returns the "domain" part of the address, per RFC-2821, or the portion
after the '@' sign.
+If called with one parameter, the domain is set and the new value is
+returned.
+
=cut
sub host {
- my ($self) = @_;
+ my ($self, $host) = @_;
+ $self->{_host} = $host if defined $host;
return $self->{_host};
}